Handle tracks with no performer returned by Qobuz

This commit is contained in:
Al Beano 2017-12-06 17:45:41 +00:00
parent 86e228cacf
commit 75a1a7521a
2 changed files with 9 additions and 1 deletions

View File

@ -68,7 +68,13 @@ int main(string[] args)
num = track["track_number"].integer.text;
discNum = track["media_number"].integer.text;
trackName = track["title"].str;
trackArtist = track["performer"]["name"].str;
try {
trackArtist = track["performer"]["name"].str;
} catch (Exception e) {
// Qobuz doesn't return a "performer" for all albums, and I'm not sure about
// the best way to deal with this. Leaving blank for now.A
trackArtist = "";
}
if (num.length < 2)
num = "0"~num;
writef(" [%s/%s] %s... ", discNum, num, trackName);

View File

@ -91,3 +91,5 @@ string getArtUrl(string id) {
string b = id[9..11];
return "http://static.qobuz.com/images/covers/"~a~"/"~b~"/"~id~"_max.jpg";
}
// ex: set tabstop=2 expandtab: