From 08410fddd1f2c0694787244c95bf29b59b570fc7 Mon Sep 17 00:00:00 2001 From: jtrzupek Date: Sun, 14 Jun 2026 11:17:18 +0200 Subject: [PATCH] fix(mobile): show Refresh thumbnail only when preview missing or broken The Refresh thumbnail button appeared on every scene, which is noise for the majority that already have a good preview (report 26c114ed). Show it only when no source has a usable thumbnail or the only thumbnails are rotting (sxyprn/trafficdeposit), which is exactly when a manual refresh helps (the original d3376a71 case). Co-Authored-By: Claude Fable 5 --- mobile/src/screens/SceneDetailScreen.tsx | 32 ++++++++++++++++-------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/mobile/src/screens/SceneDetailScreen.tsx b/mobile/src/screens/SceneDetailScreen.tsx index 1588765..620b8d8 100644 --- a/mobile/src/screens/SceneDetailScreen.tsx +++ b/mobile/src/screens/SceneDetailScreen.tsx @@ -238,17 +238,27 @@ export function SceneDetailScreen() { - {data.playback_sources.some((s) => s.origin?.startsWith('tube:')) && ( - refreshThumbMutation.mutate()} - disabled={refreshThumbMutation.isPending} - > - - {refreshThumbMutation.isPending ? 'Refreshing thumbnail…' : '↻ Refresh thumbnail'} - - - )} + {/* Refresh tylko gdy BRAK dobrej miniatury (brak w ogóle lub rotting sxyprn/ + trafficdeposit) — feedback 26c114ed: na scenach z dobrą miniaturą przycisk + był zbędnym szumem. Dla zepsutych/stałych nadal się pojawia (cel d3376a71). */} + {(() => { + const hasTube = data.playback_sources.some((s) => s.origin?.startsWith('tube:')); + const hasGoodThumb = data.playback_sources.some( + (s) => s.thumbnail_url && !/trafficdeposit|sxyprn|\/proxy\/sxyprn-thumb/i.test(s.thumbnail_url), + ); + if (!hasTube || hasGoodThumb) return null; + return ( + refreshThumbMutation.mutate()} + disabled={refreshThumbMutation.isPending} + > + + {refreshThumbMutation.isPending ? 'Refreshing thumbnail…' : '↻ Refresh thumbnail'} + + + ); + })()} {(data.code || data.director) && (