diff --git a/Dockerfile b/Dockerfile index 8896c0a..22a8995 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,8 @@ FROM debian:bullseye-slim ARG TARGETPLATFORM ARG S6_VERSION="3.1.2.1" -ARG FFMPEG_DATE="autobuild-2023-01-03-12-55" -ARG FFMPEG_VERSION="109474-gc94988a781" +ARG FFMPEG_DATE="autobuild-2023-02-17-12-59" +ARG FFMPEG_VERSION="109874-gaeceefa622" ENV DEBIAN_FRONTEND="noninteractive" \ HOME="/root" \ @@ -27,8 +27,8 @@ RUN export ARCH=$(case ${TARGETPLATFORM:-linux/amd64} in \ "linux/arm64") echo "https://github.com/just-containers/s6-overlay/releases/download/v${S6_VERSION}/s6-overlay-aarch64.tar.xz" ;; \ *) echo "" ;; esac) && \ export FFMPEG_EXPECTED_SHA256=$(case ${TARGETPLATFORM:-linux/amd64} in \ - "linux/amd64") echo "ed9059668e4a6dac9bde122a775f52ad08cbb90df3658f8c1e328477c13c242e" ;; \ - "linux/arm64") echo "dd1375bd351d38ea1cc3efd68a998699366e28bd9b90df65d11af2b9121746b7" ;; \ + "linux/amd64") echo "f855e481b78aed625eb729e7a53bb7e84e07f76ab64c8bf48a30e631f88e2ff5" ;; \ + "linux/arm64") echo "9439235e4db6dcd99685d3c51223413e4f89f25e27f7aa7fe17a53c1a3d3ca9f" ;; \ *) echo "" ;; esac) && \ export FFMPEG_DOWNLOAD=$(case ${TARGETPLATFORM:-linux/amd64} in \ "linux/amd64") echo "https://github.com/yt-dlp/FFmpeg-Builds/releases/download/${FFMPEG_DATE}/ffmpeg-N-${FFMPEG_VERSION}-linux64-gpl.tar.xz" ;; \ diff --git a/tubesync/common/static/styles/materializecss/components/forms/_checkboxes.scss b/tubesync/common/static/styles/materializecss/components/forms/_checkboxes.scss index ddc7d96..22a0e33 100644 --- a/tubesync/common/static/styles/materializecss/components/forms/_checkboxes.scss +++ b/tubesync/common/static/styles/materializecss/components/forms/_checkboxes.scss @@ -14,7 +14,7 @@ // Text Label Style + span:not(.lever) { position: relative; - padding-left: 35px; + padding-left: 27px; cursor: pointer; display: inline-block; height: 25px; diff --git a/tubesync/common/static/styles/tubesync.scss b/tubesync/common/static/styles/tubesync.scss index cdf89ec..30a41fd 100644 --- a/tubesync/common/static/styles/tubesync.scss +++ b/tubesync/common/static/styles/tubesync.scss @@ -26,4 +26,7 @@ html { .flex-grow { flex-grow: 1; } - \ No newline at end of file + +.help-text > i { + padding-right: 6px; +} \ No newline at end of file diff --git a/tubesync/sync/migrations/0015_auto_20230213_0603.py b/tubesync/sync/migrations/0015_auto_20230213_0603.py new file mode 100644 index 0000000..54592f9 --- /dev/null +++ b/tubesync/sync/migrations/0015_auto_20230213_0603.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.17 on 2023-02-13 06:03 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('sync', '0014_alter_media_media_file'), + ] + + operations = [ + migrations.AddField( + model_name='media', + name='manual_skip', + field=models.BooleanField(db_index=True, default=False, help_text='Media marked as "skipped", won\' be downloaded', verbose_name='manual_skip'), + ), + migrations.AlterField( + model_name='media', + name='skip', + field=models.BooleanField(db_index=True, default=False, help_text='INTERNAL FLAG - Media will be skipped and not downloaded', verbose_name='skip'), + ), + ] diff --git a/tubesync/sync/models.py b/tubesync/sync/models.py index fc1d9f8..a438b5c 100644 --- a/tubesync/sync/models.py +++ b/tubesync/sync/models.py @@ -815,7 +815,13 @@ class Media(models.Model): _('skip'), db_index=True, default=False, - help_text=_('Media will be skipped and not downloaded') + help_text=_('INTERNAL FLAG - Media will be skipped and not downloaded') + ) + manual_skip = models.BooleanField( + _('manual_skip'), + db_index=True, + default=False, + help_text=_('Media marked as "skipped", won\' be downloaded') ) downloaded = models.BooleanField( _('downloaded'), diff --git a/tubesync/sync/signals.py b/tubesync/sync/signals.py index 9e417ff..6800a2f 100644 --- a/tubesync/sync/signals.py +++ b/tubesync/sync/signals.py @@ -93,6 +93,10 @@ def task_task_failed(sender, task_id, completed_task, **kwargs): @receiver(post_save, sender=Media) def media_post_save(sender, instance, created, **kwargs): + # If the media is skipped manually, bail. + if instance.manual_skip: + return + # Triggered after media is saved cap_changed = False can_download_changed = False diff --git a/tubesync/sync/tasks.py b/tubesync/sync/tasks.py index 678e46c..def7529 100644 --- a/tubesync/sync/tasks.py +++ b/tubesync/sync/tasks.py @@ -221,6 +221,11 @@ def download_media_metadata(media_id): log.error(f'Task download_media_metadata(pk={media_id}) called but no ' f'media exists with ID: {media_id}') return + + if media.manual_skip: + log.info(f'Task for ID: {media_id} skipped, due to task being manually skipped.') + return + source = media.source metadata = media.index_metadata() media.metadata = json.dumps(metadata, default=json_serial) diff --git a/tubesync/sync/templates/sync/media-item.html b/tubesync/sync/templates/sync/media-item.html index c2e83dd..4f0e524 100644 --- a/tubesync/sync/templates/sync/media-item.html +++ b/tubesync/sync/templates/sync/media-item.html @@ -22,8 +22,11 @@ {% endif %} -{% if not media.can_download %}{% include 'errorbox.html' with message='Media cannot be downloaded because it has no formats which match the source requirements.' %}{% endif %} -{% if media.skip %}{% include 'errorbox.html' with message='Media is marked to be skipped and will not be downloaded.' %}{% endif %} +{% if media.manual_skip %}{% include 'errorbox.html' with message='Media is marked to be skipped and will not be downloaded.' %} +{% else %} + {% if not media.can_download %}{% include 'errorbox.html' with message='Media cannot be downloaded because it has no formats which match the source requirements.' %}{% endif %} + {% if media.skip %}{% include 'errorbox.html' with message='This media may be skipped due to error(s).' %}{% endif %} +{% endif %} {% include 'infobox.html' with message=message %}
@@ -167,10 +170,10 @@ {% else %}
- {% if media.skip %} - Enable (unskip) media + {% if media.manual_skip %} + Unskip media (manually) {% else %} - Skip media + Manually mark media to be skipped {% endif %}
diff --git a/tubesync/sync/templates/sync/media.html b/tubesync/sync/templates/sync/media.html index a210458..420b15b 100644 --- a/tubesync/sync/templates/sync/media.html +++ b/tubesync/sync/templates/sync/media.html @@ -36,8 +36,10 @@ {% if m.downloaded %} {{ m.download_date|date:'Y-m-d' }} {% else %} - {% if m.skip %} - Skipped + {% if m.manual_skip %} + Manually skipped + {% elif m.skip %} + Skipped by system {% elif not m.source.download_media %} Disabled at source {% elif not m.has_metadata %} diff --git a/tubesync/sync/views.py b/tubesync/sync/views.py index 5739ee0..58bb465 100644 --- a/tubesync/sync/views.py +++ b/tubesync/sync/views.py @@ -488,16 +488,16 @@ class MediaView(ListView): if self.show_skipped: q = Media.objects.filter(source=self.filter_source) elif self.only_skipped: - q = Media.objects.filter(source=self.filter_source, skip=True) + q = Media.objects.filter(Q(source=self.filter_source) & (Q(skip=True) | Q(manual_skip=True))) else: - q = Media.objects.filter(source=self.filter_source, skip=False) + q = Media.objects.filter(Q(source=self.filter_source) & (Q(skip=False) & Q(manual_skip=False))) else: if self.show_skipped: q = Media.objects.all() elif self.only_skipped: - q = Media.objects.filter(skip=True) + q = Media.objects.filter(Q(skip=True)|Q(manual_skip=True)) else: - q = Media.objects.filter(skip=False) + q = Media.objects.filter(Q(skip=False)&Q(manual_skip=False)) return q.order_by('-published', '-created') def get_context_data(self, *args, **kwargs): @@ -669,6 +669,7 @@ class MediaSkipView(FormView, SingleObjectMixin): self.object.downloaded_filesize = None # Mark it to be skipped self.object.skip = True + self.object.manual_skip = True self.object.save() return super().form_valid(form) @@ -697,6 +698,7 @@ class MediaEnableView(FormView, SingleObjectMixin): def form_valid(self, form): # Mark it as not skipped self.object.skip = False + self.object.manual_skip = False self.object.save() return super().form_valid(form) diff --git a/tubesync/sync/youtube.py b/tubesync/sync/youtube.py index c70183f..00ae958 100644 --- a/tubesync/sync/youtube.py +++ b/tubesync/sync/youtube.py @@ -113,13 +113,13 @@ def download_media(url, media_format, extension, output_file, info_json, 'postprocessors': [] } sbopt = { - 'key': 'SponsorBlock', - 'categories': [sponsor_categories] - } + 'key': 'SponsorBlock', + 'categories': [sponsor_categories] + } ffmdopt = { 'key': 'FFmpegMetadata', - 'add_chapters': True, - 'add_metadata': True + 'add_chapters': True, + 'add_metadata': True } opts = get_yt_opts() diff --git a/tubesync/tubesync/settings.py b/tubesync/tubesync/settings.py index f56aeaa..de7a1bc 100644 --- a/tubesync/tubesync/settings.py +++ b/tubesync/tubesync/settings.py @@ -6,7 +6,7 @@ CONFIG_BASE_DIR = BASE_DIR DOWNLOADS_BASE_DIR = BASE_DIR -VERSION = '0.12.0' +VERSION = '0.12.1' SECRET_KEY = '' DEBUG = False ALLOWED_HOSTS = []