9898 <br >
9999 </div >
100100 <hr >
101+ </div >
102+ <div v-if =" node.pres==='flat'" >
101103 <!-- Track list -->
102104 <div v-for =" child in items" style =" display : inline ;clear :both ;" :class =" { 'sheet-opened': controlsOpened }" :key =" child.path" >
103- <f7-link :href =" `/mediabrowser/?path=` + child.path + `&item=` + item + `&device=` + device" :data-reload =" true" :reload-current =" true" :reload-detail =" true" >
104- <f7-button outline style =" height :30px ;font-weight :bold ;padding :2px ;padding-left :30px ;text-align :left ;border :none 0px ;" @click =" doPlay(currentPlayerItem, child.path)" icon-material =" play_arrow" small icon-size =" 24" >
105- Play
106- </f7-button >
107- <f7-button outline style =" height :30px ;font-weight :bold ;padding :2px ;padding-left :30px ;text-align :left ;border :none 0px ;" @click =" doEnqueue(currentPlayerItem, child.path)" icon-material =" playlist_add" small icon-size =" 24" >
108- Enqueue
109- </f7-button >
110- <div style =" padding-left :30px ;color :black " >
111- {{ child.label }}
112- </div >
113- </f7-link >
105+ <f7-link :href =" `/mediabrowser/?path=` + child.path + `&item=` + item + `&device=` + device" :data-reload =" true" :reload-current =" true" :reload-detail =" true" >
106+ <f7-button outline style =" height :30px ;font-weight :bold ;padding :2px ;padding-left :30px ;text-align :left ;border :none 0px ;" @click =" doPlay(currentPlayerItem, child.path)" icon-material =" play_arrow" small icon-size =" 24" >
107+ Play
108+ </f7-button >
109+ <f7-button outline style =" height :30px ;font-weight :bold ;padding :2px ;padding-left :30px ;text-align :left ;border :none 0px ;" @click =" doEnqueue(currentPlayerItem, child.path)" icon-material =" playlist_add" small icon-size =" 24" >
110+ Enqueue
111+ </f7-button >
112+ <div style =" padding-left :30px ;color :black " >
113+ {{ child.label }}
114+ </div >
115+ </f7-link >
116+ <br >
117+ </div >
118+ <br >
119+ </div >
120+ <div v-else-if =" node.pres==='queue'" >
121+ <!-- Track list -->
122+ <div v-for =" (child,index) in items" style =" display : inline ;clear :both ;" :class =" { 'sheet-opened': controlsOpened }" :key =" child.path" >
123+ <f7-link :href =" `/mediabrowser/?path=` + child.path + `&item=` + item + `&device=` + device" :data-reload =" true" :reload-current =" true" :reload-detail =" true" >
124+ <div style =" padding-left :30px ;width :20px ;color :black ;font-weight :bold ;font-size :14pt ;" >
125+ {{ index + 1 }}
126+ </div >
127+
128+ <div v-if =" index==1" style =" width :50px ;padding-left :20px ;" >
129+ <img src =" /static/hp.gif" style =" padding-left :15px ;width :24px ;" />
130+ </div >
131+ <div v-else-if =" index!=1" style =" width :50px ;padding-left :20px ;" >
132+ <f7-button outline style =" height :30px ;font-weight :bold ;text-align :left ;border :none 0px ;" @click =" doPlay(currentPlayerItem, child.path)" icon-material =" play_arrow" small icon-size =" 24" />
133+ </div >
134+
135+ <div style =" padding-left :30px ;width :120px ;color :black " >
136+ <img :src =" child.artUri" width =" 50px" ></img >
137+ </div >
138+ <div style =" padding-left :30px ;width :400px ;color :black " >
139+ {{ child.label }}
140+ </div >
141+ <div style =" padding-left :30px ;width :300px ;color :black " >
142+ {{ child.complement }}
143+ </div >
144+ </f7-link >
114145 <br >
115146 </div >
116147 <br >
@@ -243,11 +274,6 @@ export default {
243274 }
244275 },
245276 data () {
246- this .$f7 .toast .create ({
247- text: this .$t (' media.page.updated' ),
248- destroyOnClose: true ,
249- closeTimeout: 2000
250- }).open ()
251277
252278 this .$store .commit (' setMapping' , { key: ' Root' , value: ' Racine' })
253279 this .$store .commit (' setMapping' , { key: ' g' , value: ' Genres' })
@@ -479,6 +505,7 @@ export default {
479505 this .lastItemIndex = this .items .length
480506
481507 if (this .node .type === ' org.openhab.core.media.model.MediaSearchResult' ) { this .node .pres = ' search' }
508+ if (this .node .type === ' org.openhab.core.media.model.MediaQueue' ) { this .node .pres = ' queue' }
482509 if (this .node .type === ' org.openhab.core.media.model.MediaAlbum' ) { this .node .pres = ' flat' }
483510 if (this .node .type === ' org.openhab.core.media.model.MediaPlayList' ) { this .node .pres = ' flat' }
484511 if (this .node .type === ' org.openhab.core.media.model.MediaCollection' && this .containsTrack (this .items )) { this .node .pres = ' flat' }
@@ -489,6 +516,12 @@ export default {
489516 this .loadItems (0 )
490517 },
491518 loadMore () {
519+ this .$f7 .toast .create ({
520+ text: this .$t (" media.loading" ),
521+ destroyOnClose: true ,
522+ closeTimeout: 1000
523+ }).open ()
524+
492525 if (this .loading || ! this .allowInfinite ) {
493526 console .log (' ==> returning because loading or no infinite :' + this .loading + ' / ' + this .allowInfinite )
494527 return
@@ -521,11 +554,6 @@ export default {
521554 async fetchResults (query ) {
522555 this .loading = true
523556 try {
524- // console.log('query:', query.query)
525- // Remplace cette URL par ton endpoint réel
526- // const response = await fetch(`https://api.example.com/search?q=${encodeURIComponent(query)}`);
527- // const data = await response.json();
528-
529557 this .$store .dispatch (' sendCommand' , { itemName: this .item , cmd: this .createMediaType (' SEARCH' , encodeURIComponent (query .query )) })
530558 this .$f7router .navigate (' /mediabrowser/?path=/Root/Search&query=' + query .query , { reloadCurrent: true , reloadDetail: true })
531559
0 commit comments