diff options
| author | Adam Malczewski <[email protected]> | 2026-07-01 22:16:09 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-07-01 22:16:52 +0900 |
| commit | b476f7703c594e9c8ff1b1ecc77f8e2493ef04b4 (patch) | |
| tree | 22971336f0a7a1ec68f7b9b4f24c80d159ea1118 /yt-music-dl-web/src/features/library/logic.ts | |
| parent | 6402a83fe83a0b1a9f5959ff7f45d07d3e309c6e (diff) | |
| download | yt-walkerman-main.tar.gz yt-walkerman-main.zip | |
Diffstat (limited to 'yt-music-dl-web/src/features/library/logic.ts')
| -rw-r--r-- | yt-music-dl-web/src/features/library/logic.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/yt-music-dl-web/src/features/library/logic.ts b/yt-music-dl-web/src/features/library/logic.ts index fc29b37..4d3676c 100644 --- a/yt-music-dl-web/src/features/library/logic.ts +++ b/yt-music-dl-web/src/features/library/logic.ts @@ -234,9 +234,11 @@ export function trackSidebarItems(track: Track, results: MetadataResult[]): Side * Build a PATCH /api/library/:id body (UpdateTrackRequest) from a clicked * sidebar item. The "Current tags" entry (source: "youtube") produces an empty * body (no-op); an MB result sets title + artist always, album + track only - * when the result actually carries them. Mirrors fillActions from metadata.ts - * but produces an UpdateTrackRequest (a PATCH body) instead of EditAction[] - * (in-memory draft edits). Pure: (item) → request. + * when the result actually carries them. When the result has a Cover Art + * Archive `artUrl`, it is included so the backend downloads + embeds the + * front cover. Mirrors fillActions from metadata.ts but produces an + * UpdateTrackRequest (a PATCH body) instead of EditAction[] (in-memory draft + * edits). Pure: (item) → request. */ export function toUpdateRequestFromItem(item: SidebarItem): UpdateTrackRequest { if (item.source === "youtube") return {}; // no-op — current tags @@ -246,6 +248,7 @@ export function toUpdateRequestFromItem(item: SidebarItem): UpdateTrackRequest { }; if (item.album !== undefined) req.album = item.album; if (item.trackNumber !== undefined) req.track = item.trackNumber; + if (item.artUrl !== undefined) req.artUrl = item.artUrl; return req; } |
