Skip to content

Commit

Permalink
Update DeezerAudioSourceManager.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Nansess authored Sep 29, 2024
1 parent 7ac66d5 commit 09c93e3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ private List<AudioTrack> parseTracks(JsonBrowser json, boolean preview) {
if (!track.get("type").text().equals("track")) {
continue;
}
if (!track.get("readable").as(Boolean.class)) {
if (!track.get("readable").asBoolean(false)) {
log.warn("Skipping track {} by {} because it is not readable. Available countries: {}", track.get("title").text(), track.get("artist").get("name").text(), track.get("available_countries").text());
continue;
}
Expand All @@ -302,8 +302,8 @@ private List<AudioTrack> parseTracks(JsonBrowser json, boolean preview) {
}

private AudioTrack parseTrack(JsonBrowser json, boolean preview) {
Boolean readable = json.get("readable").as(Boolean.class);
if (readable == null || !readable) {
boolean readable = json.get("readable").asBoolean(false);
if (!readable) {
throw new FriendlyException("This track is not readable. Available countries: " + json.get("available_countries").text(), FriendlyException.Severity.COMMON, null);
}
var id = json.get("id").text();
Expand Down

0 comments on commit 09c93e3

Please sign in to comment.