diff --git a/tubearchivist/home/src/es/index_mapping.json b/tubearchivist/home/src/es/index_mapping.json index a94acda..29f6b7e 100644 --- a/tubearchivist/home/src/es/index_mapping.json +++ b/tubearchivist/home/src/es/index_mapping.json @@ -47,6 +47,9 @@ }, "autodelete_days": { "type": "long" + }, + "index_playlists": { + "type": "boolean" } } } @@ -120,6 +123,9 @@ }, "autodelete_days": { "type": "long" + }, + "index_playlists": { + "type": "boolean" } } } diff --git a/tubearchivist/home/src/frontend/forms.py b/tubearchivist/home/src/frontend/forms.py index 839a88a..c4ac817 100644 --- a/tubearchivist/home/src/frontend/forms.py +++ b/tubearchivist/home/src/frontend/forms.py @@ -183,5 +183,14 @@ class SubscribeToPlaylistForm(forms.Form): class ChannelOverwriteForm(forms.Form): """custom overwrites for channel settings""" + PLAYLIST_INDEX = [ + ("", "-- change playlist index --"), + ("0", "Disable playlist index"), + ("1", "Enable playlist index"), + ] + download_format = forms.CharField(label=False, required=False) autodelete_days = forms.IntegerField(label=False, required=False) + index_playlists = forms.ChoiceField( + widget=forms.Select, choices=PLAYLIST_INDEX, required=False + ) diff --git a/tubearchivist/home/src/index/channel.py b/tubearchivist/home/src/index/channel.py index 7d40fd2..10da4f4 100644 --- a/tubearchivist/home/src/index/channel.py +++ b/tubearchivist/home/src/index/channel.py @@ -274,7 +274,7 @@ class YoutubeChannel(YouTubeItem): def set_overwrites(self, overwrites): """set per channel overwrites""" - valid_keys = ["download_format", "autodelete_days"] + valid_keys = ["download_format", "autodelete_days", "index_playlists"] to_write = self.json_data.get("channel_overwrites", {}) for key, value in overwrites.items(): diff --git a/tubearchivist/home/templates/home/channel_id.html b/tubearchivist/home/templates/home/channel_id.html index aaa7e03..4754249 100644 --- a/tubearchivist/home/templates/home/channel_id.html +++ b/tubearchivist/home/templates/home/channel_id.html @@ -75,6 +75,13 @@ False {% endif %}

{{ channel_overwrite_form.autodelete_days }}
+

Index playlists: + {% if channel_info.channel_overwrites.index_playlists %} + {{ channel_info.channel_overwrites.index_playlists }} + {% else %} + False + {% endif %}

+ {{ channel_overwrite_form.index_playlists }}