Skip to content

Commit

Permalink
Fix if and submit all disc/track keys as integers
Browse files Browse the repository at this point in the history
Falls back to using strings if stoi() throws invalid_argument.
  • Loading branch information
redactedscribe authored and phw committed Oct 25, 2023
1 parent a84d2db commit 579cc93
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/play.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,14 @@ namespace lbz
{
additional_info["albumartist"] = value;
}
if (name == "tracknumber")
else if (name == "discnumber" || name == "totaldiscs" || name == "totaltracks" || name == "tracknumber")
{
additional_info[name] = stoi(value);
try {
additional_info[name] = stoi(value);
}
catch (const std::invalid_argument& e) {
additional_info[name] = value;
}
}
else
{
Expand Down

0 comments on commit 579cc93

Please sign in to comment.