Fix Quality Scanner for Navidrome & expand ListenBrainz playlist limit
- Expose suffix, bitRate, and path fields on NavidromeTrack from the Subsonic API response - Add fallback in insert_or_update_media_track() to populate file_path and bitrate for Navidrome tracks, fixing the Quality Scanner returning 0 results - Increase ListenBrainz playlist cache limit from 4 to 25 per type - Add sub-tab grouping in the Recommendations tab (Weekly Jams, Weekly Exploration, Top Discoveries, etc.)
This commit is contained in:
parent
6750c20dc4
commit
a74596cdd6
2 changed files with 13 additions and 0 deletions
|
|
@ -113,6 +113,11 @@ class NavidromeTrack:
|
|||
self.userRating = navidrome_data.get('userRating')
|
||||
self.addedAt = self._parse_date(navidrome_data.get('created'))
|
||||
|
||||
# Subsonic API file/quality fields
|
||||
self.suffix = navidrome_data.get('suffix') # e.g. "flac", "mp3"
|
||||
self.bitRate = navidrome_data.get('bitRate') # e.g. 320
|
||||
self.path = navidrome_data.get('path') # e.g. "/music/Artist/Album/track.flac"
|
||||
|
||||
self._album_id = navidrome_data.get('albumId', '')
|
||||
self._artist_id = navidrome_data.get('artistId', '')
|
||||
|
||||
|
|
|
|||
|
|
@ -1293,6 +1293,14 @@ class MusicDatabase:
|
|||
part = media.parts[0]
|
||||
file_path = getattr(part, 'file', None)
|
||||
bitrate = getattr(media, 'bitrate', None)
|
||||
|
||||
# Fallback for Navidrome/Subsonic tracks
|
||||
if file_path is None and hasattr(track_obj, 'path') and track_obj.path:
|
||||
file_path = track_obj.path
|
||||
if bitrate is None and hasattr(track_obj, 'bitRate') and track_obj.bitRate:
|
||||
bitrate = track_obj.bitRate
|
||||
if file_path is None and hasattr(track_obj, 'suffix') and track_obj.suffix:
|
||||
file_path = f"{track_obj.title}.{track_obj.suffix}"
|
||||
|
||||
# Use INSERT OR REPLACE to handle duplicate IDs gracefully
|
||||
cursor.execute("""
|
||||
|
|
|
|||
Loading…
Reference in a new issue