From 46ba2593a2d7d756676d6e57e0924326ee1bb74e Mon Sep 17 00:00:00 2001 From: administrator <7dn1yh5j@debauchez.fr> Date: Mon, 11 Dec 2023 03:19:43 +0100 Subject: [PATCH] Removed non-pertinent source option --- .../migrations/0021_add_delete_files_on_disk.py | 17 ----------------- tubesync/sync/models.py | 5 ----- tubesync/sync/signals.py | 2 +- tubesync/sync/views.py | 2 +- 4 files changed, 2 insertions(+), 24 deletions(-) delete mode 100644 tubesync/sync/migrations/0021_add_delete_files_on_disk.py diff --git a/tubesync/sync/migrations/0021_add_delete_files_on_disk.py b/tubesync/sync/migrations/0021_add_delete_files_on_disk.py deleted file mode 100644 index 5745d47..0000000 --- a/tubesync/sync/migrations/0021_add_delete_files_on_disk.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by pac - -from django.db import migrations, models - -class Migration(migrations.Migration): - - dependencies = [ - ('sync', '0020_auto_20231024_1825'), - ] - - operations = [ - migrations.AddField( - model_name='source', - name='delete_files_on_disk', - field=models.BooleanField(default=False, help_text='Delete files on disk when they are removed from TubeSync', verbose_name='delete files on disk'), - ), - ] \ No newline at end of file diff --git a/tubesync/sync/models.py b/tubesync/sync/models.py index a63c57e..dff8063 100644 --- a/tubesync/sync/models.py +++ b/tubesync/sync/models.py @@ -300,11 +300,6 @@ class Source(models.Model): default=False, help_text=_('Delete media that is no longer on this playlist') ) - delete_files_on_disk = models.BooleanField( - _('delete files on disk'), - default=False, - help_text=_('Delete files on disk when they are removed from TubeSync') - ) source_resolution = models.CharField( _('source resolution'), max_length=8, diff --git a/tubesync/sync/signals.py b/tubesync/sync/signals.py index b9f8835..6600b71 100644 --- a/tubesync/sync/signals.py +++ b/tubesync/sync/signals.py @@ -224,7 +224,7 @@ def media_pre_delete(sender, instance, **kwargs): if thumbnail_url: delete_task_by_media('sync.tasks.download_media_thumbnail', (str(instance.pk), thumbnail_url)) - if instance.source.delete_files_on_disk and (instance.media_file or instance.thumb): + if instance.media_file or instance.thumb: # Delete all media files if it contains filename filepath = instance.media_file.path if instance.media_file else instance.thumb.path barefilepath, fileext = os.path.splitext(filepath) diff --git a/tubesync/sync/views.py b/tubesync/sync/views.py index ac65d5c..ba319c0 100644 --- a/tubesync/sync/views.py +++ b/tubesync/sync/views.py @@ -298,7 +298,7 @@ class EditSourceMixin: model = Source fields = ('source_type', 'key', 'name', 'directory', 'filter_text', 'media_format', 'index_schedule', 'download_media', 'download_cap', 'delete_old_media', - 'delete_removed_media', 'delete_files_on_disk', 'days_to_keep', 'source_resolution', + 'delete_removed_media', 'days_to_keep', 'source_resolution', 'source_vcodec', 'source_acodec', 'prefer_60fps', 'prefer_hdr', 'fallback', 'copy_thumbnails', 'write_nfo', 'write_json', 'embed_metadata', 'embed_thumbnail', 'enable_sponsorblock', 'sponsorblock_categories', 'write_subtitles',