add playlist discovery button to channel_id page

This commit is contained in:
simon 2021-11-13 17:35:48 +07:00
parent ac14cd5ebb
commit c3ece970ee
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
2 changed files with 13 additions and 0 deletions

View File

@ -49,6 +49,7 @@
<p>Total Videos archived: {{ max_hits }}</p> <p>Total Videos archived: {{ max_hits }}</p>
<p>Watched: <button title="Mark all videos from {{ channel_info.channel_name }} as watched" type="button" id="{{ channel_info.channel_id }}" onclick="isWatched(this.id)">Mark as watched</button></p> <p>Watched: <button title="Mark all videos from {{ channel_info.channel_name }} as watched" type="button" id="{{ channel_info.channel_id }}" onclick="isWatched(this.id)">Mark as watched</button></p>
{% endif %} {% endif %}
<button title="Find playlists for {{ channel_info.channel_name }}" type="button" id="find-playlists-button" data-id="{{ channel_info.channel_id }}" onclick="findPlaylists(this)">Find Playlists</button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -187,6 +187,18 @@ function fsRescan() {
toReplace.appendChild(message); toReplace.appendChild(message);
} }
function findPlaylists(button) {
var channel_id = button.getAttribute("data-id");
var payload = JSON.stringify({'find-playlists': channel_id});
sendPost(payload);
// clear button
var message = document.createElement('p');
message.innerText = 'Scraping for playlists in progress';
var toReplace = document.getElementById('find-playlists-button');
toReplace.innerHTML = '';
toReplace.appendChild(message);
}
// delete from file system // delete from file system
function deleteConfirm() { function deleteConfirm() {
to_show = document.getElementById("delete-button"); to_show = document.getElementById("delete-button");