fix(web): show download chip on movie detail (#267)

This commit is contained in:
Miguel Palhas
2026-08-26 13:05:30 +01:00
parent 120416aabe
commit 640bda3128
+15
View File
@@ -405,6 +405,7 @@ function main() {
repaintDownloads = () => {
library.repaintDownloads();
seriesDetail.repaintDownloads();
movieDetail.repaintDownloads();
};
refreshQueuesBadge = () => {
void queues.refreshBadge();
@@ -2294,6 +2295,8 @@ interface MovieView {
* surface underneath repaints instead of listing something that is gone.
*/
setRemoved: (handler: (parent: Route) => void) => void;
/** §9.8: repaint only while the page is open (issue #267). */
repaintDownloads: () => void;
}
/** The eligible bucket always shows; waived and rejected collapse to counts. */
@@ -2566,6 +2569,17 @@ function movieMain(views: HideableView[]): MovieView {
if (movie.blocked) {
chipsEl.append(chip(NO_TARGETED_SEARCH));
}
// §9.8: the hero is the row that owns the item, same as the library row
const download = downloadChip("movie", movie.id);
if (download !== null) {
chipsEl.append(download);
}
}
function repaintDownloads() {
if (!view.hidden) {
paintIdentity();
}
}
function paintRootOptions() {
@@ -3143,6 +3157,7 @@ function movieMain(views: HideableView[]): MovieView {
setRemoved: (handler: (parent: Route) => void) => {
removed = handler;
},
repaintDownloads,
};
}