mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 15:45:56 -05:00
2 lines
1.9 KiB
JavaScript
2 lines
1.9 KiB
JavaScript
import{_ as b,r as o,o as c,c as m,d as n,w as _,s as p,y as P,a as f,t as S,F as k,f as v,g as C,h as F}from"./index.js";import{C as x}from"./ContentWithHeading.js";import{L as M}from"./ListItemPlaylistSpotify.js";import{M as T}from"./ModalDialogPlaylistSpotify.js";import{S as A}from"./spotify-web-api.js";import{T as L}from"./TabsMusic.js";const r={load(s){if(p.state.spotify_featured_playlists.length>0)return Promise.resolve();const t=new A;t.setAccessToken(p.state.spotify.webapi_token),t.getFeaturedPlaylists({country:p.state.spotify.webapi_country,limit:50})},set(s,t){t&&p.commit(P,t.playlists.items)}},B={name:"PageMusicSpotifyFeaturedPlaylists",components:{ContentWithHeading:x,ListItemPlaylistSpotify:M,ModalDialogPlaylistSpotify:T,TabsMusic:L},beforeRouteEnter(s,t,a){r.load(s).then(i=>{a(e=>r.set(e,i))})},beforeRouteUpdate(s,t,a){const i=this;r.load(s).then(e=>{r.set(i,e),a()})},data(){return{selected_playlist:{},show_details_modal:!1}},computed:{featured_playlists(){return this.$store.state.spotify_featured_playlists}},methods:{open_playlist_dialog(s){this.selected_playlist=s,this.show_details_modal=!0}}},E={class:"fd-page-with-tabs"},D=["textContent"],I=["onClick"];function R(s,t,a,i,e,d){const y=o("tabs-music"),u=o("mdicon"),h=o("list-item-playlist-spotify"),g=o("modal-dialog-playlist-spotify"),w=o("content-with-heading");return c(),m("div",E,[n(y),n(w,null,{"heading-left":_(()=>[f("p",{class:"title is-4",textContent:S(s.$t("page.spotify.music.featured-playlists"))},null,8,D)]),content:_(()=>[(c(!0),m(k,null,v(d.featured_playlists,l=>(c(),C(h,{key:l.id,playlist:l},{actions:_(()=>[f("a",{onClick:F($=>d.open_playlist_dialog(l),["prevent","stop"])},[n(u,{class:"icon has-text-dark",name:"dots-vertical",size:"16"})],8,I)]),_:2},1032,["playlist"]))),128)),n(g,{show:e.show_details_modal,playlist:e.selected_playlist,onClose:t[0]||(t[0]=l=>e.show_details_modal=!1)},null,8,["show","playlist"])]),_:1})])}const j=b(B,[["render",R]]);export{j as default};
|