Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion backend/beets_flask/server/routes/library/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,13 @@ def _rep_Album(

out: dict[str, Any] = dict()

out["path"] = beets_util.displayable_path(album.path)
try:
out["path"] = beets_util.displayable_path(album.path)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to think about if we want to include the path anyways. As this always triggers a item lookup i.e. db join and is quite inefficient.

At least for minimal returns there is an argument in omitting the path.

except:
# this should rarely happen, it is a workaround for my (maybe corrupt?)
# beets library, where some albums have no items, and then the albums.path getter
# cannot resolve.
out["path"] = None

if minimal:
keys = ["id", "name", "albumartist", "year", "added"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { useSuspenseQuery } from "@tanstack/react-query";
import { createFileRoute, Outlet } from "@tanstack/react-router";

import { albumQueryOptions, artQueryOptions } from "@/api/library";

Check warning on line 6 in frontend/src/routes/library/(resources)/album.$albumId.route.tsx

View workflow job for this annotation

GitHub Actions / Javascript checks (21)

'artQueryOptions' is defined but never used. Allowed unused vars must match /^_/u
import { BackIconButton } from "@/components/common/inputs/back";
import { Loading } from "@/components/common/loading";
import { NavigationTabs } from "@/components/common/navigation";
Expand All @@ -28,10 +28,9 @@
)
);

const p2 = queryClient.ensureQueryData(
artQueryOptions({ type: "album", id: params.albumId })
);
await Promise.all([p1, p2]);
// don't wait for cover-art here. we want to show main content fast
// and handle errors for artwork with ui placeholder.
await Promise.all([p1]);
},
pendingComponent: PendingComponent,
component: RouteComponent,
Expand Down
Loading