mirror of
https://github.com/beetbox/beets.git
synced 2026-12-01 07:38:04 -06:00
Formatting
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user