Skip to content

Commit ee883a5

Browse files
authored
Merge pull request #146 from marceljungle/main
Sync develop with main
2 parents d452860 + 002e280 commit ee883a5

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

red_plex/infrastructure/plex/plex_manager.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ def query_for_albums(self, album_name: str, artists: List[str]) -> List[Album]:
9090
filters = {"album.title": album_names, "artist.title": artist_names}
9191
try:
9292
albums = self.library_section.search(libtype='album', filters=filters)
93+
if not albums and len(artists) > 1:
94+
# Try searching with various artists (bad-tagged albums)
95+
albums = self.library_section.search(libtype='album',
96+
filters={"album.title": album_names,
97+
"artist.title": 'Various Artists'})
9398
domain_albums = [PlexMapper.map_plex_album_to_domain(album) for album in albums]
9499
# No matches found
95100
if not domain_albums:
@@ -326,7 +331,7 @@ def _get_album_transformations(album_name: str) -> List[str]:
326331
def _get_artist_transformations(artists: List[str]) -> List[str]:
327332
"""
328333
Returns a list of artist name transformations for use in Plex queries.
329-
Includes "Various Artists", comma/ampersand splitting, and removal
334+
Includes comma/ampersand splitting, and removal
330335
of any content within parentheses.
331336
"""
332337
transformations: List[str] = []
@@ -358,12 +363,6 @@ def add_artist_with_transforms(name_to_add: str):
358363
transformations.append(paren_removed_name)
359364
seen_lower.add(lower_paren_removed)
360365

361-
# Handle "Various Artists" if more than one artist
362-
if len(artists) > 1:
363-
if 'various artists' not in seen_lower:
364-
transformations.append('Various Artists')
365-
seen_lower.add('various artists')
366-
367366
# Process each artist from the input list
368367
for artist_name in artists:
369368
cleaned_name = artist_name.strip()

0 commit comments

Comments
 (0)