mirror of
https://github.com/kristoferssolo/solorice.git
synced 2025-10-21 20:10:34 +00:00
2 lines
3.7 KiB
JavaScript
Executable File
2 lines
3.7 KiB
JavaScript
Executable File
"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[3569],{38608:(e,n,a)=>{a.d(n,{e:()=>t});var i=a(73114);const r="k270skPbT7JOaSidSA2a";var s=a(86070);const t=({iconSize:e=64,...n})=>(0,s.jsx)("div",{className:r,children:(0,s.jsx)(i.E,{iconSize:e,...n,semanticColor:"textBrightAccent","aria-hidden":!0})})},58825:(e,n,a)=>{a.r(n),a.d(n,{default:()=>L});var i=a(97500),r=a.n(i),s=a(11808),t=a(47493),l=a(13713),u=a(12805),c=a(33779),o=a(98105),d=a(71817),m=a(54443),g=a(86070);function f(e,n){switch(e.type){case d.c.ALBUM:return(0,g.jsx)(t.a,{uri:e.uri,name:e.name,images:e.images,sharingInfo:null,artists:e.artists,index:n},e.uri);case d.c.ARTIST:return(0,g.jsx)(l.a,{uri:e.uri,name:e.name,images:e.images,index:n},e.uri);case d.c.SHOW:return(0,g.jsx)(o.o,{uri:e.uri,name:e.name,images:e.images,publisher:e.publisher,sharingInfo:null,mediaType:m.Q.UNKNOWN,index:n},e.uri);case d.c.AUDIOBOOK:return(0,g.jsx)(u.M,{uri:e.uri,name:e.name,images:e.images,authorName:e.authorName,index:n},e.uri);case d.c.PLAYLIST:return(0,g.jsx)(c.B,{uri:e.uri,name:e.name,images:e.images,description:"",authorName:e.creatorName,index:n},e.uri);default:return null}}var h=a(57734),x=a(30758),p=a(8159),b=a(98584),j=a(2977),y=a(80227),S=a(38608),w=a(12811),v=a(85513),I=a(48168),A=a(33834),k=a(45235),P=a(46177),E=a(42582),N=a(85993);const T=function({uri:e,name:n,images:a,index:i}){const r=(0,P.o)(),t=(0,x.useRef)(null),l=(0,x.useRef)(!0),u=(0,k.A)(),{isPlaying:c}=(0,N.l_)(I.bV),{togglePlay:o}=(0,E.P)({uri:I.bV,pages:[{items:t.current?.map((e=>({...e,provider:null})))||[]}]},{featureIdentifier:"local_files"});(0,x.useEffect)((()=>(l.current=!0,()=>{l.current=!1})),[]);const d=(0,A.P)(),m=(0,p.YQ)((async(e,n)=>{if(!t.current){const e=await u.getTracks();t.current=e}l&&o({loggingParams:n},{uri:I.bV,pages:[{items:t.current?.map((e=>({...e,provider:null})))||[]}]})}),v.d,{leading:!0,trailing:!1});return r.canFetchAllTracks&&d?(0,g.jsx)(b.Z,{index:i,delegatePlayback:!0,delegateLogging:!0,isPlaying:c,onPlay:m,headerText:n,featureIdentifier:"local_files",uri:e,renderCardImage:()=>(0,g.jsx)(j.M,{images:a,FallbackComponent:S.e}),renderSubHeaderContent:()=>(0,g.jsx)(y.c,{children:s.Ru.get("local-files.description")})}):null},C=({index:e})=>{const n=(0,w.Iu)();return(0,g.jsx)(x.Suspense,{fallback:null,children:(0,g.jsx)(T,{index:e,name:n.name,uri:n.uri,images:n.images})})};var O=a(10596),R=a(95302),_=a(11926);var B=a(81436);const L=function(){const{hasError:e,items:n}=function(){const e=(0,_.B)(),[n,a]=(0,x.useState)(!0),[i,r]=(0,x.useState)(!1),[s,t]=(0,x.useState)([]);return(0,x.useEffect)((()=>{(async()=>{try{const n=await e.getDownloads();t(n)}catch(e){r(!0)}finally{a(!1)}})()}),[e]),{isLoading:n,hasError:i,items:s}}(),a=(0,A.P)();return e?null:(0,g.jsx)("div",{className:r()(B.A.offline,"contentSpacing"),children:n.length>0||a?(0,g.jsxs)(R.pZ,{value:"headered-grid",children:[(0,g.jsx)(h.$,{title:s.Ru.get("music_downloads"),total:n.length,seeAllUri:"/collection/music-downloads",alwaysShowSeeAll:!0,children:n.map(((e,n)=>(0,g.jsx)(R.pZ,{value:"card",index:n,children:f(e,n)},e.uri)))}),a&&(0,g.jsx)(h.$,{title:s.Ru.get("local-files"),total:1,showAll:!0,children:(0,g.jsx)(C,{index:0})})]}):(0,g.jsx)(O.I,{showDownloadInformation:!0})})}},33834:(e,n,a)=>{a.d(n,{P:()=>r});var i=a(76149);function r(){return(0,i.y)()[0]}},76149:(e,n,a)=>{a.d(n,{y:()=>s});var i=a(30758),r=a(45235);function s(){const e=(0,r.A)(),[n,a]=(0,i.useState)(e.getIsEnabled());(0,i.useEffect)((()=>{const n=e.subscribeIsEnabled(a);return()=>n()}),[e]);return[n,(0,i.useCallback)((n=>e.setIsEnabled(n)),[e])]}}}]);
|
|
//# sourceMappingURL=xpui-routes-offline-browse.js.map
|