mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 11:50:14 +00:00
implement channel playlist index overwrite
This commit is contained in:
parent
f0e82caebb
commit
1498fadf27
@ -47,6 +47,9 @@
|
|||||||
},
|
},
|
||||||
"autodelete_days": {
|
"autodelete_days": {
|
||||||
"type": "long"
|
"type": "long"
|
||||||
|
},
|
||||||
|
"index_playlists": {
|
||||||
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -120,6 +123,9 @@
|
|||||||
},
|
},
|
||||||
"autodelete_days": {
|
"autodelete_days": {
|
||||||
"type": "long"
|
"type": "long"
|
||||||
|
},
|
||||||
|
"index_playlists": {
|
||||||
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -183,5 +183,14 @@ class SubscribeToPlaylistForm(forms.Form):
|
|||||||
class ChannelOverwriteForm(forms.Form):
|
class ChannelOverwriteForm(forms.Form):
|
||||||
"""custom overwrites for channel settings"""
|
"""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)
|
download_format = forms.CharField(label=False, required=False)
|
||||||
autodelete_days = forms.IntegerField(label=False, required=False)
|
autodelete_days = forms.IntegerField(label=False, required=False)
|
||||||
|
index_playlists = forms.ChoiceField(
|
||||||
|
widget=forms.Select, choices=PLAYLIST_INDEX, required=False
|
||||||
|
)
|
||||||
|
@ -274,7 +274,7 @@ class YoutubeChannel(YouTubeItem):
|
|||||||
|
|
||||||
def set_overwrites(self, overwrites):
|
def set_overwrites(self, overwrites):
|
||||||
"""set per channel 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", {})
|
to_write = self.json_data.get("channel_overwrites", {})
|
||||||
for key, value in overwrites.items():
|
for key, value in overwrites.items():
|
||||||
|
@ -75,6 +75,13 @@
|
|||||||
False
|
False
|
||||||
{% endif %}</span></p>
|
{% endif %}</span></p>
|
||||||
{{ channel_overwrite_form.autodelete_days }}<br>
|
{{ channel_overwrite_form.autodelete_days }}<br>
|
||||||
|
<p>Index playlists: <span class="settings-current">
|
||||||
|
{% if channel_info.channel_overwrites.index_playlists %}
|
||||||
|
{{ channel_info.channel_overwrites.index_playlists }}
|
||||||
|
{% else %}
|
||||||
|
False
|
||||||
|
{% endif %}</span></p>
|
||||||
|
{{ channel_overwrite_form.index_playlists }}<br>
|
||||||
<button type="submit">Save</button>
|
<button type="submit">Save</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user