fix download filter for ignored videos, #401

This commit is contained in:
simon 2023-02-17 14:04:52 +07:00
parent fdf5b2d802
commit 72f091b85e
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
2 changed files with 7 additions and 5 deletions

View File

@ -376,13 +376,13 @@ class DownloadView(ArchivistResultsView):
def get(self, request):
"""handle get request"""
self.initiate_vars(request)
self._update_view_data(request)
filter_view = self._update_view_data(request)
self.find_results()
self.context.update(
{
"title": "Downloads",
"add_form": AddToQueueForm(),
"channel_agg_list": self._get_channel_agg(),
"channel_agg_list": self._get_channel_agg(filter_view),
}
)
return render(request, "home/downloads.html", self.context)
@ -417,11 +417,13 @@ class DownloadView(ArchivistResultsView):
}
)
def _get_channel_agg(self):
return filter_view
def _get_channel_agg(self, filter_view):
"""get pending channel with count"""
data = {
"size": 0,
"query": {"term": {"status": {"value": "pending"}}},
"query": {"term": {"status": {"value": filter_view}}},
"aggs": {
"channel_downloads": {
"multi_terms": {

View File

@ -142,7 +142,7 @@ function toggleCheckbox(checkbox) {
let payload = JSON.stringify(payloadDict);
sendPost(payload);
setTimeout(function () {
let currPage = window.location.pathname + window.location.search;
let currPage = window.location.pathname;
window.location.replace(currPage);
}, 500);
}