Commit Graph

21 Commits

Author SHA1 Message Date
flow
6a18079953
refactor: generalize mod models and APIs to resources
Firstly, this abstract away behavior in the mod download models that can
also be applied to other types of resources into a superclass, allowing
other resource types to be implemented without so much code duplication.

For that, this also generalizes the APIs used (currently, ModrinthAPI
and FlameAPI) to be able to make requests to other types of resources.

It also does a general cleanup of both of those. In particular, this
makes use of std::optional instead of invalid values for errors and,
well, optional values :p

This is a squash of some commits that were becoming too interlaced
together to be cleanly separated.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:00 -03:00
flow
d35c2db41e
fix: separate types of std::string in Packwiz
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-04 16:53:25 -03:00
Trial97
600c49f7f0
Replaced tomlc99 with tomlplusplus
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
2022-09-24 00:10:27 +03:00
flow
fd6755c93f
change: mod metadata improvements
- Use slug instead of name
- Keep temporary status before having local details

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:43 -03:00
flow
91a5c4bdcb
feat: add metadata get/delete via mod id
This is, in many cases, more reliable than name comparisons, so it's
useful specially in cases where a mod changes name between versions

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:43 -03:00
flow
5a1de15332
fix: use a more robust method of finding metadata indexes
Often times, mods can have their name in different forms, changing one
letter to caps or the other way (e.g. JourneyMaps -> Journeymaps).
This makes it possible to find those as well, which is not perfect by
any means, but should suffice for the majority of cases.
2022-05-23 14:58:15 -03:00
flow
42f8ec5b14
fix: do modrinth changes on flame too
Also fix a dumb moment
2022-05-23 14:58:14 -03:00
flow
2fc1b99911
chore: add license headers
Prevents a massive inload of Scrumplex ditto's :)

I didn't add it to every file modified in this PR because the other
changes are pretty minor, and would explode the diff of the PR. I hope
that's not a problem O_O
2022-05-23 14:58:14 -03:00
flow
0985adfd74
change: support newest changes with packwiz regarding CF 2022-05-23 14:58:08 -03:00
flow
59d628208b
feat: allow trying to use multiple hash types 2022-05-23 14:43:31 -03:00
flow
67e0214fa5
fix: don't try to delete mods multiple times
Shows a more helpful message if there's a parsing error when reading the
index file.

Also fixes a clazy warning with using the `.data()` method in a
temporary QByteArray object.
2022-05-23 14:43:10 -03:00
flow
e17b6804a7
fix: implement PR suggestions
Some stylistic changes, and get hashes from the mod providers when
building the metadata.
2022-05-23 14:43:09 -03:00
flow
96e36f0604
refactor: make mod metadata presence (or lack of) easier to find out 2022-05-23 14:43:09 -03:00
flow
a99858c64d
refactor: move code out of ModIndex.h
Now it's in ModIndex.cpp
2022-05-23 14:43:07 -03:00
flow
ba50765c30
tidy: apply clang-tidy to some files
Mostly the ones created in this PR + Mod.h / Mod.cpp / ModDetails.h
2022-05-23 14:42:28 -03:00
flow
d7f6b36990
test+fix: add basic tests and fix issues with it 2022-05-23 14:42:28 -03:00
flow
fab4a7a602
refactor: abstract metadata handling and clarify names 2022-05-23 14:42:28 -03:00
flow
092d2f8917
feat: add support for converting builtin -> packwiz mod formats
Also adds more documentation.
2022-05-23 14:42:28 -03:00
flow
e93b9560b5
feat: add method to delete mod metadata
Also moves indexDir setting from LocalModUpdateTask -> ModFolderModel
2022-05-23 14:42:27 -03:00
flow
8e4438b375
feat: add parser for current impl of packwiz mod.toml
This reads a local mod.toml file and extract information from it. Using
C libs in C++ is kind of a pain tho :(
2022-05-23 14:42:27 -03:00
flow
b30b88716e
feat: add very early mod.toml packwiz support
Also use it as a on-disk format for storing mod metadata. This will be
used later on to make better mod managment.
2022-05-23 14:42:22 -03:00