2021-09-05 17:10:14 +00:00
|
|
|
{% extends "home/base.html" %}
|
|
|
|
{% load static %}
|
|
|
|
{% block content %}
|
2021-12-06 11:05:25 +00:00
|
|
|
<div class="boxed-content">
|
|
|
|
<div class="title-bar">
|
|
|
|
<h1>Downloads</h1>
|
2021-09-05 17:10:14 +00:00
|
|
|
</div>
|
2021-12-06 11:05:25 +00:00
|
|
|
<div id="notifications" data="download"></div>
|
|
|
|
<div id="downloadControl"></div>
|
|
|
|
<div class="info-box info-box-3">
|
|
|
|
<div class="icon-text">
|
|
|
|
<img id="rescan-icon" onclick="rescanPending()" src="{% static 'img/icon-rescan.svg' %}" alt="rescan-icon">
|
|
|
|
<p>Rescan subscriptions</p>
|
2021-09-05 17:10:14 +00:00
|
|
|
</div>
|
2021-12-06 11:05:25 +00:00
|
|
|
<div class="icon-text">
|
|
|
|
<img id="download-icon" onclick="dlPending()" src="{% static 'img/icon-download.svg' %}" alt="download-icon">
|
|
|
|
<p>Start download</p>
|
|
|
|
</div>
|
|
|
|
<div class="icon-text">
|
2022-01-02 09:25:05 +00:00
|
|
|
<img id="animate-icon" onclick="showForm()" src="{% static 'img/icon-add.svg' %}" alt="add-icon">
|
2021-12-06 11:05:25 +00:00
|
|
|
<p>Add to download queue</p>
|
|
|
|
<div class="show-form">
|
|
|
|
<form id='hidden-form' action="/downloads/" method="post">
|
|
|
|
{% csrf_token %}
|
|
|
|
{{ add_form }}
|
|
|
|
<button type="submit">Add to download queue</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
2021-10-03 11:17:07 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-12-06 11:05:25 +00:00
|
|
|
<div class="view-controls">
|
|
|
|
<div class="toggle">
|
|
|
|
<span>Show only ignored videos:</span>
|
|
|
|
<div class="toggleBox">
|
2021-12-18 11:22:57 +00:00
|
|
|
<input id="show_ignored_only" onclick="toggleCheckbox(this)" type="checkbox" {% if show_ignored_only %}checked{% endif %}>
|
|
|
|
{% if show_ignored_only %}
|
|
|
|
<label for="" class="ofbtn">Off</label>
|
|
|
|
{% else %}
|
|
|
|
<label for="" class="onbtn">On</label>
|
|
|
|
{% endif %}
|
2021-09-05 17:10:14 +00:00
|
|
|
</div>
|
2021-12-06 11:05:25 +00:00
|
|
|
</div>
|
|
|
|
<div class="view-icons">
|
|
|
|
<img src="{% static 'img/icon-gridview.svg' %}" onclick="changeView(this)" data-origin="downloads" data-value="grid" alt="grid view">
|
|
|
|
<img src="{% static 'img/icon-listview.svg' %}" onclick="changeView(this)" data-origin="downloads" data-value="list" alt="list view">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="title-split">
|
|
|
|
{% if show_ignored_only %}
|
|
|
|
<h2>Ignored from download</h2>
|
|
|
|
<button onclick="deleteQueue(this)" data-id="ignore" title="Delete all previously ignored videos from the queue">Delete all ignored</button>
|
|
|
|
{% else %}
|
|
|
|
<h2>Download queue</h2>
|
|
|
|
<button onclick="deleteQueue(this)" data-id="pending" title="Delete all pending videos from the queue">Delete all queued</button>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
<h3>Total videos: {{ max_hits }}</h3>
|
|
|
|
<div class="dl-list {{ view_style }}">
|
2021-12-27 05:01:49 +00:00
|
|
|
{% if results %}
|
|
|
|
{% for video in results %}
|
2021-12-27 03:58:49 +00:00
|
|
|
<div class="dl-item {{ view_style }}" id="dl-{{ video.source.youtube_id }}">
|
2021-12-06 11:05:25 +00:00
|
|
|
<div class="dl-thumb {{ view_style }}">
|
2021-12-27 03:58:49 +00:00
|
|
|
<img src="/cache/{{ video.source.vid_thumb_url }}" alt="video_thumb">
|
2021-12-06 11:05:25 +00:00
|
|
|
{% if show_ignored_only %}
|
|
|
|
<span>ignored</span>
|
|
|
|
{% else %}
|
|
|
|
<span>queued</span>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
<div class="dl-desc {{ view_style }}">
|
2021-12-27 03:58:49 +00:00
|
|
|
<h3>{{ video.source.title }}</h3>
|
|
|
|
{% if video.source.channel_indexed %}
|
|
|
|
<a href="{% url 'channel_id' video.source.channel_id %}">{{ video.source.channel_name }}</a>
|
2021-12-06 11:05:25 +00:00
|
|
|
{% else %}
|
2021-12-27 03:58:49 +00:00
|
|
|
<span>{{ video.source.channel_name }}</span>
|
2021-12-06 11:05:25 +00:00
|
|
|
{% endif %}
|
2021-12-27 03:58:49 +00:00
|
|
|
<p>Published: {{ video.source.published }} | Duration: {{ video.source.duration }} | {{ video.source.youtube_id }}</p>
|
2021-12-06 11:05:25 +00:00
|
|
|
{% if show_ignored_only %}
|
2021-12-27 03:58:49 +00:00
|
|
|
<button data-id="{{ video.source.youtube_id }}" onclick="forgetIgnore(this)">Forget</button>
|
|
|
|
<button data-id="{{ video.source.youtube_id }}" onclick="addSingle(this)">Add to queue</button>
|
2021-12-06 11:05:25 +00:00
|
|
|
{% else %}
|
2021-12-27 03:58:49 +00:00
|
|
|
<button data-id="{{ video.source.youtube_id }}" onclick="toIgnore(this)">Ignore</button>
|
|
|
|
<button id="{{ video.source.youtube_id }}" data-id="{{ video.source.youtube_id }}" onclick="downloadNow(this)">Download now</button>
|
2021-12-06 11:05:25 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2021-09-05 17:10:14 +00:00
|
|
|
</div>
|
|
|
|
<script type="text/javascript" src="{% static 'progress.js' %}"></script>
|
|
|
|
{% endblock content %}
|