Skip to content

Commit

Permalink
V2022.10.1-beta1
Browse files Browse the repository at this point in the history
  • Loading branch information
nlogozzo committed Oct 7, 2022
1 parent db6f823 commit 9ef4619
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 8 deletions.
2 changes: 1 addition & 1 deletion org.nickvision.tagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
{
"type": "git",
"url": "https://github.com/nlogozzo/NickvisionTagger.git",
"tag": "2022.10.1-next"
"tag": "2022.10.1-beta1"
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion org.nickvision.tagger.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<binary>org.nickvision.tagger</binary>
</provides>
<releases>
<release version="2022.10.1-next" date="2022-10-01">
<release version="2022.10.1-beta1" date="2022-10-07">
<description>
<p>- Added the ability to submit tag metadata to AcoustId</p>
<p>- Improved 'Download MusicBrainz Metadata' accuracy</p>
Expand All @@ -47,3 +47,4 @@
<content_rating type="oars-1.1" />
</component>


30 changes: 26 additions & 4 deletions src/models/acoustidsubmission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using namespace NickvisionTagger::Helpers;
using namespace NickvisionTagger::Models;

AcoustIdSubmission::AcoustIdSubmission(const std::string& clientAPIKey, const std::string& userAPIKey, int duration, const std::string& fingerprint) : m_lookupUrl{ "https://api.acoustid.org/v2/submit?client=" + clientAPIKey + "&user=" + userAPIKey + "&wait=3&&duration.0=" + std::to_string(duration) + "&fingerprint.0=" + fingerprint }
AcoustIdSubmission::AcoustIdSubmission(const std::string& clientAPIKey, const std::string& userAPIKey, int duration, const std::string& fingerprint) : m_lookupUrl{ "https://api.acoustid.org/v2/submit?client=" + clientAPIKey + "&user=" + userAPIKey + "&wait=3&&duration.0=" + std::to_string(duration) + "&fingerprint.0=" + fingerprint }, m_clientAPIKey{ clientAPIKey }
{

}
Expand Down Expand Up @@ -74,12 +74,34 @@ bool AcoustIdSubmission::submit()
return false;
}
//Get First Submission
Json::Value& jsonFirstResult{ jsonRoot["submissions"][0] };
if(jsonFirstResult.isNull())
const Json::Value& jsonFirstSubmisison{ jsonRoot["submissions"][0] };
if(jsonFirstSubmisison.isNull())
{
return false;
}
return true;
std::string submissionId{ jsonFirstSubmisison.get("id", "").asString() };
if(submissionId.empty())
{
return false;
}
std::string status{ jsonFirstSubmisison.get("status", "").asString() };
std::string statusLookupUrl{ "https://api.acoustid.org/v2/submission_status?client=" + m_clientAPIKey + "&id=" + submissionId };
while(status == "pending")
{
std::string statusReponse{ CurlHelpers::getResponseString(statusLookupUrl) };
Json::Value jsonStatusRoot{ JsonHelpers::getValueFromString(statusReponse) };
if(jsonRoot.get("status", "error").asString() != "ok")
{
break;
}
const Json::Value& jsonStatusFirstSubmission{ jsonStatusRoot["submissions"][0] };
if(jsonStatusFirstSubmission.isNull())
{
break;
}
status = jsonFirstSubmisison.get("status", "").asString();
}
return status == "imported";
}


Expand Down
1 change: 1 addition & 0 deletions src/models/acoustidsubmission.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ namespace NickvisionTagger::Models

private:
std::string m_lookupUrl;
std::string m_clientAPIKey;
/**
* Submits a fingerprint to AcoustId
*
Expand Down
5 changes: 3 additions & 2 deletions src/ui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Application::Application(const std::string& id, GApplicationFlags flags) : m_adw
m_appInfo.setName("NickvisionTagger");
m_appInfo.setShortName("Tagger");
m_appInfo.setDescription("An easy-to-use music tag (metadata) editor.");
m_appInfo.setVersion("2022.10.1-next");
m_appInfo.setChangelog("<ul><li>Added the ability to submit tag metadata to AcoustId</li><li>Improved 'Download MusicBrainz Metadata' accuracy</li><li>Improved 'Download MusicBrainz Metadata' performance</li><li>- Improved file size calculation</li></ul>");
m_appInfo.setVersion("2022.10.1-beta1");
m_appInfo.setChangelog("<ul><li>Added the ability to submit tag metadata to AcoustId</li><li>Improved 'Download MusicBrainz Metadata' accuracy</li><li>Improved 'Download MusicBrainz Metadata' performance</li><li>Improved file size calculation</li></ul>");
m_appInfo.setGitHubRepo("https://github.com/nlogozzo/NickvisionTagger");
m_appInfo.setIssueTracker("https://github.com/nlogozzo/NickvisionTagger/issues/new");
m_appInfo.setSupportUrl("https://github.com/nlogozzo/NickvisionTagger/discussions");
Expand Down Expand Up @@ -47,3 +47,4 @@ void Application::onActivate(GtkApplication* app)
m_mainWindow->start();
}


0 comments on commit 9ef4619

Please sign in to comment.