delete metadata when a media item is reset, related to #226
This commit is contained in:
parent
d0a214e21b
commit
0c347d523d
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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'})
|
||||
return append_uri_params(url, {'message': 'updated'})
|
||||
|
|
Loading…
Reference in New Issue