feat: Sub-Tabs Top10/Neuerscheinungen mit Sprachgewichtung, debug-network entfernt (Endpoint existiert nicht bei TMDb)
This commit is contained in:
@@ -455,6 +455,7 @@ function StreamingGrid({ onOpenModal, xrelIds, onXrelLoaded, favIds: favIdsProp,
|
||||
|
||||
const [providers, setProviders] = useState([]);
|
||||
const [activeProvider, setActiveProvider] = useState(null);
|
||||
const [subTab, setSubTab] = useState('top10'); // 'top10' | 'new'
|
||||
const [data, setData] = useState(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState('');
|
||||
@@ -468,18 +469,47 @@ function StreamingGrid({ onOpenModal, xrelIds, onXrelLoaded, favIds: favIdsProp,
|
||||
useEffect(() => {
|
||||
if (!activeProvider) return;
|
||||
setLoading(true); setError('');
|
||||
api(`/tools/media/streaming/${activeProvider}`)
|
||||
const path = subTab === 'new'
|
||||
? `/tools/media/streaming/${activeProvider}/new`
|
||||
: `/tools/media/streaming/${activeProvider}`;
|
||||
api(path)
|
||||
.then(setData)
|
||||
.catch(e => setError(e.message))
|
||||
.finally(() => setLoading(false));
|
||||
}, [activeProvider]);
|
||||
}, [activeProvider, subTab]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div style={{color:'rgba(255,255,255,0.35)',fontFamily:'monospace',fontSize:11,marginBottom:12,lineHeight:1.6}}>
|
||||
Top 10 Filme & Serien pro Anbieter (DE) · nur Titel ab {new Date().getFullYear()-1} · sortiert nach Popularität (Näherung, keine offiziellen Anbieter-Daten)<br/>
|
||||
Deutsch & Englisch unbegrenzt · alle anderen Sprachen zusammen max. 2 Plätze in den Top 10
|
||||
{/* Sub-Tabs: Top 10 / Neuerscheinungen */}
|
||||
<div style={{display:'flex',gap:8,marginBottom:14}}>
|
||||
<button onClick={() => setSubTab('top10')} style={{
|
||||
background: subTab==='top10' ? 'rgba(78,205,196,0.15)' : 'rgba(255,255,255,0.04)',
|
||||
border: `1px solid ${subTab==='top10' ? 'rgba(78,205,196,0.5)' : 'rgba(255,255,255,0.1)'}`,
|
||||
borderRadius:8, padding:'6px 14px',
|
||||
color: subTab==='top10' ? '#4ecdc4' : 'rgba(255,255,255,0.6)',
|
||||
fontFamily:'monospace', fontSize:12, cursor:'pointer', fontWeight: subTab==='top10'?700:400,
|
||||
}}>⭐ Top 10</button>
|
||||
<button onClick={() => setSubTab('new')} style={{
|
||||
background: subTab==='new' ? 'rgba(78,205,196,0.15)' : 'rgba(255,255,255,0.04)',
|
||||
border: `1px solid ${subTab==='new' ? 'rgba(78,205,196,0.5)' : 'rgba(255,255,255,0.1)'}`,
|
||||
borderRadius:8, padding:'6px 14px',
|
||||
color: subTab==='new' ? '#4ecdc4' : 'rgba(255,255,255,0.6)',
|
||||
fontFamily:'monospace', fontSize:12, cursor:'pointer', fontWeight: subTab==='new'?700:400,
|
||||
}}>🆕 Neuerscheinungen</button>
|
||||
</div>
|
||||
|
||||
{subTab === 'top10' ? (
|
||||
<div style={{color:'rgba(255,255,255,0.35)',fontFamily:'monospace',fontSize:11,marginBottom:12,lineHeight:1.6}}>
|
||||
Top 10 Filme & Serien pro Anbieter (DE) · nur Titel ab {new Date().getFullYear()-1} · sortiert nach Popularität (Näherung, keine offiziellen Anbieter-Daten)<br/>
|
||||
Deutsch & Englisch unbegrenzt · alle anderen Sprachen zusammen max. 2 Plätze in den Top 10
|
||||
</div>
|
||||
) : (
|
||||
<div style={{color:'rgba(255,255,255,0.35)',fontFamily:'monospace',fontSize:11,marginBottom:12,lineHeight:1.6}}>
|
||||
Was in den letzten 60 Tagen neu beim Anbieter erschienen ist (DE), sortiert nach Beliebtheit<br/>
|
||||
Deutsch & Englisch unbegrenzt · alle anderen Sprachen zusammen max. 2 Plätze
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Anbieter-Auswahl */}
|
||||
<div style={{display:'flex',gap:6,flexWrap:'wrap',marginBottom:16}}>
|
||||
{providers.map(p => (
|
||||
@@ -494,7 +524,7 @@ function StreamingGrid({ onOpenModal, xrelIds, onXrelLoaded, favIds: favIdsProp,
|
||||
</div>
|
||||
|
||||
{error && <ErrorBox msg={error} />}
|
||||
{loading && <StatusBox>⏳ Lädt Top 10…</StatusBox>}
|
||||
{loading && <StatusBox>⏳ Lädt…</StatusBox>}
|
||||
|
||||
{!loading && data && (
|
||||
<SectionedGrid
|
||||
|
||||
Reference in New Issue
Block a user