Skip to content

Commit 82e303f

Browse files
committed
bug fixes
1 parent ec9f392 commit 82e303f

5 files changed

Lines changed: 16 additions & 44 deletions

File tree

.github/changelog.md

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,5 @@
1-
# What's New?
1+
# Bug fixes
22

3-
<!-- TODO: ELABORATE -->
4-
5-
- Auth
6-
- New artists/albums Sort by: last played, no. of streams, total stream duration
7-
- Option to show now playing track info on tab title. Go to Settings > Appearance to enable
8-
- You can select which disc to play in an album
9-
- Internal Backup and restore
10-
11-
## Improvements
12-
13-
- The context menu now doesn't take forever to open up
14-
- Merged "Save as Playlist" with "Add to Playlist" > "New Playlist"
15-
16-
## Bug fixes
17-
18-
- Add to queue adding to last index -1
19-
20-
## Development
21-
22-
- Rewritten the whole DB layer to move stores from memory to the database.
23-
24-
## THE BIG ONE API CHANGES
25-
26-
- genre is no longer a string, but a struct:
27-
28-
```ts
29-
interface Genre {
30-
name: str;
31-
genrehash: str;
32-
}
33-
```
34-
35-
- Pairing via QR Code has been split into 2 endpoint:
36-
37-
1. `/getpaircode`
38-
2. `/pair`
39-
40-
-
3+
- Embedded thumbnails are now used when found in tracks
4+
- Handle `AttributeError` on indexing tracks
5+
- Add print on error in favorites

app/api/favorites.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ def toggle_favorite(body: FavoritesAddBody):
7878
FavoritesTable.insert_item(
7979
{"hash": body.hash, "type": body.type, "extra": extra}
8080
)
81-
except:
81+
except Exception as e:
82+
print(e)
8283
return {"msg": "Failed! An error occured"}, 500
8384

8485
toggle_fav(body.type, body.hash)
@@ -93,7 +94,8 @@ def remove_favorite(body: FavoritesAddBody):
9394
"""
9495
try:
9596
FavoritesTable.remove_item({"hash": body.hash, "type": body.type})
96-
except:
97+
except Exception as e:
98+
print(e)
9799
return {"msg": "Failed! An error occured"}, 500
98100

99101
toggle_fav(body.type, body.hash)

app/lib/populate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def get_image(_map: tuple[str, Album]):
8686
matching_tracks = AlbumStore.get_album_tracks(album.albumhash)
8787

8888
for track in matching_tracks:
89-
if extract_thumb(track.filepath, track.image):
89+
if extract_thumb(track.filepath, track.albumhash + ".webp"):
9090
break
9191

9292

app/lib/tagger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def extract_thumb_with_overwrite(tracks: list[dict[str, str]]):
6969
for track in tracks:
7070
try:
7171
extract_thumb(
72-
track["filepath"], track["trackhash"] + ".webp", overwrite=True
72+
track["filepath"], track["albumhash"] + ".webp", overwrite=True
7373
)
7474
except FileNotFoundError:
7575
continue

app/lib/taglib.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ def get_tags(filepath: str, config: UserConfig):
159159
except Exception as e: # noqa: E722
160160
return None
161161

162+
try:
163+
other = tags.other
164+
except AttributeError:
165+
other = {}
166+
162167
metadata: dict[str, Any] = {
163168
"album": tags.album,
164169
"albumartists": tags.albumartist,
@@ -172,7 +177,7 @@ def get_tags(filepath: str, config: UserConfig):
172177
"track": tags.track,
173178
"disc": tags.disc,
174179
"genres": tags.genre,
175-
"copyright": " ".join(tags.other.get("copyright", [])),
180+
"copyright": " ".join(other.get("copyright", [])),
176181
"extra": {},
177182
}
178183

0 commit comments

Comments
 (0)