Commit deae57e
fix(artwork): let the overview row borrow the detail page's cover
A job added from the share extension opens on `amdl://download/<id>`, which
pushes the detail page straight onto the navigation stack — the overview
list never appears, so nothing ever requested its 256px cover. Backing out
of the detail page therefore landed on a row holding the type placeholder
until that fetch finished, even though the full-size cover was already
decoded and in the cache.
The two pages cache under different keys because they request different
sizes, and `fallbackCacheKey` only ever resolved one way: detail borrowing
the overview's small image. It is now symmetric — whichever size is missing
borrows the other. The row shows the hero image on its first frame (the
memory-cache lookup in `CachedAsyncImage.init` is synchronous), then swaps
in the 256 without a fade, because the fade keys on nil-to-non-nil and the
slot was never empty.
Nothing new is downloaded: this reuses an image already in the cache rather
than prefetching a second one ahead of time.
`fallbackCacheKey` moved onto `JobArtworkLoader` so the direction it picks
is testable, and the literal 256 became `overviewPixelSize` — it is part of
a cache key, not just a request size.
Private playlists are unaffected: both sizes share one unsized key, the two
lookups return the same string, and the fallback stays nil rather than
having a view borrow from itself.
Signed-off-by: LYJW131 <lyjw2007@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: LYJW131 <lyjw2007@gmail.com>1 parent 97b4d0b commit deae57e
2 files changed
Lines changed: 71 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
| |||
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
32 | 54 | | |
33 | 55 | | |
34 | 56 | | |
| |||
49 | 71 | | |
50 | 72 | | |
51 | 73 | | |
52 | | - | |
| 74 | + | |
53 | 75 | | |
54 | 76 | | |
55 | 77 | | |
| |||
70 | 92 | | |
71 | 93 | | |
72 | 94 | | |
73 | | - | |
74 | | - | |
75 | 95 | | |
76 | | - | |
77 | | - | |
| 96 | + | |
78 | 97 | | |
79 | 98 | | |
80 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
78 | 125 | | |
79 | 126 | | |
80 | 127 | | |
| |||
0 commit comments