From 80bbce66d22a7b1c983ccce579f518e3a94b4aa6 Mon Sep 17 00:00:00 2001 From: Akhil Gupta Date: Sat, 20 Mar 2021 18:11:40 +0530 Subject: [PATCH] new and improved episodes page --- client/episodes_new.html | 99 ++++++++++++++++++++++++++++++--------- client/navbar.html | 7 ++- client/scripts.html | 8 ++-- controllers/pages.go | 18 +++---- controllers/websockets.go | 4 +- db/dbfunctions.go | 16 +++++++ service/podcastService.go | 4 ++ 7 files changed, 118 insertions(+), 38 deletions(-) diff --git a/client/episodes_new.html b/client/episodes_new.html index c429e2a..35e2c94 100644 --- a/client/episodes_new.html +++ b/client/episodes_new.html @@ -53,7 +53,12 @@ } body.playerExists .button-enqueue{ display: inline-block; + + [v-cloak] { + display: none; } +} + @@ -62,10 +67,13 @@
{{$setting := .setting}} -
+
- -
+ +
-
- - -
+
+
- - +
-
-
+
+ + + + +
+

@@ -275,10 +286,17 @@ var app = new Vue({ computed:{ page(){ return this.filter.page; + }, + count(){ + return this.filter.count; } }, watch:{ + page(newPage,oldPage){ + if(newPage==oldPage){ + return; + } if(newPage==1){ this.filter.previousPage=0; }else{ @@ -292,6 +310,17 @@ var app = new Vue({ this.getData() }, + count(current,old){ + this.getData() + }, + showFilters(current,old){ + + if(localStorage){ + localStorage.showFilters=current + } + + }, + selectedPodcasts(current,old){ var arr=[]; for (let index = 0; index < current.length; index++) { @@ -299,7 +328,7 @@ var app = new Vue({ arr.push(element.ID); } this.filter['podcastIds']=arr; - this.getData() + this.submitFilters() }, selectedTags(current,old){ var arr=[]; @@ -308,25 +337,28 @@ var app = new Vue({ arr.push(element.ID); } this.filter['tagIds']=arr; - this.getData() + this.submitFilters() }, selectedSorting(current,old){ this.filter.sorting=current.Value; - this.getData() + this.submitFilters() }, selectedDownloadStatus(current,old){ this.filter.isDownloaded=current.Value; - this.getData() + this.submitFilters() }, selectedPlayedStatus(current,old){ this.filter.isPlayed=current.Value; - this.getData() + this.submitFilters() }, }, mounted(){ if(localStorage && localStorage.episodesFilter){ this.filter=JSON.parse(localStorage.episodesFilter); } + if(localStorage && localStorage.showFilters){ + this.showFilters=JSON.parse(localStorage.showFilters); + } if(this.filter.podcastIds!=null){ var selectedPodcasts=[]; @@ -425,15 +457,17 @@ var app = new Vue({ downloadToDisk(item.ID) }, openPlayer(item){ - openPlayer(item.ID) + openPlayer([item.ID]) }, - enqueuePlayer(item){ - enqueuePlayer(item.ID) + enqueueEpisode(item){ + enqueueEpisode([item.ID]) }, searchQueryUpated(){ var self=this; + clearTimeout(this.debounce) this.debounce = setTimeout(() => { + self.filter.page=1 self.getData() }, 600) }, @@ -447,6 +481,23 @@ var app = new Vue({ this.getData(); }, + toggleFilters(){ + this.showFilters=!this.showFilters + }, + playPage(){ + var itemIds=[]; + for(var i=0;i
-

{{ .title }}

+

{{ .title }}

{{if .podcastId }}