From 48b203841afb39df5d991f47fb2419e78d19cd25 Mon Sep 17 00:00:00 2001 From: Roberto Tonino Date: Sun, 20 Sep 2020 13:27:24 +0200 Subject: [PATCH] fix: cleaned up comments --- public/js/bundle.js | 2 +- src/components/TheDownloadTab.vue | 167 +------------------------ src/components/downloads/QueueItem.vue | 1 - 3 files changed, 2 insertions(+), 168 deletions(-) diff --git a/public/js/bundle.js b/public/js/bundle.js index f690fb1..5038144 100644 --- a/public/js/bundle.js +++ b/public/js/bundle.js @@ -41,7 +41,7 @@ function(e){var t,n,a,i,r,s,o,l,c,u,d,p,h,m,f,g,v,b,y,_="sizzle"+1*new Date,k=e. * * Copyright (C) 2018 Varun A P */ -!function(t,n){e.exports?e.exports=n():t.Toastify=n()}(_o,(function(e){var t=function(e){return new t.lib.init(e)};function n(e,t){return!(!e||"string"!=typeof t)&&!!(e.className&&e.className.trim().split(/\s+/gi).indexOf(t)>-1)}return t.lib=t.prototype={toastify:"1.8.0",constructor:t,init:function(e){return e||(e={}),this.options={},this.toastElement=null,this.options.text=e.text||"Hi there!",this.options.node=e.node,this.options.duration=0===e.duration?0:e.duration||3e3,this.options.selector=e.selector,this.options.callback=e.callback||function(){},this.options.destination=e.destination,this.options.newWindow=e.newWindow||!1,this.options.close=e.close||!1,this.options.gravity="bottom"===e.gravity?"toastify-bottom":"toastify-top",this.options.positionLeft=e.positionLeft||!1,this.options.position=e.position||"",this.options.backgroundColor=e.backgroundColor,this.options.avatar=e.avatar||"",this.options.className=e.className||"",this.options.stopOnFocus=void 0===e.stopOnFocus||e.stopOnFocus,this.options.onClick=e.onClick,this},buildToast:function(){if(!this.options)throw"Toastify is not initialized";var e=document.createElement("div");if(e.className="toastify on "+this.options.className,this.options.position?e.className+=" toastify-"+this.options.position:!0===this.options.positionLeft?(e.className+=" toastify-left",console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):e.className+=" toastify-right",e.className+=" "+this.options.gravity,this.options.backgroundColor&&(e.style.background=this.options.backgroundColor),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)e.appendChild(this.options.node);else if(e.innerHTML=this.options.text,""!==this.options.avatar){var t=document.createElement("img");t.src=this.options.avatar,t.className="toastify-avatar","left"==this.options.position||!0===this.options.positionLeft?e.appendChild(t):e.insertAdjacentElement("beforeend",t)}if(!0===this.options.close){var n=document.createElement("span");n.innerHTML="✖",n.className="toast-close",n.addEventListener("click",function(e){e.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}.bind(this));var a=window.innerWidth>0?window.innerWidth:screen.width;("left"==this.options.position||!0===this.options.positionLeft)&&a>360?e.insertAdjacentElement("afterbegin",n):e.appendChild(n)}if(this.options.stopOnFocus&&this.options.duration>0){const t=this;e.addEventListener("mouseover",(function(t){window.clearTimeout(e.timeOutValue)})),e.addEventListener("mouseleave",(function(){e.timeOutValue=window.setTimeout((function(){t.removeElement(e)}),t.options.duration)}))}return void 0!==this.options.destination&&e.addEventListener("click",function(e){e.stopPropagation(),!0===this.options.newWindow?window.open(this.options.destination,"_blank"):window.location=this.options.destination}.bind(this)),"function"==typeof this.options.onClick&&void 0===this.options.destination&&e.addEventListener("click",function(e){e.stopPropagation(),this.options.onClick()}.bind(this)),e},showToast:function(){var e;if(this.toastElement=this.buildToast(),!(e=void 0===this.options.selector?document.body:document.getElementById(this.options.selector)))throw"Root element is not defined";return e.insertBefore(this.toastElement,e.firstChild),t.reposition(),this.options.duration>0&&(this.toastElement.timeOutValue=window.setTimeout(function(){this.removeElement(this.toastElement)}.bind(this),this.options.duration)),this},hideToast:function(){this.toastElement.timeOutValue&&clearTimeout(this.toastElement.timeOutValue),this.removeElement(this.toastElement)},removeElement:function(e){e.className=e.className.replace(" on",""),window.setTimeout(function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),e.parentNode&&e.parentNode.removeChild(e),this.options.callback.call(e),t.reposition()}.bind(this),400)}},t.reposition=function(){for(var e,t={top:15,bottom:15},a={top:15,bottom:15},i={top:15,bottom:15},r=document.getElementsByClassName("toastify"),s=0;s0?window.innerWidth:screen.width)<=360?(r[s].style[e]=i[e]+"px",i[e]+=o+15):!0===n(r[s],"toastify-left")?(r[s].style[e]=t[e]+"px",t[e]+=o+15):(r[s].style[e]=a[e]+"px",a[e]+=o+15)}return this},t.lib.init.prototype=t.lib,t}))}));let zl={};const Ml=function(e,t=null,n=!0,a=null){if(zl[a]){let i=zl[a],r=Ao(`div.toastify[toast_id=${a}]`);e&&r.find(".toast-message").html(e),t&&(t="loading"==t?'
':`${t}`,r.find(".toast-icon").html(t)),null!==n&&n&&(r.addClass("dismissable"),setTimeout((function(){i.hideToast(),delete zl[a]}),3e3))}else{let i=Sl({text:`${t=null==t?"":"loading"==t?'
':`${t}`}
${e}`,duration:n?3e3:0,gravity:"bottom",position:"left",className:n?"dismissable":"",onClick:function(){let e=!0;if(a){let t=document.querySelector(`div.toastify[toast_id=${a}]`).classList;t&&(e=-1!=Array.from(t).indexOf("dismissable"))}i&&e&&(i.hideToast(),a&&delete zl[a])}}).showToast();a&&(zl[a]=i,Ao(i.toastElement).attr("toast_id",a))}};ml.on("toast",e=>{const{msg:t,icon:n,dismiss:a,id:i}=e;Ml(t,n||null,void 0===a||a,i||null)});const Dl={components:{QueueItem:Tl},data:()=>({cachedTabWidth:parseInt(localStorage.getItem("downloadTabWidth"))||300,queue:[],queueList:{},queueComplete:[],clientMode:window.clientMode}),mounted(){ml.on("startDownload",this.startDownload),ml.on("startConversion",this.startConversion),ml.on("init_downloadQueue",this.initQueue),ml.on("addedToQueue",this.addToQueue),ml.on("updateQueue",this.updateQueue),ml.on("removedFromQueue",this.removeFromQueue),ml.on("finishDownload",this.finishDownload),ml.on("removedAllDownloads",this.removeAllDownloads),ml.on("removedFinishedDownloads",this.removedFinishedDownloads),"true"===localStorage.getItem("slimDownloads")&&this.$refs.list.classList.add("slim"),"true"===localStorage.getItem("downloadTabOpen")&&(this.$refs.container.classList.remove("tab_hidden"),this.setTabWidth(this.cachedTabWidth)),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",this.handleDrag)}),window.addEventListener("beforeunload",()=>{localStorage.setItem("downloadTabWidth",this.cachedTabWidth)})},methods:{...Go(["setErrors"]),onRemoveItem(e){ml.emit("removeFromQueue",e),Ao("#bar_"+e).hasClass("indeterminate")},setTabWidth(e){void 0===e?(this.$refs.container.style.width="",this.$refs.list.style.width=""):(this.$refs.container.style.width=e+"px",this.$refs.list.style.width=e+"px")},handleListClick(e){console.log("this.handleListClick")},initQueue(e){console.log("this.initQueue");const{queue:t,queueComplete:n,currentItem:a,queueList:i,restored:r}=e;n.length&&n.forEach(e=>{i[e].silent=!0,this.addToQueue(i[e])}),a&&(i[a].silent=!0,this.addToQueue(i[a],!0)),t.forEach(e=>{i[e].silent=!0,this.addToQueue(i[e])}),r&&(Ml(this.$t("toasts.queueRestored"),"done",!0,"restoring_queue"),ml.emit("queueRestored"))},addToQueue(e,t=!1){if(console.log("this.addToQueue"),Array.isArray(e)){if(e.length>1)return e.forEach((e,t)=>{e.silent=!0,this.addToQueue(e)}),void Ml(this.$t("toasts.addedMoreToQueue",{n:e.length}),"playlist_add_check");e=e[0]}this.$set(e,"current",t),this.$set(this.queueList,e.uuid,e);if(e.downloaded+e.failed==e.size){const t=-1==this.queueComplete.indexOf(e.uuid);this.$set(this.queueList[e.uuid],"status","download finished"),t&&this.queueComplete.push(e.uuid)}else{-1==this.queue.indexOf(e.uuid)&&this.queue.push(e.uuid)}(e.progress>0&&e.progress<100||t)&&this.startDownload(e.uuid),e.downloaded+e.failed==e.size&&(0==e.failed||(e.failed,e.size)),e.silent||Ml(this.$t("toasts.addedToQueue",{item:e.title}),"playlist_add_check")},updateQueue(e){const{uuid:t,downloaded:n,failed:a,progress:i,conversion:r,error:s,data:o,errid:l}=e;console.log("this.updateQueue",!!this.queueList[t]),t&&this.queue.indexOf(t)>-1&&(n&&this.queueList[t].downloaded++,a&&(this.queueList[t].failed++,1==this.queueList[t].failed&&Ao("#download_"+t+" .queue_failed").length,this.queueList[t].errors.push({message:s,data:o,errid:l})),i&&(this.queueList[t].progress=i),r&&(this.queueList[t].conversion=r))},removeFromQueue(e){console.log("this.removeFromQueue");let t=this.queue.indexOf(e);t>-1&&(this.$delete(this.queue,t),this.$delete(this.queueList,e))},removeAllDownloads(e){if(console.log("this.removeFromQueue",e),this.queueComplete=[],e){this.queue=[e];let t=this.queueList[e];this.queueList={},this.queueList[e]=t}else this.queue=[],this.queueList={}},removedFinishedDownloads(){console.log("this.removedFinishedDownloads"),this.queueComplete.forEach(e=>{this.$delete(this.queueList,e)}),this.queueComplete=[]},toggleDownloadTab(e){this.setTabWidth(),this.$refs.container.style.transition="all 250ms ease-in-out";let t=this.$refs.container.classList.toggle("tab_hidden");t||this.setTabWidth(this.cachedTabWidth),localStorage.setItem("downloadTabOpen",!t)},cleanQueue(){console.log("this.cleanQueue"),ml.emit("removeFinishedDownloads")},cancelQueue(){console.log("this.cancelQueue"),ml.emit("cancelAllDownloads")},openDownloadsFolder(){ml.emit("openDownloadsFolder")},handleDrag(e){let t=window.innerWidth-e.pageX+2;t<250?t=250:t>500&&(t=500),this.cachedTabWidth=t,this.setTabWidth(t)},startDrag(){document.addEventListener("mousemove",this.handleDrag)},startDownload(e){console.log("this.startDownload"),this.$set(this.queueList[e],"status","downloading")},finishDownload(e){if(console.log("this.finishDownload"),!(this.queue.indexOf(e)>-1))return;this.$set(this.queueList[e],"status","download finished"),Ml(this.$t("toasts.finishDownload",{item:this.queueList[e].title}),"done");let t=this.queue.indexOf(e);t>-1&&(this.queue.splice(t,1),this.queueComplete.push(e)),this.queue.length<=0&&Ml(this.$t("toasts.allDownloaded"),"done_all")},startConversion(e){console.log("this.startConversion"),this.$set(this.queueList[e],"status","converting"),this.$set(this.queueList[e],"conversion",0)},async showErrorsTab(e){await this.setErrors(e),this.$router.push({name:"Errors"})}}};var Nl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"container",staticClass:"tab_hidden",attrs:{id:"download_tab_container","data-label":e.$t("downloads")},on:{transitionend:function(t){e.$refs.container.style.transition=""}}},[n("div",{ref:"dragHandler",attrs:{id:"download_tab_drag_handler"},on:{mousedown:function(t){return t.preventDefault(),e.startDrag(t)}}}),e._v(" "),n("i",{ref:"toggler",staticClass:"material-icons download_bar_icon",attrs:{id:"toggle_download_tab",title:e.$t("globals.toggle_download_tab_hint")},on:{click:function(t){return t.preventDefault(),e.toggleDownloadTab(t)}}}),e._v(" "),n("div",{attrs:{id:"queue_buttons"}},[e.clientMode?n("i",{staticClass:"material-icons download_bar_icon",attrs:{id:"open_downloads_folder",title:e.$t("globals.open_downloads_folder")},on:{click:e.openDownloadsFolder}},[e._v("\n\t\t\tfolder_open\n\t\t")]):e._e(),e._v(" "),n("i",{staticClass:"material-icons download_bar_icon",attrs:{id:"clean_queue",title:e.$t("globals.clean_queue_hint")},on:{click:e.cleanQueue}},[e._v("\n\t\t\tclear_all\n\t\t")]),e._v(" "),n("i",{staticClass:"material-icons download_bar_icon",attrs:{id:"cancel_queue",title:e.$t("globals.cancel_queue_hint")},on:{click:e.cancelQueue}},[e._v("\n\t\t\tdelete_sweep\n\t\t")])]),e._v(" "),n("div",{ref:"list",attrs:{id:"download_list"},on:{click:e.handleListClick}},e._l(e.queueList,(function(t){return n("QueueItem",{key:t.uuid,attrs:{"queue-item":t},on:{"show-errors":e.showErrorsTab,"remove-item":e.onRemoveItem}})})),1)])};Nl._withStripped=!0;var $l=function(e,t,n,a,i,r,s,o){const l=("function"==typeof n?n.options:n)||{};l.__file="C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui\\src\\components\\TheDownloadTab.vue",l.render||(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=a;{let e;if(t&&(e=function(e){t.call(this,s(e))}),void 0!==e)if(l.functional){const t=l.render;l.render=function(n,a){return e.call(a),t(n,a)}}else{const t=l.beforeCreate;l.beforeCreate=t?[].concat(t,e):[e]}}return l}({render:Nl,staticRenderFns:[]},(function(e){e&&e("data-v-60e771d6_0",{source:"#download_tab_container[data-v-60e771d6] {\n height: 100vh;\n}\n\n/*# sourceMappingURL=TheDownloadTab.vue.map */",map:{version:3,sources:["C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui/C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui/C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui\\src\\components\\TheDownloadTab.vue","TheDownloadTab.vue"],names:[],mappings:"AAwDA;EACA,aAAA;AAAA;;ACtDA,6CAA6C",file:"TheDownloadTab.vue",sourcesContent:[null,"#download_tab_container {\n height: 100vh; }\n\n/*# sourceMappingURL=TheDownloadTab.vue.map */"]},media:void 0})}),Dl,"data-v-60e771d6",!1,0,(function e(){const t=document.head||document.getElementsByTagName("head")[0],n=e.styles||(e.styles={}),a="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(e,i){if(document.querySelector('style[data-vue-ssr-id~="'+e+'"]'))return;const r=a?i.media||"default":e,s=n[r]||(n[r]={ids:[],parts:[],element:void 0});if(!s.ids.includes(e)){let n=i.source,o=s.ids.length;if(s.ids.push(e),a&&(s.element=s.element||document.querySelector("style[data-group="+r+"]")),!s.element){const e=s.element=document.createElement("style");e.type="text/css",i.media&&e.setAttribute("media",i.media),a&&(e.setAttribute("data-group",r),e.setAttribute("data-next-index","0")),t.appendChild(e)}if(a&&(o=parseInt(s.element.getAttribute("data-next-index")),s.element.setAttribute("data-next-index",o+1)),s.element.styleSheet)s.parts.push(n),s.element.styleSheet.cssText=s.parts.filter(Boolean).join("\n");else{const e=document.createTextNode(n),t=s.element.childNodes;t[o]&&s.element.removeChild(t[o]),t.length?s.element.insertBefore(e,t[o]):s.element.appendChild(e)}}}}));const Pl={data:()=>({lastTextSearch:""}),mounted(){document.addEventListener("keyup",e=>{"Backspace"==e.key&&e.ctrlKey&&(this.$refs.searchbar.value="",this.$refs.searchbar.focus())})},methods:{test(){console.log("test passato")},async handleSearchBarKeyup(e){if(!(13===e.keyCode))return;let t=this.$refs.searchbar.value;if(""===t)return;let n=ao(t),a=e.ctrlKey,i="Link Analyzer"===this.$route.name,r="Search"===this.$route.name,s=t===this.lastTextSearch;if(n)a?this.$root.$emit("QualityModal:open",t):i?ml.emit("analyzeLink",t):gl.sendAddToQueue(t);else{if(r&&s)return;r||await this.$router.push({name:"Search"}),s||(this.$root.$emit("updateSearchLoadingState",!0),this.lastTextSearch=t),this.$root.$emit("mainSearch:showNewResults",t,window.main_selected)}}}};var Ll=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("header",{attrs:{id:"search"}},[e._m(0),e._v(" "),n("input",{ref:"searchbar",attrs:{id:"searchbar",autocomplete:"off",type:"search",name:"searchbar",value:"",placeholder:e.$t("searchbar"),autofocus:""},on:{keyup:function(t){return e.handleSearchBarKeyup(t)}}})])};Ll._withStripped=!0;const Rl={components:{TheSidebar:no,TheSearchBar:function(e,t,n,a,i,r,s,o){const l=("function"==typeof n?n.options:n)||{};l.__file="C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui\\src\\components\\TheSearchBar.vue",l.render||(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=a;{let e;if(t&&(e=function(e){t.call(this,s(e))}),void 0!==e)if(l.functional){const t=l.render;l.render=function(n,a){return e.call(a),t(n,a)}}else{const t=l.beforeCreate;l.beforeCreate=t?[].concat(t,e):[e]}}return l}({render:Ll,staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"search__icon"},[t("i",{staticClass:"material-icons"},[this._v("search")])])}]},(function(e){e&&e("data-v-051d26de_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"TheSearchBar.vue"},media:void 0})}),Pl,void 0,!1,0,(function e(){const t=document.head||document.getElementsByTagName("head")[0],n=e.styles||(e.styles={}),a="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(e,i){if(document.querySelector('style[data-vue-ssr-id~="'+e+'"]'))return;const r=a?i.media||"default":e,s=n[r]||(n[r]={ids:[],parts:[],element:void 0});if(!s.ids.includes(e)){let n=i.source,o=s.ids.length;if(s.ids.push(e),a&&(s.element=s.element||document.querySelector("style[data-group="+r+"]")),!s.element){const e=s.element=document.createElement("style");e.type="text/css",i.media&&e.setAttribute("media",i.media),a&&(e.setAttribute("data-group",r),e.setAttribute("data-next-index","0")),t.appendChild(e)}if(a&&(o=parseInt(s.element.getAttribute("data-next-index")),s.element.setAttribute("data-next-index",o+1)),s.element.styleSheet)s.parts.push(n),s.element.styleSheet.cssText=s.parts.filter(Boolean).join("\n");else{const e=document.createTextNode(n),t=s.element.childNodes;t[o]&&s.element.removeChild(t[o]),t.length?s.element.insertBefore(e,t[o]):s.element.appendChild(e)}}}})),TheMiddleSection:yo,TheDownloadTab:$l,TheTrackPreview:xo,TheQualityModal:yl,BaseLoadingPlaceholder:mo,TheContextMenu:wl}};var El=function(){var e=this.$createElement,t=this._self._c||e;return t("div",[t("TheSidebar"),this._v(" "),t("div",{staticClass:"app-container"},[t("div",{staticClass:"content-container"},[t("TheSearchBar"),this._v(" "),t("TheMiddleSection")],1),this._v(" "),t("TheDownloadTab",{staticClass:"downlaods"})],1),this._v(" "),t("BaseLoadingPlaceholder",{attrs:{id:"start_app_placeholder",text:"Connecting to the server..."}}),this._v(" "),t("TheTrackPreview"),this._v(" "),t("TheQualityModal"),this._v(" "),t("TheContextMenu")],1)};El._withStripped=!0;var Il=function(e,t,n,a,i,r,s,o){const l=("function"==typeof n?n.options:n)||{};l.__file="C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui\\src\\components\\App.vue",l.render||(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=a;{let e;if(t&&(e=function(e){t.call(this,s(e))}),void 0!==e)if(l.functional){const t=l.render;l.render=function(n,a){return e.call(a),t(n,a)}}else{const t=l.beforeCreate;l.beforeCreate=t?[].concat(t,e):[e]}}return l}({render:El,staticRenderFns:[]},(function(e){e&&e("data-v-614d1016_0",{source:".app-container {\n display: flex;\n}\n.content-container {\n width: 100%;\n display: flex;\n flex-direction: column;\n margin-left: 48px;\n}\n.downlaods {\n flex-basis: 32px;\n}\n\n/*# sourceMappingURL=App.vue.map */",map:{version:3,sources:["C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui/C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui/C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui\\src\\components\\App.vue","App.vue"],names:[],mappings:"AAsBA;EACA,aAAA;AAAA;AAGA;EACA,WAAA;EACA,aAAA;EACA,sBAAA;EACA,iBAAA;AAAA;AAGA;EACA,gBAAA;AAAA;;ACtBA,kCAAkC",file:"App.vue",sourcesContent:[null,".app-container {\n display: flex; }\n\n.content-container {\n width: 100%;\n display: flex;\n flex-direction: column;\n margin-left: 48px; }\n\n.downlaods {\n flex-basis: 32px; }\n\n/*# sourceMappingURL=App.vue.map */"]},media:void 0})}),Rl,void 0,!1,0,(function e(){const t=document.head||document.getElementsByTagName("head")[0],n=e.styles||(e.styles={}),a="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(e,i){if(document.querySelector('style[data-vue-ssr-id~="'+e+'"]'))return;const r=a?i.media||"default":e,s=n[r]||(n[r]={ids:[],parts:[],element:void 0});if(!s.ids.includes(e)){let n=i.source,o=s.ids.length;if(s.ids.push(e),a&&(s.element=s.element||document.querySelector("style[data-group="+r+"]")),!s.element){const e=s.element=document.createElement("style");e.type="text/css",i.media&&e.setAttribute("media",i.media),a&&(e.setAttribute("data-group",r),e.setAttribute("data-next-index","0")),t.appendChild(e)}if(a&&(o=parseInt(s.element.getAttribute("data-next-index")),s.element.setAttribute("data-next-index",o+1)),s.element.styleSheet)s.parts.push(n),s.element.styleSheet.cssText=s.parts.filter(Boolean).join("\n");else{const e=document.createTextNode(n),t=s.element.childNodes;t[o]&&s.element.removeChild(t[o]),t.length?s.element.insertBefore(e,t[o]):s.element.appendChild(e)}}}})),jl=["style","currency","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","localeMatcher","formatMatcher","unit"]; +!function(t,n){e.exports?e.exports=n():t.Toastify=n()}(_o,(function(e){var t=function(e){return new t.lib.init(e)};function n(e,t){return!(!e||"string"!=typeof t)&&!!(e.className&&e.className.trim().split(/\s+/gi).indexOf(t)>-1)}return t.lib=t.prototype={toastify:"1.8.0",constructor:t,init:function(e){return e||(e={}),this.options={},this.toastElement=null,this.options.text=e.text||"Hi there!",this.options.node=e.node,this.options.duration=0===e.duration?0:e.duration||3e3,this.options.selector=e.selector,this.options.callback=e.callback||function(){},this.options.destination=e.destination,this.options.newWindow=e.newWindow||!1,this.options.close=e.close||!1,this.options.gravity="bottom"===e.gravity?"toastify-bottom":"toastify-top",this.options.positionLeft=e.positionLeft||!1,this.options.position=e.position||"",this.options.backgroundColor=e.backgroundColor,this.options.avatar=e.avatar||"",this.options.className=e.className||"",this.options.stopOnFocus=void 0===e.stopOnFocus||e.stopOnFocus,this.options.onClick=e.onClick,this},buildToast:function(){if(!this.options)throw"Toastify is not initialized";var e=document.createElement("div");if(e.className="toastify on "+this.options.className,this.options.position?e.className+=" toastify-"+this.options.position:!0===this.options.positionLeft?(e.className+=" toastify-left",console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):e.className+=" toastify-right",e.className+=" "+this.options.gravity,this.options.backgroundColor&&(e.style.background=this.options.backgroundColor),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)e.appendChild(this.options.node);else if(e.innerHTML=this.options.text,""!==this.options.avatar){var t=document.createElement("img");t.src=this.options.avatar,t.className="toastify-avatar","left"==this.options.position||!0===this.options.positionLeft?e.appendChild(t):e.insertAdjacentElement("beforeend",t)}if(!0===this.options.close){var n=document.createElement("span");n.innerHTML="✖",n.className="toast-close",n.addEventListener("click",function(e){e.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}.bind(this));var a=window.innerWidth>0?window.innerWidth:screen.width;("left"==this.options.position||!0===this.options.positionLeft)&&a>360?e.insertAdjacentElement("afterbegin",n):e.appendChild(n)}if(this.options.stopOnFocus&&this.options.duration>0){const t=this;e.addEventListener("mouseover",(function(t){window.clearTimeout(e.timeOutValue)})),e.addEventListener("mouseleave",(function(){e.timeOutValue=window.setTimeout((function(){t.removeElement(e)}),t.options.duration)}))}return void 0!==this.options.destination&&e.addEventListener("click",function(e){e.stopPropagation(),!0===this.options.newWindow?window.open(this.options.destination,"_blank"):window.location=this.options.destination}.bind(this)),"function"==typeof this.options.onClick&&void 0===this.options.destination&&e.addEventListener("click",function(e){e.stopPropagation(),this.options.onClick()}.bind(this)),e},showToast:function(){var e;if(this.toastElement=this.buildToast(),!(e=void 0===this.options.selector?document.body:document.getElementById(this.options.selector)))throw"Root element is not defined";return e.insertBefore(this.toastElement,e.firstChild),t.reposition(),this.options.duration>0&&(this.toastElement.timeOutValue=window.setTimeout(function(){this.removeElement(this.toastElement)}.bind(this),this.options.duration)),this},hideToast:function(){this.toastElement.timeOutValue&&clearTimeout(this.toastElement.timeOutValue),this.removeElement(this.toastElement)},removeElement:function(e){e.className=e.className.replace(" on",""),window.setTimeout(function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),e.parentNode&&e.parentNode.removeChild(e),this.options.callback.call(e),t.reposition()}.bind(this),400)}},t.reposition=function(){for(var e,t={top:15,bottom:15},a={top:15,bottom:15},i={top:15,bottom:15},r=document.getElementsByClassName("toastify"),s=0;s0?window.innerWidth:screen.width)<=360?(r[s].style[e]=i[e]+"px",i[e]+=o+15):!0===n(r[s],"toastify-left")?(r[s].style[e]=t[e]+"px",t[e]+=o+15):(r[s].style[e]=a[e]+"px",a[e]+=o+15)}return this},t.lib.init.prototype=t.lib,t}))}));let zl={};const Ml=function(e,t=null,n=!0,a=null){if(zl[a]){let i=zl[a],r=Ao(`div.toastify[toast_id=${a}]`);e&&r.find(".toast-message").html(e),t&&(t="loading"==t?'
':`${t}`,r.find(".toast-icon").html(t)),null!==n&&n&&(r.addClass("dismissable"),setTimeout((function(){i.hideToast(),delete zl[a]}),3e3))}else{let i=Sl({text:`${t=null==t?"":"loading"==t?'
':`${t}`}
${e}`,duration:n?3e3:0,gravity:"bottom",position:"left",className:n?"dismissable":"",onClick:function(){let e=!0;if(a){let t=document.querySelector(`div.toastify[toast_id=${a}]`).classList;t&&(e=-1!=Array.from(t).indexOf("dismissable"))}i&&e&&(i.hideToast(),a&&delete zl[a])}}).showToast();a&&(zl[a]=i,Ao(i.toastElement).attr("toast_id",a))}};ml.on("toast",e=>{const{msg:t,icon:n,dismiss:a,id:i}=e;Ml(t,n||null,void 0===a||a,i||null)});const Dl={components:{QueueItem:Tl},data:()=>({cachedTabWidth:parseInt(localStorage.getItem("downloadTabWidth"))||300,queue:[],queueList:{},queueComplete:[],clientMode:window.clientMode}),mounted(){ml.on("startDownload",this.startDownload),ml.on("startConversion",this.startConversion),ml.on("init_downloadQueue",this.initQueue),ml.on("addedToQueue",this.addToQueue),ml.on("updateQueue",this.updateQueue),ml.on("removedFromQueue",this.removeFromQueue),ml.on("finishDownload",this.finishDownload),ml.on("removedAllDownloads",this.removeAllDownloads),ml.on("removedFinishedDownloads",this.removedFinishedDownloads),"true"===localStorage.getItem("slimDownloads")&&this.$refs.list.classList.add("slim"),"true"===localStorage.getItem("downloadTabOpen")&&(this.$refs.container.classList.remove("tab_hidden"),this.setTabWidth(this.cachedTabWidth)),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",this.handleDrag)}),window.addEventListener("beforeunload",()=>{localStorage.setItem("downloadTabWidth",this.cachedTabWidth)})},methods:{...Go(["setErrors"]),onRemoveItem(e){ml.emit("removeFromQueue",e)},setTabWidth(e){void 0===e?(this.$refs.container.style.width="",this.$refs.list.style.width=""):(this.$refs.container.style.width=e+"px",this.$refs.list.style.width=e+"px")},initQueue(e){console.log("this.initQueue");const{queue:t,queueComplete:n,currentItem:a,queueList:i,restored:r}=e;n.length&&n.forEach(e=>{i[e].silent=!0,this.addToQueue(i[e])}),a&&(i[a].silent=!0,this.addToQueue(i[a],!0)),t.forEach(e=>{i[e].silent=!0,this.addToQueue(i[e])}),r&&(Ml(this.$t("toasts.queueRestored"),"done",!0,"restoring_queue"),ml.emit("queueRestored"))},addToQueue(e,t=!1){if(console.log("this.addToQueue"),Array.isArray(e)){if(e.length>1)return e.forEach((e,t)=>{e.silent=!0,this.addToQueue(e)}),void Ml(this.$t("toasts.addedMoreToQueue",{n:e.length}),"playlist_add_check");e=e[0]}this.$set(e,"current",t),this.$set(this.queueList,e.uuid,e);if(e.downloaded+e.failed==e.size){const t=-1==this.queueComplete.indexOf(e.uuid);this.$set(this.queueList[e.uuid],"status","download finished"),t&&this.queueComplete.push(e.uuid)}else{-1==this.queue.indexOf(e.uuid)&&this.queue.push(e.uuid)}(e.progress>0&&e.progress<100||t)&&this.startDownload(e.uuid),e.silent||Ml(this.$t("toasts.addedToQueue",{item:e.title}),"playlist_add_check")},updateQueue(e){const{uuid:t,downloaded:n,failed:a,progress:i,conversion:r,error:s,data:o,errid:l}=e;console.log("this.updateQueue",!!this.queueList[t]),t&&this.queue.indexOf(t)>-1&&(n&&this.queueList[t].downloaded++,a&&(this.queueList[t].failed++,this.queueList[t].errors.push({message:s,data:o,errid:l})),i&&(this.queueList[t].progress=i),r&&(this.queueList[t].conversion=r))},removeFromQueue(e){console.log("this.removeFromQueue");let t=this.queue.indexOf(e);t>-1&&(this.$delete(this.queue,t),this.$delete(this.queueList,e))},removeAllDownloads(e){if(console.log("this.removeFromQueue",e),this.queueComplete=[],e){this.queue=[e];let t=this.queueList[e];this.queueList={},this.queueList[e]=t}else this.queue=[],this.queueList={}},removedFinishedDownloads(){console.log("this.removedFinishedDownloads"),this.queueComplete.forEach(e=>{this.$delete(this.queueList,e)}),this.queueComplete=[]},toggleDownloadTab(e){this.setTabWidth(),this.$refs.container.style.transition="all 250ms ease-in-out";let t=this.$refs.container.classList.toggle("tab_hidden");t||this.setTabWidth(this.cachedTabWidth),localStorage.setItem("downloadTabOpen",!t)},cleanQueue(){console.log("this.cleanQueue"),ml.emit("removeFinishedDownloads")},cancelQueue(){console.log("this.cancelQueue"),ml.emit("cancelAllDownloads")},openDownloadsFolder(){ml.emit("openDownloadsFolder")},handleDrag(e){let t=window.innerWidth-e.pageX+2;t<250?t=250:t>500&&(t=500),this.cachedTabWidth=t,this.setTabWidth(t)},startDrag(){document.addEventListener("mousemove",this.handleDrag)},startDownload(e){console.log("this.startDownload"),this.$set(this.queueList[e],"status","downloading")},finishDownload(e){if(console.log("this.finishDownload"),!(this.queue.indexOf(e)>-1))return;this.$set(this.queueList[e],"status","download finished"),Ml(this.$t("toasts.finishDownload",{item:this.queueList[e].title}),"done");let t=this.queue.indexOf(e);t>-1&&(this.queue.splice(t,1),this.queueComplete.push(e)),this.queue.length<=0&&Ml(this.$t("toasts.allDownloaded"),"done_all")},startConversion(e){console.log("this.startConversion"),this.$set(this.queueList[e],"status","converting"),this.$set(this.queueList[e],"conversion",0)},async showErrorsTab(e){await this.setErrors(e),this.$router.push({name:"Errors"})}}};var Nl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"container",staticClass:"tab_hidden",attrs:{id:"download_tab_container","data-label":e.$t("downloads")},on:{transitionend:function(t){e.$refs.container.style.transition=""}}},[n("div",{ref:"dragHandler",attrs:{id:"download_tab_drag_handler"},on:{mousedown:function(t){return t.preventDefault(),e.startDrag(t)}}}),e._v(" "),n("i",{ref:"toggler",staticClass:"material-icons download_bar_icon",attrs:{id:"toggle_download_tab",title:e.$t("globals.toggle_download_tab_hint")},on:{click:function(t){return t.preventDefault(),e.toggleDownloadTab(t)}}}),e._v(" "),n("div",{attrs:{id:"queue_buttons"}},[e.clientMode?n("i",{staticClass:"material-icons download_bar_icon",attrs:{id:"open_downloads_folder",title:e.$t("globals.open_downloads_folder")},on:{click:e.openDownloadsFolder}},[e._v("\n\t\t\tfolder_open\n\t\t")]):e._e(),e._v(" "),n("i",{staticClass:"material-icons download_bar_icon",attrs:{id:"clean_queue",title:e.$t("globals.clean_queue_hint")},on:{click:e.cleanQueue}},[e._v("\n\t\t\tclear_all\n\t\t")]),e._v(" "),n("i",{staticClass:"material-icons download_bar_icon",attrs:{id:"cancel_queue",title:e.$t("globals.cancel_queue_hint")},on:{click:e.cancelQueue}},[e._v("\n\t\t\tdelete_sweep\n\t\t")])]),e._v(" "),n("div",{ref:"list",attrs:{id:"download_list"}},e._l(e.queueList,(function(t){return n("QueueItem",{key:t.uuid,attrs:{"queue-item":t},on:{"show-errors":e.showErrorsTab,"remove-item":e.onRemoveItem}})})),1)])};Nl._withStripped=!0;var $l=function(e,t,n,a,i,r,s,o){const l=("function"==typeof n?n.options:n)||{};l.__file="C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui\\src\\components\\TheDownloadTab.vue",l.render||(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=a;{let e;if(t&&(e=function(e){t.call(this,s(e))}),void 0!==e)if(l.functional){const t=l.render;l.render=function(n,a){return e.call(a),t(n,a)}}else{const t=l.beforeCreate;l.beforeCreate=t?[].concat(t,e):[e]}}return l}({render:Nl,staticRenderFns:[]},(function(e){e&&e("data-v-ce06a738_0",{source:"#download_tab_container[data-v-ce06a738] {\n height: 100vh;\n}\n\n/*# sourceMappingURL=TheDownloadTab.vue.map */",map:{version:3,sources:["C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui/C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui/C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui\\src\\components\\TheDownloadTab.vue","TheDownloadTab.vue"],names:[],mappings:"AAwDA;EACA,aAAA;AAAA;;ACtDA,6CAA6C",file:"TheDownloadTab.vue",sourcesContent:[null,"#download_tab_container {\n height: 100vh; }\n\n/*# sourceMappingURL=TheDownloadTab.vue.map */"]},media:void 0})}),Dl,"data-v-ce06a738",!1,0,(function e(){const t=document.head||document.getElementsByTagName("head")[0],n=e.styles||(e.styles={}),a="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(e,i){if(document.querySelector('style[data-vue-ssr-id~="'+e+'"]'))return;const r=a?i.media||"default":e,s=n[r]||(n[r]={ids:[],parts:[],element:void 0});if(!s.ids.includes(e)){let n=i.source,o=s.ids.length;if(s.ids.push(e),a&&(s.element=s.element||document.querySelector("style[data-group="+r+"]")),!s.element){const e=s.element=document.createElement("style");e.type="text/css",i.media&&e.setAttribute("media",i.media),a&&(e.setAttribute("data-group",r),e.setAttribute("data-next-index","0")),t.appendChild(e)}if(a&&(o=parseInt(s.element.getAttribute("data-next-index")),s.element.setAttribute("data-next-index",o+1)),s.element.styleSheet)s.parts.push(n),s.element.styleSheet.cssText=s.parts.filter(Boolean).join("\n");else{const e=document.createTextNode(n),t=s.element.childNodes;t[o]&&s.element.removeChild(t[o]),t.length?s.element.insertBefore(e,t[o]):s.element.appendChild(e)}}}}));const Pl={data:()=>({lastTextSearch:""}),mounted(){document.addEventListener("keyup",e=>{"Backspace"==e.key&&e.ctrlKey&&(this.$refs.searchbar.value="",this.$refs.searchbar.focus())})},methods:{test(){console.log("test passato")},async handleSearchBarKeyup(e){if(!(13===e.keyCode))return;let t=this.$refs.searchbar.value;if(""===t)return;let n=ao(t),a=e.ctrlKey,i="Link Analyzer"===this.$route.name,r="Search"===this.$route.name,s=t===this.lastTextSearch;if(n)a?this.$root.$emit("QualityModal:open",t):i?ml.emit("analyzeLink",t):gl.sendAddToQueue(t);else{if(r&&s)return;r||await this.$router.push({name:"Search"}),s||(this.$root.$emit("updateSearchLoadingState",!0),this.lastTextSearch=t),this.$root.$emit("mainSearch:showNewResults",t,window.main_selected)}}}};var Ll=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("header",{attrs:{id:"search"}},[e._m(0),e._v(" "),n("input",{ref:"searchbar",attrs:{id:"searchbar",autocomplete:"off",type:"search",name:"searchbar",value:"",placeholder:e.$t("searchbar"),autofocus:""},on:{keyup:function(t){return e.handleSearchBarKeyup(t)}}})])};Ll._withStripped=!0;const Rl={components:{TheSidebar:no,TheSearchBar:function(e,t,n,a,i,r,s,o){const l=("function"==typeof n?n.options:n)||{};l.__file="C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui\\src\\components\\TheSearchBar.vue",l.render||(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=a;{let e;if(t&&(e=function(e){t.call(this,s(e))}),void 0!==e)if(l.functional){const t=l.render;l.render=function(n,a){return e.call(a),t(n,a)}}else{const t=l.beforeCreate;l.beforeCreate=t?[].concat(t,e):[e]}}return l}({render:Ll,staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"search__icon"},[t("i",{staticClass:"material-icons"},[this._v("search")])])}]},(function(e){e&&e("data-v-051d26de_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"TheSearchBar.vue"},media:void 0})}),Pl,void 0,!1,0,(function e(){const t=document.head||document.getElementsByTagName("head")[0],n=e.styles||(e.styles={}),a="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(e,i){if(document.querySelector('style[data-vue-ssr-id~="'+e+'"]'))return;const r=a?i.media||"default":e,s=n[r]||(n[r]={ids:[],parts:[],element:void 0});if(!s.ids.includes(e)){let n=i.source,o=s.ids.length;if(s.ids.push(e),a&&(s.element=s.element||document.querySelector("style[data-group="+r+"]")),!s.element){const e=s.element=document.createElement("style");e.type="text/css",i.media&&e.setAttribute("media",i.media),a&&(e.setAttribute("data-group",r),e.setAttribute("data-next-index","0")),t.appendChild(e)}if(a&&(o=parseInt(s.element.getAttribute("data-next-index")),s.element.setAttribute("data-next-index",o+1)),s.element.styleSheet)s.parts.push(n),s.element.styleSheet.cssText=s.parts.filter(Boolean).join("\n");else{const e=document.createTextNode(n),t=s.element.childNodes;t[o]&&s.element.removeChild(t[o]),t.length?s.element.insertBefore(e,t[o]):s.element.appendChild(e)}}}})),TheMiddleSection:yo,TheDownloadTab:$l,TheTrackPreview:xo,TheQualityModal:yl,BaseLoadingPlaceholder:mo,TheContextMenu:wl}};var El=function(){var e=this.$createElement,t=this._self._c||e;return t("div",[t("TheSidebar"),this._v(" "),t("div",{staticClass:"app-container"},[t("div",{staticClass:"content-container"},[t("TheSearchBar"),this._v(" "),t("TheMiddleSection")],1),this._v(" "),t("TheDownloadTab",{staticClass:"downlaods"})],1),this._v(" "),t("BaseLoadingPlaceholder",{attrs:{id:"start_app_placeholder",text:"Connecting to the server..."}}),this._v(" "),t("TheTrackPreview"),this._v(" "),t("TheQualityModal"),this._v(" "),t("TheContextMenu")],1)};El._withStripped=!0;var Il=function(e,t,n,a,i,r,s,o){const l=("function"==typeof n?n.options:n)||{};l.__file="C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui\\src\\components\\App.vue",l.render||(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=a;{let e;if(t&&(e=function(e){t.call(this,s(e))}),void 0!==e)if(l.functional){const t=l.render;l.render=function(n,a){return e.call(a),t(n,a)}}else{const t=l.beforeCreate;l.beforeCreate=t?[].concat(t,e):[e]}}return l}({render:El,staticRenderFns:[]},(function(e){e&&e("data-v-614d1016_0",{source:".app-container {\n display: flex;\n}\n.content-container {\n width: 100%;\n display: flex;\n flex-direction: column;\n margin-left: 48px;\n}\n.downlaods {\n flex-basis: 32px;\n}\n\n/*# sourceMappingURL=App.vue.map */",map:{version:3,sources:["C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui/C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui/C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui\\src\\components\\App.vue","App.vue"],names:[],mappings:"AAsBA;EACA,aAAA;AAAA;AAGA;EACA,WAAA;EACA,aAAA;EACA,sBAAA;EACA,iBAAA;AAAA;AAGA;EACA,gBAAA;AAAA;;ACtBA,kCAAkC",file:"App.vue",sourcesContent:[null,".app-container {\n display: flex; }\n\n.content-container {\n width: 100%;\n display: flex;\n flex-direction: column;\n margin-left: 48px; }\n\n.downlaods {\n flex-basis: 32px; }\n\n/*# sourceMappingURL=App.vue.map */"]},media:void 0})}),Rl,void 0,!1,0,(function e(){const t=document.head||document.getElementsByTagName("head")[0],n=e.styles||(e.styles={}),a="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(e,i){if(document.querySelector('style[data-vue-ssr-id~="'+e+'"]'))return;const r=a?i.media||"default":e,s=n[r]||(n[r]={ids:[],parts:[],element:void 0});if(!s.ids.includes(e)){let n=i.source,o=s.ids.length;if(s.ids.push(e),a&&(s.element=s.element||document.querySelector("style[data-group="+r+"]")),!s.element){const e=s.element=document.createElement("style");e.type="text/css",i.media&&e.setAttribute("media",i.media),a&&(e.setAttribute("data-group",r),e.setAttribute("data-next-index","0")),t.appendChild(e)}if(a&&(o=parseInt(s.element.getAttribute("data-next-index")),s.element.setAttribute("data-next-index",o+1)),s.element.styleSheet)s.parts.push(n),s.element.styleSheet.cssText=s.parts.filter(Boolean).join("\n");else{const e=document.createTextNode(n),t=s.element.childNodes;t[o]&&s.element.removeChild(t[o]),t.length?s.element.insertBefore(e,t[o]):s.element.appendChild(e)}}}})),jl=["style","currency","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","localeMatcher","formatMatcher","unit"]; /*! * vue-i18n v8.18.2 * (c) 2020 kazuya kawaguchi diff --git a/src/components/TheDownloadTab.vue b/src/components/TheDownloadTab.vue index 89d18bc..5ed4d7c 100644 --- a/src/components/TheDownloadTab.vue +++ b/src/components/TheDownloadTab.vue @@ -41,7 +41,7 @@ delete_sweep -
+
` - } }, setTabWidth(newWidth) { if (undefined === newWidth) { @@ -133,31 +126,6 @@ export default { this.$refs.list.style.width = newWidth + 'px' } }, - handleListClick(event) { - console.log('this.handleListClick') - return - const { target } = event - - if (!target.matches('.queue_icon[data-uuid]')) { - return - } - - let icon = target.innerText - let uuid = $(target).data('uuid') - - switch (icon) { - case 'remove': - socket.emit('removeFromQueue', uuid) - - if ($(`#bar_${uuid}`).hasClass('indeterminate')) { - // $(`#download_${uuid}`).remove() - } else { - target.innerHTML = `
` - } - break - default: - } - }, initQueue(data) { console.log('this.initQueue') const { @@ -208,7 +176,6 @@ export default { // * Here we have only queueItem objects this.$set(queueItem, 'current', current) this.$set(this.queueList, queueItem.uuid, queueItem) - // this.queueList[queueItem.uuid] = queueItem // * Used when opening the app in another tab const itemIsAlreadyDownloaded = queueItem.downloaded + queueItem.failed == queueItem.size @@ -230,53 +197,12 @@ export default { } } - // let queueDOM = document.getElementById('download_' + queueItem.uuid) - // let noItemInQueueDOM = typeof queueDOM == 'undefined' || queueDOM == null - - // if (noItemInQueueDOM) { - // this.appendItem(queueItem) - // } - const needToStartDownload = (queueItem.progress > 0 && queueItem.progress < 100) || current if (needToStartDownload) { this.startDownload(queueItem.uuid) } - // * Setting progress - // $('#bar_' + queueItem.uuid).css('width', queueItem.progress + '%') - - // const needToAddFailedIndicator = - // queueItem.failed >= 1 && $('#download_' + queueItem.uuid + ' .queue_failed').length == 0 - - // if (needToAddFailedIndicator) { - // $('#download_' + queueItem.uuid + ' .download_info_status').append( - // `(${queueItem.failed}error_outline)` - // ) - // } - - if (queueItem.downloaded + queueItem.failed == queueItem.size) { - // let resultIcon = $('#download_' + queueItem.uuid).find('.queue_icon') - - if (queueItem.failed == 0) { - // resultIcon.text('done') - } else { - // let failedButton = $('#download_' + queueItem.uuid).find('.queue_failed_button') - - // ! resultIcon.addClass('clickable') - // ! failedButton.addClass('clickable') - - // ! resultIcon.bind('click', { item: queueItem }, this.showErrorsTab) - // ! failedButton.bind('click', { item: queueItem }, this.showErrorsTab) - - if (queueItem.failed >= queueItem.size) { - // resultIcon.text('error') - } else { - // resultIcon.text('warning') - } - } - } - if (!queueItem.silent) { toast(this.$t('toasts.addedToQueue', { item: queueItem.title }), 'playlist_add_check') } @@ -289,38 +215,19 @@ export default { if (uuid && this.queue.indexOf(uuid) > -1) { if (downloaded) { this.queueList[uuid].downloaded++ - - // $('#download_' + uuid + ' .queue_downloaded').text( - // this.queueList[uuid].downloaded + this.queueList[uuid].failed - // ) } if (failed) { this.queueList[uuid].failed++ - - // $('#download_' + uuid + ' .queue_downloaded').text( - // this.queueList[uuid].downloaded + this.queueList[uuid].failed - // ) - - if (this.queueList[uuid].failed == 1 && $('#download_' + uuid + ' .queue_failed').length == 0) { - // $('#download_' + uuid + ' .download_info_status').append( - // `(1 error_outline)` - // ) - } else { - // $('#download_' + uuid + ' .queue_failed').text(this.queueList[uuid].failed) - } - this.queueList[uuid].errors.push({ message: error, data: data, errid: errid }) } if (progress) { this.queueList[uuid].progress = progress - // $('#bar_' + uuid).css('width', progress + '%') } if (conversion) { this.queueList[uuid].conversion = conversion - // $('#bar_' + uuid).css('width', 100 - conversion + '%') } } }, @@ -331,21 +238,15 @@ export default { if (index > -1) { this.$delete(this.queue, index) this.$delete(this.queueList, uuid) - - // $(`#download_${uuid}`).remove() } }, removeAllDownloads(currentItem) { console.log('this.removeFromQueue', currentItem) this.queueComplete = [] - // let currentItemIsEmpty = currentItem === '' - if (!currentItem) { this.queue = [] this.queueList = {} - - // $(listEl).html('') } else { this.queue = [currentItem] @@ -353,18 +254,11 @@ export default { this.queueList = {} this.queueList[currentItem] = tempQueueItem - - // $('.download_object').each(function (index) { - // if ($(this).attr('id') != 'download_' + currentItem) { - // $(this).remove() - // } - // }) } }, removedFinishedDownloads() { console.log('this.removedFinishedDownloads') this.queueComplete.forEach(uuid => { - // $('#download_' + item).remove() this.$delete(this.queueList, uuid) }) @@ -415,11 +309,6 @@ export default { startDownload(uuid) { console.log('this.startDownload') this.$set(this.queueList[uuid], 'status', 'downloading') - - // $('#bar_' + uuid) - // .removeClass('converting') - // .removeClass('indeterminate') - // .addClass('determinate') }, finishDownload(uuid) { console.log('this.finishDownload') @@ -429,32 +318,8 @@ export default { if (!isInQueue) return this.$set(this.queueList[uuid], 'status', 'download finished') - - // const resultIcon = $('#download_' + uuid).find('.queue_icon') - // const noFailedDownloads = this.queueList[uuid].failed == 0 - toast(this.$t('toasts.finishDownload', { item: this.queueList[uuid].title }), 'done') - // $('#bar_' + uuid).css('width', '100%') - - // if (noFailedDownloads) { - // resultIcon.text('done') - // } else { - // const failedButton = $('#download_' + uuid).find('.queue_failed_button') - - // ! resultIcon.addClass('clickable') - // ! resultIcon.bind('click', { item: this.queueList[uuid] }, this.showErrorsTab) - - // ! failedButton.addClass('clickable') - // ! failedButton.bind('click', { item: this.queueList[uuid] }, this.showErrorsTab) - - // if (this.queueList[uuid].failed >= this.queueList[uuid].size) { - // resultIcon.text('error') - // } else { - // resultIcon.text('warning') - // } - // } - let index = this.queue.indexOf(uuid) if (index > -1) { @@ -470,37 +335,7 @@ export default { console.log('this.startConversion') this.$set(this.queueList[uuid], 'status', 'converting') this.$set(this.queueList[uuid], 'conversion', 0) - - // $('#bar_' + uuid) - // .addClass('converting') - // .addClass('determinate') - // .removeClass('indeterminate') - // .css('width', '100%') }, - // appendItem(queueItem) { - // return - // console.log('this.appendItem') - // $(this.$refs.list).append( - // `
- //
- // Cover ${queueItem.title} - //
- // ${queueItem.title} - - // ${queueItem.artist} - //
- //
- // ${queueItem.downloaded + queueItem.failed}/${ - // queueItem.size - // } - //
- //
- //
- //
- // remove - //
- //
` - // ) - // }, async showErrorsTab(item) { await this.setErrors(item) diff --git a/src/components/downloads/QueueItem.vue b/src/components/downloads/QueueItem.vue index 5aabc63..df45706 100644 --- a/src/components/downloads/QueueItem.vue +++ b/src/components/downloads/QueueItem.vue @@ -27,7 +27,6 @@
-