diff --git a/.github/changelog.md b/.github/changelog.md index 09a6b020..a8bc00d7 100644 --- a/.github/changelog.md +++ b/.github/changelog.md @@ -1,40 +1,5 @@ -# What's New? +# Bug fixes - - -- Auth -- New artists/albums Sort by: last played, no. of streams, total stream duration -- Option to show now playing track info on tab title. Go to Settings > Appearance to enable -- You can select which disc to play in an album -- Internal Backup and restore - -## Improvements - -- The context menu now doesn't take forever to open up -- Merged "Save as Playlist" with "Add to Playlist" > "New Playlist" - -## Bug fixes - -- Add to queue adding to last index -1 - -## Development - -- Rewritten the whole DB layer to move stores from memory to the database. - -## THE BIG ONE API CHANGES - -- genre is no longer a string, but a struct: - -```ts -interface Genre { - name: str; - genrehash: str; -} -``` - -- Pairing via QR Code has been split into 2 endpoint: - - 1. `/getpaircode` - 2. `/pair` - -- +- Embedded thumbnails are now used when found in tracks +- Handle `AttributeError` on indexing tracks +- Add print on error in favorites diff --git a/app/api/favorites.py b/app/api/favorites.py index 52ea01ac..68dd2e28 100644 --- a/app/api/favorites.py +++ b/app/api/favorites.py @@ -78,7 +78,8 @@ def toggle_favorite(body: FavoritesAddBody): FavoritesTable.insert_item( {"hash": body.hash, "type": body.type, "extra": extra} ) - except: + except Exception as e: + print(e) return {"msg": "Failed! An error occured"}, 500 toggle_fav(body.type, body.hash) @@ -93,7 +94,8 @@ def remove_favorite(body: FavoritesAddBody): """ try: FavoritesTable.remove_item({"hash": body.hash, "type": body.type}) - except: + except Exception as e: + print(e) return {"msg": "Failed! An error occured"}, 500 toggle_fav(body.type, body.hash) diff --git a/app/lib/populate.py b/app/lib/populate.py index 703b9a76..de7201d8 100644 --- a/app/lib/populate.py +++ b/app/lib/populate.py @@ -86,7 +86,7 @@ def get_image(_map: tuple[str, Album]): matching_tracks = AlbumStore.get_album_tracks(album.albumhash) for track in matching_tracks: - if extract_thumb(track.filepath, track.image): + if extract_thumb(track.filepath, track.albumhash + ".webp"): break diff --git a/app/lib/tagger.py b/app/lib/tagger.py index 7358cb92..69356391 100644 --- a/app/lib/tagger.py +++ b/app/lib/tagger.py @@ -69,7 +69,7 @@ def extract_thumb_with_overwrite(tracks: list[dict[str, str]]): for track in tracks: try: extract_thumb( - track["filepath"], track["trackhash"] + ".webp", overwrite=True + track["filepath"], track["albumhash"] + ".webp", overwrite=True ) except FileNotFoundError: continue diff --git a/app/lib/taglib.py b/app/lib/taglib.py index 028b9c27..58d2c535 100644 --- a/app/lib/taglib.py +++ b/app/lib/taglib.py @@ -159,6 +159,11 @@ def get_tags(filepath: str, config: UserConfig): except Exception as e: # noqa: E722 return None + try: + other = tags.other + except AttributeError: + other = {} + metadata: dict[str, Any] = { "album": tags.album, "albumartists": tags.albumartist, @@ -172,7 +177,7 @@ def get_tags(filepath: str, config: UserConfig): "track": tags.track, "disc": tags.disc, "genres": tags.genre, - "copyright": " ".join(tags.other.get("copyright", [])), + "copyright": " ".join(other.get("copyright", [])), "extra": {}, }