feat(url-play): YouTube/Instagram entfernt nur MP3-Links; UI: Checkbox entfernt, Button heißt jetzt 'Download'
This commit is contained in:
parent
d4b839f888
commit
c2bd7b4503
3 changed files with 11 additions and 116 deletions
|
|
@ -23,7 +23,6 @@ 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 () => {
|
||||
|
|
@ -186,23 +185,19 @@ 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, mediaDownload); }
|
||||
try { await playUrl(mediaUrl, guildId, channelId, volume); }
|
||||
catch (err: any) { setError(err?.message || 'Play-URL fehlgeschlagen'); }
|
||||
}
|
||||
}}
|
||||
placeholder="YouTube/Instagram/MP3 URL..."
|
||||
placeholder="MP3 URL..."
|
||||
/>
|
||||
<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, mediaDownload); }
|
||||
try { await playUrl(mediaUrl, guildId, channelId, volume); }
|
||||
catch (e: any) { setError(e?.message || 'Play-URL fehlgeschlagen'); }
|
||||
}}>▶ Abspielen</button>
|
||||
}}>⬇ Download</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 && (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue