mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 20:00:15 +00:00
cleaning up leftover code from old vesions
This commit is contained in:
parent
5c2a8286d3
commit
7df4233224
@ -8,25 +8,6 @@ from home.src.helper import RedisArchivist
|
||||
from home.src.index_management import index_check
|
||||
|
||||
|
||||
def sync_redis_state():
|
||||
"""make sure redis gets the config.json values"""
|
||||
print("sync redis")
|
||||
config_handler = ArchivistConfig()
|
||||
config_handler.load_new_defaults()
|
||||
config = config_handler.config
|
||||
sort_order = config["archive"]["sort"]
|
||||
redis_archivist = RedisArchivist()
|
||||
redis_archivist.set_message("sort_order", sort_order, expire=False)
|
||||
hide_watched = bool(int(config["archive"]["hide_watched"]))
|
||||
redis_archivist.set_message("hide_watched", hide_watched, expire=False)
|
||||
show_subed_only = bool(int(config["archive"]["show_subed_only"]))
|
||||
redis_archivist.set_message(
|
||||
"show_subed_only", show_subed_only, expire=False
|
||||
)
|
||||
filter_view = config["archive"]["filter_view"]
|
||||
redis_archivist.set_message("filter_view", filter_view, expire=False)
|
||||
|
||||
|
||||
def make_folders():
|
||||
"""make needed cache folders here so docker doesn't mess it up"""
|
||||
folders = ["download", "channels", "videos", "import", "backup"]
|
||||
@ -58,5 +39,4 @@ class HomeConfig(AppConfig):
|
||||
def ready(self):
|
||||
release_lock()
|
||||
index_check()
|
||||
sync_redis_state()
|
||||
make_folders()
|
||||
|
@ -1,9 +1,6 @@
|
||||
{
|
||||
"archive": {
|
||||
"sort": "published",
|
||||
"filter_view": "pending",
|
||||
"hide_watched": false,
|
||||
"show_subed_only": false,
|
||||
"page_size": 12
|
||||
},
|
||||
"default_view": {
|
||||
|
@ -10,7 +10,7 @@
|
||||
<a href="/channel/{{ channel_info.channel_id }}/"><img src="/cache/channels/{{ channel_info.channel_id }}_banner.jpg" alt="channel_banner"></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="info-box info-box-3 padding-box">
|
||||
<div class="info-box info-box-3">
|
||||
<div class="info-box-item">
|
||||
<div class="round-img">
|
||||
<a href="{% url 'channel_id' channel_info.channel_id %}">
|
||||
|
@ -19,33 +19,6 @@
|
||||
</div>
|
||||
<div class="settings-group">
|
||||
<h2>Archive View</h2>
|
||||
<div class="settings-item">
|
||||
<p>Current default Sort: <span class="settings-current">{{ config.archive.sort }}</span></p>
|
||||
<i>Change how the home view and channels view sorts by defaults.</i><br>
|
||||
<select name="archive.sort" id="archive.sort"">
|
||||
<option value="" disabled selected> -- change sort order -- </option>
|
||||
<option value="published">date published</option>
|
||||
<option value="downloaded">date downloaded</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="settings-item">
|
||||
<p>Current default hide watched: <span class="settings-current">{{ config.archive.hide_watched }}</span></p>
|
||||
<i>Show or hide watched videos by default.</i><br>
|
||||
<select name="archive.hide_watched" id="archive.hide_watched"">
|
||||
<option value="" disabled selected> -- change visibility -- </option>
|
||||
<option value="0">show watched</option>
|
||||
<option value="1">hide watched</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="settings-item">
|
||||
<p>Current default show subscribed channels only: <span class="settings-current">{{ config.archive.show_subed_only }}</span></p>
|
||||
<i>Show subscribed channels only by default.</i><br>
|
||||
<select name="archive.show_subed_only" id="archive.show_subed_only"">
|
||||
<option value="" disabled selected> -- change visibility -- </option>
|
||||
<option value="0">show subscribed only</option>
|
||||
<option value="1">hide not subscribed</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="settings-item">
|
||||
<p>Current page size: <span class="settings-current">{{ config.archive.page_size }}</span></p>
|
||||
<i>Result of videos showing in archive page</i><br>
|
||||
|
@ -111,6 +111,8 @@ class HomeView(View):
|
||||
colors = config_handler["application"]["colors"]
|
||||
view_style = config_handler["default_view"]["home"]
|
||||
sort_order = RedisArchivist().get_message("sort_order")
|
||||
if not sort_order:
|
||||
sort_order = "published"
|
||||
hide_watched = RedisArchivist().get_message("hide_watched")
|
||||
return colors, view_style, sort_order, hide_watched
|
||||
|
||||
|
@ -473,6 +473,7 @@ button:hover {
|
||||
.info-box {
|
||||
display: grid;
|
||||
grid-gap: 1rem;
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
.info-box-3 {
|
||||
|
@ -43,7 +43,6 @@ function toggleCheckbox(checkbox) {
|
||||
var payloadDict = {};
|
||||
payloadDict[toggleId] = toggleVal;
|
||||
var payload = JSON.stringify(payloadDict);
|
||||
console.log(payload);
|
||||
sendPost(payload);
|
||||
setTimeout(function(){
|
||||
var currPage = window.location.pathname;
|
||||
@ -91,7 +90,6 @@ function downloadNow(button) {
|
||||
function forgetIgnore(button) {
|
||||
var youtube_id = button.getAttribute('data-id');
|
||||
var payload = JSON.stringify({'forgetIgnore': youtube_id});
|
||||
console.log(payload);
|
||||
sendPost(payload);
|
||||
document.getElementById("dl-" + youtube_id).remove();
|
||||
}
|
||||
@ -99,7 +97,6 @@ function forgetIgnore(button) {
|
||||
function addSingle(button) {
|
||||
var youtube_id = button.getAttribute('data-id');
|
||||
var payload = JSON.stringify({'addSingle': youtube_id});
|
||||
console.log(payload);
|
||||
sendPost(payload);
|
||||
document.getElementById("dl-" + youtube_id).remove();
|
||||
setTimeout(function(){
|
||||
|
Loading…
Reference in New Issue
Block a user