Skip to content

Commit

Permalink
fixed substring (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nansess committed Jul 19, 2024
1 parent 6af620a commit bb1a603
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ private AudioTrack parseTrack(JsonBrowser json, boolean preview, String artistAr
if (artistUrl != null && (artistUrl.isEmpty() || artistUrl.startsWith("https://music.apple.com/WebObjects/MZStore.woa/wa/viewCollaboration"))) {
artistUrl = null;
}
var paramIndex = trackUrl.indexOf('?');
return new AppleMusicAudioTrack(
new AudioTrackInfo(
attributes.get("name").text(),
Expand All @@ -453,7 +454,7 @@ private AudioTrack parseTrack(JsonBrowser json, boolean preview, String artistAr
attributes.get("albumName").text(),
// Apple doesn't give us the album url, however the track url is
// /albums/{albumId}?i={trackId}, so if we cut off that parameter it's fine
trackUrl.substring(0, trackUrl.indexOf('?')),
paramIndex == -1 ? null : trackUrl.substring(0, paramIndex),
artistUrl,
artistArtwork,
attributes.get("previews").index(0).get("hlsUrl").text(),
Expand Down

0 comments on commit bb1a603

Please sign in to comment.