remove the try catch

This commit is contained in:
Timothy Z. 2026-03-30 18:47:20 +03:00
parent fcd85bdcf4
commit e0961ec686

View file

@ -30,24 +30,20 @@ const usePlayUrl = () => {
return false;
}
try {
const parsed = magnet.decode(trimmed);
if (parsed && typeof parsed.infoHash === 'string') {
const serverReady = streamingServer.settings !== null
&& streamingServer.settings.type === 'Ready';
if (!serverReady) {
toast.show({
type: 'error',
title: 'Streaming server is not available. Cannot play magnet links.',
timeout: 5000
});
return false;
}
createTorrentFromMagnet(trimmed);
return true;
const parsed = magnet.decode(trimmed);
if (parsed && typeof parsed.infoHash === 'string') {
const serverReady = streamingServer.settings !== null
&& streamingServer.settings.type === 'Ready';
if (!serverReady) {
toast.show({
type: 'error',
title: 'Streaming server is not available. Cannot play magnet links.',
timeout: 5000
});
return false;
}
} catch (e) {
// Not a valid magnet
createTorrentFromMagnet(trimmed);
return true;
}
return false;