Replace explicit string checks whether a playlist íd is a certain YouTube Mix type with calling the dedicated methods

This commit is contained in:
TobiGr 2020-12-25 15:00:31 +01:00
parent 3033c0b993
commit d9e2da53c3
1 changed files with 6 additions and 6 deletions

View File

@ -229,14 +229,14 @@ public class YoutubeParsingHelper {
if (playlistId.startsWith("RDMM")) { // My Mix
return playlistId.substring(4);
} else if (playlistId.startsWith("RDAMVM") || playlistId.startsWith("RDCLAK")) { //Music mix
} else if (isYoutubeMusicMixId(playlistId)) { // starts with "RDAMVM" or "RDCLAK"
return playlistId.substring(6);
} else if (playlistId.startsWith("RMCM")) { //Channel mix
} else if (isYoutubeChannelMixId(playlistId)) { // starts with "RMCM"
// Channel mix are build with RMCM{channelId}, so videoId can't be determined
throw new ParsingException("Video id could not be determined from mix id: " + playlistId);
} else if (playlistId.startsWith("RD")) { // Normal mix
} else if (isYoutubeMixId(playlistId)) { // normal mix, starts with "RD"
return playlistId.substring(2);
} else { // not a mix