"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[7333],{73072:function(e,t,a){a.d(t,{A:function(){return u}});var s=a(20641),n=a(90033);const i={class:"no-items-container"};function l(e,t,a,l,o,d){return(0,s.uX)(),(0,s.CE)("div",i,[(0,s.Lk)("div",{class:(0,n.C4)(["no-items fade-in",{shadow:a.withShadow}])},[(0,s.RG)(e.$slots,"default",{},void 0,!0)],2)])}var o={name:"NoItems",props:{withShadow:{type:Boolean,default:!0}}},d=a(66262);const r=(0,d.A)(o,[["render",l],["__scopeId","data-v-4856c4d7"]]);var u=r},37333:function(e,t,a){a.r(t),a.d(t,{default:function(){return E}});a(18111),a(22489);var s=a(20641),n=a(90033);const i={class:"media-youtube-playlist"},l={key:1,class:"playlist-container"},o={class:"header"},d={class:"banner"},r=["src"],u={class:"row info-container"},m={class:"info"},h={class:"row"},c=["href"],p={key:1,class:"title"},y={class:"n-items"},g={key:0,class:"row"},v={class:"description"},k={key:1,class:"row"},f={class:"channel"},w=["href"];function L(e,t,a,L,_,A){const C=(0,s.g2)("Loading"),P=(0,s.g2)("NoItems"),b=(0,s.g2)("Results");return(0,s.uX)(),(0,s.CE)("div",i,[A.showLoading?((0,s.uX)(),(0,s.Wv)(C,{key:0})):((0,s.uX)(),(0,s.CE)("div",l,[(0,s.Lk)("div",o,[(0,s.Lk)("div",d,[a.metadata?.image?.length?((0,s.uX)(),(0,s.CE)("img",{key:0,src:a.metadata?.image},null,8,r)):(0,s.Q3)("",!0)]),(0,s.Lk)("div",u,[(0,s.Lk)("div",m,[(0,s.Lk)("div",h,[a.metadata?.url?((0,s.uX)(),(0,s.CE)("a",{key:0,class:"title",href:a.metadata?.url,target:"_blank",rel:"noopener noreferrer"},(0,n.v_)(A.name),9,c)):((0,s.uX)(),(0,s.CE)("span",p,(0,n.v_)(A.name),1)),(0,s.Lk)("div",y,(0,n.v_)(A.nItems)+" videos",1)]),a.metadata?.description?((0,s.uX)(),(0,s.CE)("div",g,[(0,s.Lk)("div",v,(0,n.v_)(a.metadata?.description),1)])):(0,s.Q3)("",!0),a.metadata?.channel_url?((0,s.uX)(),(0,s.CE)("div",k,[(0,s.Lk)("div",f,[t[10]||(t[10]=(0,s.eW)(" Uploaded by ",-1)),(0,s.Lk)("a",{href:a.metadata.channel_url,target:"_blank",rel:"noopener noreferrer"},(0,n.v_)(a.metadata?.channel),9,w)])])):(0,s.Q3)("",!0)])])]),A.nItems?((0,s.uX)(),(0,s.Wv)(b,{key:1,results:_.items,sources:{youtube:!0},filter:a.filter,playlist:a.id,"selected-result":_.selectedResult,onAddToPlaylist:t[0]||(t[0]=t=>e.$emit("add-to-playlist",t)),onAddToQueue:t[1]||(t[1]=t=>e.$emit("add-to-queue",t)),onDownload:t[2]||(t[2]=t=>e.$emit("download",t)),onDownloadAudio:t[3]||(t[3]=t=>e.$emit("download-audio",t)),onOpenChannel:t[4]||(t[4]=t=>e.$emit("open-channel",t)),onPlay:t[5]||(t[5]=t=>e.$emit("play",t)),onPlayWithOpts:t[6]||(t[6]=t=>e.$emit("play-with-opts",t)),onRemoveFromPlaylist:t[7]||(t[7]=t=>e.$emit("remove-from-playlist",t)),onScrollEnd:A.loadItems,onSelect:t[8]||(t[8]=e=>_.selectedResult=e),onView:t[9]||(t[9]=t=>e.$emit("view",t))},null,8,["results","filter","playlist","selected-result","onScrollEnd"])):((0,s.uX)(),(0,s.Wv)(P,{key:0,"with-shadow":!1},{default:(0,s.k6)(()=>[...t[11]||(t[11]=[(0,s.eW)(" No videos found. ",-1)])]),_:1}))]))])}a(61701);var _=a(73072),A=a(81350),C=a(20388),P=a(91387),b={mixins:[P.A],emits:["add-to-playlist","add-to-queue","download","download-audio","open-channel","play","play-with-opts","remove-from-playlist","view"],components:{Loading:A.A,NoItems:_.A,Results:C.A},props:{id:{type:String,required:!0},filter:{type:String,default:null},metadata:{type:Object,default:null}},data(){return{initialLoading:!0,items:[],loading:!1,nextPageToken:null,renderedPageTokens:{},selectedResult:null}},computed:{name(){return this.metadata?.title||this.metadata?.name},nItems(){return this.metadata?.videos||this.items?.length||0},showLoading(){return this.loading&&this.initialLoading}},methods:{async loadItems(){if(!this.loading){this.loading=!0;try{if(this.renderedPageTokens[this.nextPageToken])return;this.items=[...this.items,...(await this.request("youtube.get_playlist",{id:this.id,page:this.nextPageToken})).map(e=>({...e,type:"youtube"}))],this.initialLoading=!1,this.renderedPageTokens[this.nextPageToken]=!0,this.items.length&&(this.nextPageToken=this.items[this.items.length-1].next_page_token)}finally{this.loading=!1}}}},mounted(){this.setUrlArgs({playlist:this.id}),this.loadItems()},unmounted(){this.setUrlArgs({playlist:null})}},I=a(66262);const X=(0,I.A)(b,[["render",L],["__scopeId","data-v-75759054"]]);var E=X}}]);
//# sourceMappingURL=7333.7f7fea54.js.map