From ad8f74a5964874586b36393750e569e14f6878e3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Jun 2026 23:43:53 +0000 Subject: [PATCH 1/2] Fix poster bugs: rematch doesn't update poster, TVDB poster cache key collision, movie poster lookup uses wrong path --- src/app/edititem.tsx | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/src/app/edititem.tsx b/src/app/edititem.tsx index 011472e..cf6d772 100644 --- a/src/app/edititem.tsx +++ b/src/app/edititem.tsx @@ -88,7 +88,12 @@ async function downloadPoster(cacheKey: string, posterPath: string): Promise { ensurePostersTvdbDir(); - const safeName = tvdbId.replace(/[^a-zA-Z0-9_-]/g, '_'); + // Include a URL-derived suffix so that different poster selections for the same + // TVDB ID are cached as separate files instead of colliding on the same key. + const urlKey = (fullUrl.split('/').pop() ?? 'poster') + .replace(/\.[^.]+$/, '') + .replace(/[^a-zA-Z0-9_-]/g, '_'); + const safeName = `${tvdbId.replace(/[^a-zA-Z0-9_-]/g, '_')}_${urlKey}`; const localFile = new File(POSTERS_TVDB_DIR, `${safeName}.jpg`); if (localFile.exists) { return localFile.uri; @@ -146,7 +151,7 @@ export default function EditItemScreen() { return mediaLibrary[showName]?.poster ?? ''; } else if (itemType === 'movie') { const path = itemKey.replace(/^movie:/, ''); - return movies.find((m) => m.path === path)?.poster ?? ''; + return movies.find((m) => m.parsedPath === path)?.poster ?? ''; } return ''; })(); @@ -503,8 +508,8 @@ export default function EditItemScreen() { }; /** - * Apply a TMDB match — updates the metadata ID and re-enriches episodes (for - * shows). Does NOT change the poster. + * Apply a TMDB match — updates the metadata ID, downloads the poster, and + * re-enriches episodes (for shows). */ const handleApplyTmdbRematch = async (result: TmdbResult) => { setRematchApplying(true); @@ -526,6 +531,17 @@ export default function EditItemScreen() { } } + // Download and apply the poster from the matched result. + if (result.poster_path) { + try { + const cacheKey = result.poster_path.replace(/^\//, '').replace(/\.[^.]+$/, ''); + const localPosterUri = await downloadPoster(cacheKey, result.poster_path); + applyPoster(localPosterUri); + } catch (e) { + logger.warn('EditItem', 'Failed to download poster during TMDB rematch', e); + } + } + setRematchApplied(result.id); logger.log('EditItem', `TMDB rematch applied: ID ${tmdbId}, year=${year}`); @@ -551,8 +567,8 @@ export default function EditItemScreen() { }; /** - * Apply a TVDB match — updates the metadata ID and re-enriches episodes (for - * shows). Does NOT change the poster. + * Apply a TVDB match — updates the metadata ID, downloads the poster, and + * re-enriches episodes (for shows). */ const handleApplyTvdbRematch = async (result: ProviderShowResult) => { setRematchApplying(true); @@ -575,6 +591,16 @@ export default function EditItemScreen() { override: { tvdbId, year, metadataSourceOverride: 'tvdb' }, })); + // Download and apply the poster from the matched result. + if (result.posterUrl) { + try { + const localPosterUri = await downloadTvdbPoster(tvdbId, result.posterUrl); + applyPoster(localPosterUri); + } catch (e) { + logger.warn('EditItem', 'Failed to download poster during TVDB rematch', e); + } + } + setTvdbRematchApplied(result.id); logger.log('EditItem', `TVDB rematch applied: ID ${tvdbId}, year=${year}`); From 19144c6e97fe2b9fe88825557786cc2f5555c053 Mon Sep 17 00:00:00 2001 From: Kallum Burgin <1054734+Kallb123@users.noreply.github.com> Date: Tue, 2 Jun 2026 06:56:55 +0100 Subject: [PATCH 2/2] Bump version to 1.12.1 and update versionCode --- app.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.json b/app.json index 8fad237..2c8f772 100644 --- a/app.json +++ b/app.json @@ -3,7 +3,7 @@ "name": "SimpleMediaBrowser", "owner": "kallb123", "slug": "SimpleMediaBrowser", - "version": "1.12.0", + "version": "1.12.1", "orientation": "default", "icon": "./assets/images/icon.png", "scheme": "simplemediabrowser", @@ -20,7 +20,7 @@ }, "predictiveBackGestureEnabled": false, "package": "net.nawt.simplemediabrowser", - "versionCode": 47 + "versionCode": 48 }, "web": { "output": "static",