Skip to content

Commit bc5094d

Browse files
authored
Merge pull request #150 from marceljungle/main
Sync develop with main
2 parents 2338985 + e6e7e3b commit bc5094d

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

red_plex/infrastructure/rest/gazelle/mapper/gazelle_mapper.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,17 @@ def map_torrent_group(data: Dict[str, Any], torrents: List[Dict] = None) -> Torr
3939
"""Map individual torrent group data"""
4040
torrents = torrents or []
4141
return TorrentGroup(
42-
id=data.get('id'),
42+
id=data.get('id', {}) or data.get('group', {}).get('id'),
4343
artists=[
4444
GazelleMapper._clean_text(artist.get('name', ''))
45-
for artist in (data.get('musicInfo') or {}).get('artists') or []
45+
for artist in (data.get('musicInfo')
46+
or data.get('group', {}).get('musicInfo', {})
47+
or {}).get('artists')
48+
or []
4649
],
4750
file_paths=GazelleMapper._map_torrent_group_file_paths(torrents),
48-
album_name=GazelleMapper._clean_text(data.get('name', ''))
51+
album_name=GazelleMapper._clean_text(data.get('name', '')
52+
or data.get('group', {}).get('name', ''))
4953
)
5054

5155
@staticmethod

0 commit comments

Comments
 (0)