diff --git a/frontend/src/api/actions/createCustomPlaylist.ts b/frontend/src/api/actions/createCustomPlaylist.ts index 722203c0..d67a6169 100644 --- a/frontend/src/api/actions/createCustomPlaylist.ts +++ b/frontend/src/api/actions/createCustomPlaylist.ts @@ -3,7 +3,7 @@ import APIClient from '../../functions/APIClient'; const createCustomPlaylist = async (playlistId: string) => { return APIClient('/api/playlist/custom/', { method: 'POST', - body: { playlist_name: playlistId }, + body: { playlist_name: playlistId.trim() }, }); }; diff --git a/frontend/src/api/actions/updateBulkChannelSubscriptions.ts b/frontend/src/api/actions/updateBulkChannelSubscriptions.ts index a49f9599..680281f1 100644 --- a/frontend/src/api/actions/updateBulkChannelSubscriptions.ts +++ b/frontend/src/api/actions/updateBulkChannelSubscriptions.ts @@ -8,7 +8,9 @@ const updateBulkChannelSubscriptions = async (channelIds: string, status: boolea const youtubeChannelIds = channelIds.split('\n'); youtubeChannelIds.forEach(channelId => { - channels.push({ channel_id: channelId, channel_subscribed: status }); + if (channelId.trim()) { + channels.push({ channel_id: channelId, channel_subscribed: status }); + } }); } else { channels.push({ channel_id: channelIds, channel_subscribed: status }); diff --git a/frontend/src/api/actions/updateBulkPlaylistSubscriptions.ts b/frontend/src/api/actions/updateBulkPlaylistSubscriptions.ts index d189496f..94e6067c 100644 --- a/frontend/src/api/actions/updateBulkPlaylistSubscriptions.ts +++ b/frontend/src/api/actions/updateBulkPlaylistSubscriptions.ts @@ -8,7 +8,9 @@ const updateBulkPlaylistSubscriptions = async (playlistIds: string, status: bool const youtubePlaylistIds = playlistIds.split('\n'); youtubePlaylistIds.forEach(playlistId => { - playlists.push({ playlist_id: playlistId, playlist_subscribed: status }); + if (playlistId.trim()) { + playlists.push({ playlist_id: playlistId, playlist_subscribed: status }); + } }); } else { playlists.push({ playlist_id: playlistIds, playlist_subscribed: status }); diff --git a/frontend/src/api/actions/updateDownloadQueue.ts b/frontend/src/api/actions/updateDownloadQueue.ts index a96e71cb..071707df 100644 --- a/frontend/src/api/actions/updateDownloadQueue.ts +++ b/frontend/src/api/actions/updateDownloadQueue.ts @@ -8,7 +8,9 @@ const updateDownloadQueue = async (youtubeIdStrings: string, autostart: boolean) const youtubeIds = youtubeIdStrings.split('\n'); youtubeIds.forEach(youtubeId => { - urls.push({ youtube_id: youtubeId, status: 'pending' }); + if (youtubeId.trim()) { + urls.push({ youtube_id: youtubeId, status: 'pending' }); + } }); } else { urls.push({ youtube_id: youtubeIdStrings, status: 'pending' }); diff --git a/frontend/src/pages/Channels.tsx b/frontend/src/pages/Channels.tsx index 5301d6c0..d71c2743 100644 --- a/frontend/src/pages/Channels.tsx +++ b/frontend/src/pages/Channels.tsx @@ -119,10 +119,12 @@ const Channels = () => { label="Subscribe" type="submit" onClick={async () => { - await updateBulkChannelSubscriptions(channelsToSubscribeTo, true); + if (channelsToSubscribeTo.trim()) { + await updateBulkChannelSubscriptions(channelsToSubscribeTo, true); - setShowNotification(true); - setShowAddForm(false); + setShowNotification(true); + setShowAddForm(false); + } }} /> diff --git a/frontend/src/pages/Download.tsx b/frontend/src/pages/Download.tsx index b32c276b..c7bc19cf 100644 --- a/frontend/src/pages/Download.tsx +++ b/frontend/src/pages/Download.tsx @@ -200,19 +200,23 @@ const Download = () => {