From 0c347d523dcb155746dda224c6b1382322ef41ba Mon Sep 17 00:00:00 2001 From: meeb Date: Mon, 28 Mar 2022 19:13:30 +1100 Subject: [PATCH] delete metadata when a media item is reset, related to #226 --- tubesync/sync/signals.py | 2 +- tubesync/sync/tasks.py | 2 +- tubesync/sync/views.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tubesync/sync/signals.py b/tubesync/sync/signals.py index 5bfdaf3..9e417ff 100644 --- a/tubesync/sync/signals.py +++ b/tubesync/sync/signals.py @@ -96,7 +96,7 @@ def media_post_save(sender, instance, created, **kwargs): # Triggered after media is saved cap_changed = False can_download_changed = False - # Reset the skip flag if the download cap has changed if the media has not + # Reset the skip flag if the download cap has changed if the media has not # already been downloaded if not instance.downloaded: max_cap_age = instance.source.download_cap_date diff --git a/tubesync/sync/tasks.py b/tubesync/sync/tasks.py index f0a10a6..34f1381 100644 --- a/tubesync/sync/tasks.py +++ b/tubesync/sync/tasks.py @@ -52,7 +52,7 @@ def map_task_to_instance(task): Source: 'sync:source', Media: 'sync:media-item', } - # Unpack + # Unpack task_func, task_args_str = task.task_name, task.task_params model = TASK_MAP.get(task_func, None) if not model: diff --git a/tubesync/sync/views.py b/tubesync/sync/views.py index 1eb9f43..eaa5915 100644 --- a/tubesync/sync/views.py +++ b/tubesync/sync/views.py @@ -630,6 +630,7 @@ class MediaSkipView(FormView, SingleObjectMixin): # If the media has an associated NFO file with it, also delete it delete_file(self.object.nfopath) # Reset all download data + self.object.metadata = None self.object.downloaded = False self.object.downloaded_audio_codec = None self.object.downloaded_video_codec = None @@ -1033,4 +1034,4 @@ class UpdateMediaServerView(FormView, SingleObjectMixin): def get_success_url(self): url = reverse_lazy('sync:mediaserver', kwargs={'pk': self.object.pk}) - return append_uri_params(url, {'message': 'updated'}) \ No newline at end of file + return append_uri_params(url, {'message': 'updated'})