Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cwilvx committed Jan 10, 2025
1 parent ec9f392 commit 82e303f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 44 deletions.
43 changes: 4 additions & 39 deletions .github/changelog.md
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions app/api/favorites.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion app/lib/populate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion app/lib/tagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion app/lib/taglib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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": {},
}

Expand Down

0 comments on commit 82e303f

Please sign in to comment.