[Audio-3.2] Fix an issue with mixplaylist being recognised as single tracks (#3104)

* Fix an issue with mixplaylist being recognised as single tracks

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* Add changelogs

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
This commit is contained in:
Draper 2019-11-11 16:59:51 +00:00 committed by Michael H
parent 710b520da9
commit 33178ef034
2 changed files with 7 additions and 3 deletions

View File

@ -0,0 +1 @@
Fix an issue where some YouTube playlists were being recognised as single tracks.

View File

@ -381,14 +381,17 @@ class Query:
match = re.search(_re_youtube_index, track) match = re.search(_re_youtube_index, track)
if match: if match:
returning["track_index"] = int(match.group(1)) - 1 returning["track_index"] = int(match.group(1)) - 1
if all(k in track for k in ["&list=", "watch?"]): if all(k in track for k in ["&list=", "watch?"]):
returning["track_index"] = 0 returning["track_index"] = 0
returning["playlist"] = True returning["playlist"] = True
returning["single"] = False returning["single"] = False
elif all(x in track for x in ["playlist?"]): elif all(x in track for x in ["playlist?"]):
returning["playlist"] = True if not _has_index else False returning["playlist"] = not _has_index
returning["single"] = True if _has_index else False returning["single"] = _has_index
elif any(k in track for k in ["list="]):
returning["track_index"] = 0
returning["playlist"] = True
returning["single"] = False
else: else:
returning["single"] = True returning["single"] = True
elif url_domain == "spotify.com": elif url_domain == "spotify.com":