Add trim to subscribe textarea fields #908

This commit is contained in:
MerlinScheurer
2025-03-28 01:26:34 +01:00
parent 04ea6254b7
commit 0aa5ef5b31
7 changed files with 36 additions and 20 deletions

View File

@@ -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() },
});
};

View File

@@ -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 });

View File

@@ -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 });

View File

@@ -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' });