feat: improve metadata gen. networking and performance

This makes the metadata generation code a lot messier and harder to use,
but there's not really much else that can be done about it while
preserving all it's capabilities :(

At least we now have speed

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow
2022-06-16 11:45:29 -03:00
parent 91a5c4bdcb
commit 4e6978ff6f
7 changed files with 641 additions and 335 deletions

View File

@ -17,7 +17,7 @@ class ModUpdateDialog final : public ReviewMessageBox {
public:
explicit ModUpdateDialog(QWidget* parent,
BaseInstance* instance,
const std::shared_ptr<ModFolderModel>& mod_model,
const std::shared_ptr<ModFolderModel> mod_model,
std::list<Mod>& search_for);
void checkCandidates();
@ -35,21 +35,21 @@ class ModUpdateDialog final : public ReviewMessageBox {
private slots:
void onMetadataEnsured(Mod&);
void onMetadataFailed(Mod&);
void onMetadataFailed(Mod&, bool try_others = false, ModPlatform::Provider first_choice = ModPlatform::Provider::MODRINTH);
private:
QWidget* m_parent;
SequentialTask m_check_task;
ModrinthCheckUpdate* m_modrinth_check_task = nullptr;
FlameCheckUpdate* m_flame_check_task = nullptr;
const std::shared_ptr<ModFolderModel>& m_mod_model;
const std::shared_ptr<ModFolderModel> m_mod_model;
std::list<Mod>& m_candidates;
std::list<Mod> m_modrinth_to_update;
std::list<Mod> m_flame_to_update;
SequentialTask* m_second_try_metadata;
std::list<Mod> m_failed_metadata;
std::list<std::tuple<Mod, QString, QUrl>> m_failed_check_update;