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:
parent
29da1fbaa6
commit
08410fddd1
1 changed files with 21 additions and 11 deletions
|
|
@ -238,17 +238,27 @@ export function SceneDetailScreen() {
|
|||
<Hero data={data} />
|
||||
|
||||
<View style={styles.body}>
|
||||
{data.playback_sources.some((s) => s.origin?.startsWith('tube:')) && (
|
||||
<Pressable
|
||||
style={styles.refreshThumbBtn}
|
||||
onPress={() => refreshThumbMutation.mutate()}
|
||||
disabled={refreshThumbMutation.isPending}
|
||||
>
|
||||
<Text style={styles.refreshThumbText}>
|
||||
{refreshThumbMutation.isPending ? 'Refreshing thumbnail…' : '↻ Refresh thumbnail'}
|
||||
</Text>
|
||||
</Pressable>
|
||||
)}
|
||||
{/* 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
|
||||
style={styles.refreshThumbBtn}
|
||||
onPress={() => refreshThumbMutation.mutate()}
|
||||
disabled={refreshThumbMutation.isPending}
|
||||
>
|
||||
<Text style={styles.refreshThumbText}>
|
||||
{refreshThumbMutation.isPending ? 'Refreshing thumbnail…' : '↻ Refresh thumbnail'}
|
||||
</Text>
|
||||
</Pressable>
|
||||
);
|
||||
})()}
|
||||
|
||||
{(data.code || data.director) && (
|
||||
<View style={styles.metaRow}>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue