Fixed tipo
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
2c744da9f7
commit
b4fa6e120a
@ -85,7 +85,7 @@ class FlameAPI : public NetworkResourceAPI {
|
|||||||
return url + get_parameters.join('&');
|
return url + get_parameters.join('&');
|
||||||
};
|
};
|
||||||
|
|
||||||
[[nodiscard]] std::optional<QString> getDependecyURL(DependencySearchArgs const& args) const override
|
[[nodiscard]] std::optional<QString> getDependencyURL(DependencySearchArgs const& args) const override
|
||||||
{
|
{
|
||||||
return QString("https://api.curseforge.com/v1/mods/%1/files?pageSize=10000&gameVersion=%2&modLoaderType=%")
|
return QString("https://api.curseforge.com/v1/mods/%1/files?pageSize=10000&gameVersion=%2&modLoaderType=%")
|
||||||
.arg(args.dependency.addonId.toString())
|
.arg(args.dependency.addonId.toString())
|
||||||
|
@ -123,13 +123,13 @@ Task::Ptr NetworkResourceAPI::getProject(QString addonId, QByteArray* response)
|
|||||||
|
|
||||||
Task::Ptr NetworkResourceAPI::getDependencyVersion(DependencySearchArgs&& args, DependencySearchCallbacks&& callbacks) const
|
Task::Ptr NetworkResourceAPI::getDependencyVersion(DependencySearchArgs&& args, DependencySearchCallbacks&& callbacks) const
|
||||||
{
|
{
|
||||||
auto versions_url_optional = getDependecyURL(args);
|
auto versions_url_optional = getDependencyURL(args);
|
||||||
if (!versions_url_optional.has_value())
|
if (!versions_url_optional.has_value())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
auto versions_url = versions_url_optional.value();
|
auto versions_url = versions_url_optional.value();
|
||||||
|
|
||||||
auto netJob = makeShared<NetJob>(QString("%1::Dependecy").arg(args.dependency.addonId.toString()), APPLICATION->network());
|
auto netJob = makeShared<NetJob>(QString("%1::Dependency").arg(args.dependency.addonId.toString()), APPLICATION->network());
|
||||||
auto response = new QByteArray();
|
auto response = new QByteArray();
|
||||||
|
|
||||||
netJob->addNetAction(Net::Download::makeByteArray(versions_url, response));
|
netJob->addNetAction(Net::Download::makeByteArray(versions_url, response));
|
||||||
|
@ -20,5 +20,5 @@ class NetworkResourceAPI : public ResourceAPI {
|
|||||||
[[nodiscard]] virtual auto getSearchURL(SearchArgs const& args) const -> std::optional<QString> = 0;
|
[[nodiscard]] virtual auto getSearchURL(SearchArgs const& args) const -> std::optional<QString> = 0;
|
||||||
[[nodiscard]] virtual auto getInfoURL(QString const& id) const -> std::optional<QString> = 0;
|
[[nodiscard]] virtual auto getInfoURL(QString const& id) const -> std::optional<QString> = 0;
|
||||||
[[nodiscard]] virtual auto getVersionsURL(VersionSearchArgs const& args) const -> std::optional<QString> = 0;
|
[[nodiscard]] virtual auto getVersionsURL(VersionSearchArgs const& args) const -> std::optional<QString> = 0;
|
||||||
[[nodiscard]] virtual auto getDependecyURL(DependencySearchArgs const& args) const -> std::optional<QString> = 0;
|
[[nodiscard]] virtual auto getDependencyURL(DependencySearchArgs const& args) const -> std::optional<QString> = 0;
|
||||||
};
|
};
|
||||||
|
@ -143,7 +143,7 @@ class ModrinthAPI : public NetworkResourceAPI {
|
|||||||
|
|
||||||
inline auto validateModLoaders(ModLoaderTypes loaders) const -> bool { return loaders & (Forge | Fabric | Quilt); }
|
inline auto validateModLoaders(ModLoaderTypes loaders) const -> bool { return loaders & (Forge | Fabric | Quilt); }
|
||||||
|
|
||||||
[[nodiscard]] std::optional<QString> getDependecyURL(DependencySearchArgs const& args) const override
|
[[nodiscard]] std::optional<QString> getDependencyURL(DependencySearchArgs const& args) const override
|
||||||
{
|
{
|
||||||
return args.dependency.version.length() != 0 ? QString("%1/version/%2").arg(BuildConfig.MODRINTH_PROD_URL, args.dependency.version)
|
return args.dependency.version.length() != 0 ? QString("%1/version/%2").arg(BuildConfig.MODRINTH_PROD_URL, args.dependency.version)
|
||||||
: QString("%1/project/%2/version?game_versions=[\"%1\"]&loaders=[\"%1\"]")
|
: QString("%1/project/%2/version?game_versions=[\"%1\"]&loaders=[\"%1\"]")
|
||||||
|
Loading…
Reference in New Issue
Block a user