Include Tidal version field in track names — fixes remixes all resolving to base title
This commit is contained in:
parent
f4d8280642
commit
4390036556
1 changed files with 14 additions and 2 deletions
|
|
@ -209,9 +209,15 @@ class TidalClient:
|
||||||
if not artists:
|
if not artists:
|
||||||
artists = ['Unknown Artist']
|
artists = ['Unknown Artist']
|
||||||
|
|
||||||
|
# Append version info (e.g. "Bloom remix") to title if present
|
||||||
|
track_title = attributes.get('title', 'Unknown Track')
|
||||||
|
track_version = attributes.get('version') or ''
|
||||||
|
if track_version and track_version.lower() not in track_title.lower():
|
||||||
|
track_title = f"{track_title} ({track_version})"
|
||||||
|
|
||||||
return Track(
|
return Track(
|
||||||
id=str(track_id),
|
id=str(track_id),
|
||||||
name=attributes.get('title', 'Unknown Track'),
|
name=track_title,
|
||||||
artists=artists,
|
artists=artists,
|
||||||
duration_ms=attributes.get('duration', 0) * 1000 if attributes.get('duration') else 0, # Convert to ms
|
duration_ms=attributes.get('duration', 0) * 1000 if attributes.get('duration') else 0, # Convert to ms
|
||||||
external_urls={'tidal': f"https://tidal.com/browse/track/{track_id}"},
|
external_urls={'tidal': f"https://tidal.com/browse/track/{track_id}"},
|
||||||
|
|
@ -979,9 +985,15 @@ class TidalClient:
|
||||||
elif 'artist' in item:
|
elif 'artist' in item:
|
||||||
artists = [item['artist'].get('name', 'Unknown')]
|
artists = [item['artist'].get('name', 'Unknown')]
|
||||||
|
|
||||||
|
# Append version info (e.g. "Bloom remix") to title if present
|
||||||
|
track_title = item.get('title', 'Unknown Track')
|
||||||
|
track_version = item.get('version') or ''
|
||||||
|
if track_version and track_version.lower() not in track_title.lower():
|
||||||
|
track_title = f"{track_title} ({track_version})"
|
||||||
|
|
||||||
track = Track(
|
track = Track(
|
||||||
id=str(track_id),
|
id=str(track_id),
|
||||||
name=item.get('title', 'Unknown Track'),
|
name=track_title,
|
||||||
artists=artists,
|
artists=artists,
|
||||||
album=item.get('album', {}).get('title', 'Unknown Album'),
|
album=item.get('album', {}).get('title', 'Unknown Album'),
|
||||||
duration_ms=item.get('duration', 0) * 1000, # Convert seconds to ms
|
duration_ms=item.get('duration', 0) * 1000, # Convert seconds to ms
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue