Update score.js for records no longer in music_db (#3)
Quick guard matching other functions to stop getReleaseDate() from failing
This commit is contained in:
@@ -20,6 +20,9 @@ function getReleaseDate(musicid) {
|
||||
//console.log(music_db["mdb"]["music"])
|
||||
//console.log(musicid+" "+type);
|
||||
var result = music_db["mdb"]["music"].filter(object => object["@id"] == musicid);
|
||||
if (result.length == 0) {
|
||||
return "Unknown";
|
||||
}
|
||||
return result[0]["info"]["distribution_date"]["#text"]
|
||||
//console.log(result);
|
||||
}
|
||||
@@ -286,4 +289,4 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user