mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 11:50:14 +00:00
implement per channel sponsorblock
This commit is contained in:
parent
fe3e3cfacc
commit
365ebf53a5
@ -50,6 +50,9 @@
|
|||||||
},
|
},
|
||||||
"index_playlists": {
|
"index_playlists": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"integrate_sponsorblock": {
|
||||||
|
"type" : "boolean"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -130,6 +133,9 @@
|
|||||||
},
|
},
|
||||||
"index_playlists": {
|
"index_playlists": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"integrate_sponsorblock": {
|
||||||
|
"type" : "boolean"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -198,8 +198,17 @@ class ChannelOverwriteForm(forms.Form):
|
|||||||
("1", "Enable playlist index"),
|
("1", "Enable playlist index"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
SP_CHOICES = [
|
||||||
|
("", "-- change sponsorblock integrations"),
|
||||||
|
("0", "disable sponsorblock integration"),
|
||||||
|
("1", "enable sponsorblock integration"),
|
||||||
|
]
|
||||||
|
|
||||||
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(
|
index_playlists = forms.ChoiceField(
|
||||||
widget=forms.Select, choices=PLAYLIST_INDEX, required=False
|
widget=forms.Select, choices=PLAYLIST_INDEX, required=False
|
||||||
)
|
)
|
||||||
|
integrate_sponsorblock = forms.ChoiceField(
|
||||||
|
widget=forms.Select, choices=SP_CHOICES, required=False
|
||||||
|
)
|
||||||
|
@ -340,7 +340,12 @@ 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", "index_playlists"]
|
valid_keys = [
|
||||||
|
"download_format",
|
||||||
|
"autodelete_days",
|
||||||
|
"index_playlists",
|
||||||
|
"integrate_sponsorblock",
|
||||||
|
]
|
||||||
|
|
||||||
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():
|
||||||
|
@ -89,7 +89,15 @@
|
|||||||
{% endif %}</span></p>
|
{% endif %}</span></p>
|
||||||
{{ channel_overwrite_form.index_playlists }}<br>
|
{{ channel_overwrite_form.index_playlists }}<br>
|
||||||
</div>
|
</div>
|
||||||
<div class="overwrite-form-item"></div>
|
<div class="overwrite-form-item">
|
||||||
|
<p>Enable <a href="https://sponsor.ajay.app/" target="_blank">SponsorBlock</a>: <span class="settings-current">
|
||||||
|
{% if channel_info.channel_overwrites.integrate_sponsorblock %}
|
||||||
|
{{ channel_info.channel_overwrites.integrate_sponsorblock }}
|
||||||
|
{% else %}
|
||||||
|
False
|
||||||
|
{% endif %}</span></p>
|
||||||
|
{{ channel_overwrite_form.integrate_sponsorblock }}<br>
|
||||||
|
</div>
|
||||||
<button type="submit">Save Channel Overwrites</button>
|
<button type="submit">Save Channel Overwrites</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user