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 <noreply@anthropic.com>
This commit is contained in:
jtrzupek 2026-06-14 11:17:18 +02:00
parent 29da1fbaa6
commit 08410fddd1

View file

@ -238,7 +238,16 @@ export function SceneDetailScreen() {
<Hero data={data} /> <Hero data={data} />
<View style={styles.body}> <View style={styles.body}>
{data.playback_sources.some((s) => s.origin?.startsWith('tube:')) && ( {/* 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 (
<Pressable <Pressable
style={styles.refreshThumbBtn} style={styles.refreshThumbBtn}
onPress={() => refreshThumbMutation.mutate()} onPress={() => refreshThumbMutation.mutate()}
@ -248,7 +257,8 @@ export function SceneDetailScreen() {
{refreshThumbMutation.isPending ? 'Refreshing thumbnail…' : '↻ Refresh thumbnail'} {refreshThumbMutation.isPending ? 'Refreshing thumbnail…' : '↻ Refresh thumbnail'}
</Text> </Text>
</Pressable> </Pressable>
)} );
})()}
{(data.code || data.director) && ( {(data.code || data.director) && (
<View style={styles.metaRow}> <View style={styles.metaRow}>