mirror of
https://github.com/beetbox/beets.git
synced 2025-12-29 12:02:44 +01:00
Formatting
This commit is contained in:
parent
537b57d99d
commit
47584f20cb
1 changed files with 5 additions and 2 deletions
|
|
@ -150,6 +150,7 @@ class ListenBrainzPlugin(BeetsPlugin):
|
|||
def get_listenbrainz_playlists(self):
|
||||
"""Returns a list of playlists created by ListenBrainz."""
|
||||
import re
|
||||
|
||||
resp = self.get_playlists_createdfor(self.username)
|
||||
playlists = resp.get("playlists")
|
||||
listenbrainz_playlists = []
|
||||
|
|
@ -158,7 +159,9 @@ class ListenBrainzPlugin(BeetsPlugin):
|
|||
playlist_info = playlist.get("playlist")
|
||||
if playlist_info.get("creator") == "listenbrainz":
|
||||
title = playlist_info.get("title")
|
||||
match = re.search(r"(Missed Recordings of \d{4}|Discoveries of \d{4})", title)
|
||||
match = re.search(
|
||||
r"(Missed Recordings of \d{4}|Discoveries of \d{4})", title
|
||||
)
|
||||
if "Exploration" in title:
|
||||
playlist_type = "Exploration"
|
||||
elif "Jams" in title:
|
||||
|
|
@ -178,7 +181,7 @@ class ListenBrainzPlugin(BeetsPlugin):
|
|||
id = identifier.split("/")[-1]
|
||||
if playlist_type in ["Jams", "Exploration"]:
|
||||
listenbrainz_playlists.append(
|
||||
{"type": playlist_type, "date": date, "identifier": id}
|
||||
{"type": playlist_type, "date": date, "identifier": id}
|
||||
)
|
||||
return listenbrainz_playlists
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue