Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
arsaboo committed Dec 22, 2023
1 parent 537b57d commit 47584f2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions beetsplug/listenbrainz.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def get_playlists_createdfor(self, username):
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 = []
Expand All @@ -158,7 +159,9 @@ def get_listenbrainz_playlists(self):
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:
Expand All @@ -178,7 +181,7 @@ def get_listenbrainz_playlists(self):
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

Expand Down

0 comments on commit 47584f2

Please sign in to comment.