add delete and ignore, #891
This commit is contained in:
parent
158115d319
commit
677f85b993
|
|
@ -56,7 +56,7 @@ class AddDownloadItemSerializer(serializers.Serializer):
|
|||
"""serialize single item to add"""
|
||||
|
||||
youtube_id = serializers.CharField()
|
||||
status = serializers.ChoiceField(choices=["pending"])
|
||||
status = serializers.ChoiceField(choices=["pending", "ignore-force"])
|
||||
|
||||
|
||||
class AddToDownloadListSerializer(serializers.Serializer):
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import APIClient from '../../functions/APIClient';
|
||||
|
||||
export type DownloadQueueStatus = 'ignore' | 'pending' | 'priority';
|
||||
export type DownloadQueueStatus = 'ignore' | 'ignore-force' | 'pending' | 'priority';
|
||||
|
||||
const updateDownloadQueueStatusById = async (youtubeId: string, status: DownloadQueueStatus) => {
|
||||
return APIClient(`/api/download/${youtubeId}/`, {
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import useIsAdmin from '../functions/useIsAdmin';
|
|||
import ToggleConfig from '../components/ToggleConfig';
|
||||
import { PlaylistType } from '../api/loader/loadPlaylistById';
|
||||
import { useAppSettingsStore } from '../stores/AppSettingsStore';
|
||||
import updateDownloadQueueStatusById from '../api/actions/updateDownloadQueueStatusById';
|
||||
|
||||
const isInPlaylist = (videoId: string, playlist: PlaylistType) => {
|
||||
return playlist.playlist_entries.some(entry => {
|
||||
|
|
@ -358,7 +359,15 @@ const Video = () => {
|
|||
navigate(Routes.Channel(video.channel.channel_id));
|
||||
}}
|
||||
/>
|
||||
|
||||
<Button
|
||||
label="Delete and Ignore"
|
||||
className="danger-button"
|
||||
onClick={async () => {
|
||||
await deleteVideo(videoId);
|
||||
await updateDownloadQueueStatusById(videoId, 'ignore-force');
|
||||
navigate(Routes.Channel(video.channel.channel_id));
|
||||
}}
|
||||
/>
|
||||
<Button
|
||||
label="Cancel"
|
||||
onClick={() => setShowDeleteConfirm(!showDeleteConfirm)}
|
||||
|
|
|
|||
Loading…
Reference in New Issue