bug fixes

This commit is contained in:
cwilvx
2025-01-10 14:33:34 +03:00
parent ec9f392d73
commit 82e303f2df
5 changed files with 16 additions and 44 deletions
+4 -39
View File
@@ -1,40 +1,5 @@
# What's New?
# Bug fixes
<!-- TODO: ELABORATE -->
- 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
+4 -2
View File
@@ -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)
+1 -1
View File
@@ -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
+1 -1
View File
@@ -69,7 +69,7 @@ class IndexTracks:
for track in tracks:
try:
extract_thumb(
track["filepath"], track["trackhash"] + ".webp", overwrite=True
track["filepath"], track["albumhash"] + ".webp", overwrite=True
)
except FileNotFoundError:
continue
+6 -1
View File
@@ -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": {},
}