feat(media): Download-Option für URL-Player; yt-dlp/ffmpeg Args für YouTube stabilisiert; UI: Checkbox 'Download speichern' + Dropdown layering fix

This commit is contained in:
vibe-bot 2025-08-08 17:04:38 +02:00
parent e401124001
commit f9e9dc8d0b
4 changed files with 52 additions and 11 deletions

View file

@ -22,6 +22,7 @@ export default function App() {
const selectedCount = useMemo(() => Object.values(selectedSet).filter(Boolean).length, [selectedSet]);
const [clock, setClock] = useState<string>(() => new Intl.DateTimeFormat('de-DE', { hour: '2-digit', minute: '2-digit', hour12: false, timeZone: 'Europe/Berlin' }).format(new Date()));
const [mediaUrl, setMediaUrl] = useState<string>('');
const [mediaDownload, setMediaDownload] = useState<boolean>(false);
useEffect(() => {
(async () => {
@ -184,7 +185,7 @@ export default function App() {
if (e.key === 'Enter') {
if (!selected) { setError('Bitte Voice-Channel wählen'); return; }
const [guildId, channelId] = selected.split(':');
try { await playUrl(mediaUrl, guildId, channelId, volume); }
try { await playUrl(mediaUrl, guildId, channelId, volume, mediaDownload); }
catch (err: any) { setError(err?.message || 'Play-URL fehlgeschlagen'); }
}
}}
@ -193,10 +194,14 @@ export default function App() {
<button type="button" className="tab" onClick={async () => {
if (!selected) { setError('Bitte Voice-Channel wählen'); return; }
const [guildId, channelId] = selected.split(':');
try { await playUrl(mediaUrl, guildId, channelId, volume); }
try { await playUrl(mediaUrl, guildId, channelId, volume, mediaDownload); }
catch (e: any) { setError(e?.message || 'Play-URL fehlgeschlagen'); }
}}> Abspielen</button>
</div>
<label style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
<input type="checkbox" checked={mediaDownload} onChange={(e) => setMediaDownload(e.target.checked)} />
Download speichern
</label>
</section>
{!isAdmin && (