Skip to content

Commit

Permalink
Fixes #28
Browse files Browse the repository at this point in the history
  • Loading branch information
cmathews393 committed Jul 1, 2024
1 parent 98c97d0 commit d5addfa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion spotiplex/modules/lidarr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def lidarr_request(
logger.debug(f"Error during request: {e}")
return None

def playlist_request(self: "LidarrClass") -> list[str]:
def playlist_request(self: "LidarrClass") -> list[list[str]]:
"""Request and process playlists from Lidarr."""
endpoint: str = "/api/v1/importlist"
raw_playlists: dict | None = self.lidarr_request(endpoint_path=endpoint)
Expand Down
11 changes: 8 additions & 3 deletions spotiplex/modules/spotiplex/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ def get_user_list(self: "Spotiplex") -> list[str]:
def get_sync_lists(self: "Spotiplex") -> None:
"""Runs function to get lidarr lists or splits manual playlists to list."""
if self.lidarr:
self.sync_lists = self.lidarr_service.playlist_request()
self.sync_lists: list[str] = Config.MANUAL_PLAYLISTS.split(",")
lidarr_lists: list[str] = self.lidarr_service.playlist_request()[0]
self.sync_lists: list[str] = lidarr_lists
else:
self.sync_lists: list[str] = Config.MANUAL_PLAYLISTS.split(",")

def process_for_user(self: "Spotiplex", user: str) -> None:
"""Syncs playlists for a given user."""
Expand Down Expand Up @@ -91,7 +93,10 @@ def process_playlist(self: "Spotiplex", playlist: str) -> None:
spotify_tracks,
)
self.plex_service.create_or_update_playlist(
playlist_name, playlist_id, plex_tracks, cover_url
playlist_name,
playlist_id,
plex_tracks,
cover_url,
)
logger.debug(f"Processed playlist '{playlist_name}'.")
else:
Expand Down

0 comments on commit d5addfa

Please sign in to comment.