@@ -18,11 +18,11 @@ Vue.filter('duration', value => {
1818} ) ;
1919
2020class Player {
21- playlist = [ ] ;
21+ queue = [ ] ;
2222 index = null ;
2323 player = null ;
2424 viewModel = null ;
25- showPlaylist = false ;
25+ showQueue = false ;
2626 playing = true ;
2727
2828 lastPrev = - 1 ;
@@ -32,8 +32,8 @@ class Player {
3232 IsPaused : false ,
3333 PositionTicks : ticks , // Convert to ticks/ns
3434 PlayMethod : 'Transcode' ,
35- PlaySessionId : this . playlist [ this . index ] . params . PlaySessionId ,
36- ItemId : this . playlist [ this . index ] . Id ,
35+ PlaySessionId : this . queue [ this . index ] . params . PlaySessionId ,
36+ ItemId : this . queue [ this . index ] . Id ,
3737 EventName : 'timeupdate' ,
3838 } ;
3939
@@ -58,25 +58,25 @@ class Player {
5858 clearHowl ( ) {
5959 this . player . unload ( ) ;
6060 this . player = null ;
61- this . playlist [ this . index ] . howl = null ;
61+ this . queue [ this . index ] . howl = null ;
6262 }
6363
64- setPlaylist ( playlist ) {
64+ setQueue ( queue ) {
6565 if ( this . player ) {
6666 this . player . stop ( ) ;
6767 this . player = null ;
6868 }
6969
7070 Howler . stop ( ) ;
7171
72- this . playlist = _ . map ( playlist , ( item , index ) => {
72+ this . queue = _ . map ( queue , ( item , index ) => {
7373 const songUrl = JellyfinService . getItemImageUrl ( item ) ;
7474 item . thumbnailImage = songUrl ? songUrl : placeholderImg ;
7575
7676 item . artist = item . Artists [ 0 ] || item . AlbumArtist ;
7777 item . loved = item . UserData . IsFavorite || false ;
7878
79- // Preload the first 3 items in the playlist
79+ // Preload the first 3 items in the queue
8080 if ( index < 3 ) {
8181 item . howl = this . createHowl ( item ) ;
8282 }
@@ -87,8 +87,8 @@ class Player {
8787 this . play ( 0 ) ;
8888 }
8989
90- injectPlaylist ( playlist ) {
91- const updatePlaylist = _ . map ( playlist , item => {
90+ injectQueue ( queue ) {
91+ const updateQueue = _ . map ( queue , item => {
9292 const songUrl = JellyfinService . getItemImageUrl ( item ) ;
9393 item . thumbnailImage = songUrl ? songUrl : placeholderImg ;
9494
@@ -98,15 +98,15 @@ class Player {
9898 return item ;
9999 } ) ;
100100
101- if ( this . index === this . playlist . length - 1 ) {
102- this . playlist = [ ...this . playlist , ...updatePlaylist ] ;
101+ if ( this . index === this . queue . length - 1 ) {
102+ this . queue = [ ...this . queue , ...updateQueue ] ;
103103 } else {
104- this . playlist . splice ( this . index + 1 , 0 , ...playlist ) ;
104+ this . queue . splice ( this . index + 1 , 0 , ...queue ) ;
105105 }
106106 }
107107
108108 removeItem ( index ) {
109- this . playlist . splice ( index , 1 ) ;
109+ this . queue . splice ( index , 1 ) ;
110110
111111 if ( index < this . index ) {
112112 this . index -= 1 ;
@@ -119,12 +119,12 @@ class Player {
119119 }
120120
121121 try {
122- if ( this . playlist [ this . index ] . loved ) {
123- await JellyfinService . unlikeId ( this . playlist [ this . index ] . Id ) ;
124- this . playlist [ this . index ] . loved = false ;
122+ if ( this . queue [ this . index ] . loved ) {
123+ await JellyfinService . unlikeId ( this . queue [ this . index ] . Id ) ;
124+ this . queue [ this . index ] . loved = false ;
125125 } else {
126- await JellyfinService . likeId ( this . playlist [ this . index ] . Id ) ;
127- this . playlist [ this . index ] . loved = true ;
126+ await JellyfinService . likeId ( this . queue [ this . index ] . Id ) ;
127+ this . queue [ this . index ] . loved = true ;
128128 }
129129 } catch ( e ) {
130130 console . log ( e ) ;
@@ -145,9 +145,9 @@ class Player {
145145 if ( this . viewModel && this . viewModel . $el ) {
146146 const images = this . viewModel . $el . querySelectorAll ( '.update-img' ) ;
147147 images . forEach ( ( image , index ) => {
148- image . setAttribute ( 'src' , this . playlist [ this . index ] . thumbnailImage ) ;
148+ image . setAttribute ( 'src' , this . queue [ this . index ] . thumbnailImage ) ;
149149
150- if ( this . playlist [ this . index ] . thumbnailImage === placeholderImg && index === 0 ) {
150+ if ( this . queue [ this . index ] . thumbnailImage === placeholderImg && index === 0 ) {
151151 image . removeAttribute ( 'src' ) ;
152152 }
153153 } ) ;
@@ -255,7 +255,7 @@ class Player {
255255 }
256256
257257 play ( index ) {
258- if ( ! this . playlist . length || index < 0 || index >= this . playlist . length ) {
258+ if ( ! this . queue . length || index < 0 || index >= this . queue . length ) {
259259 return ;
260260 }
261261
@@ -264,7 +264,7 @@ class Player {
264264 }
265265
266266 this . index = index ;
267- const data = this . playlist [ index ] ;
267+ const data = this . queue [ index ] ;
268268
269269 if ( ! data . howl ) {
270270 data . howl = this . createHowl ( data ) ;
@@ -323,7 +323,7 @@ class Player {
323323
324324 const ticks = Math . round ( seek * 10000000 ) ;
325325
326- this . playlist [ this . index ] . progressInTicks = ticks ;
326+ this . queue [ this . index ] . progressInTicks = ticks ;
327327 this . updateProgress ( ticks ) ;
328328 this . updateProgressMpris ( ticks ) ;
329329 }
@@ -349,7 +349,7 @@ class Player {
349349
350350 if ( dir === 'next' ) {
351351 index = index + 1 ;
352- if ( index >= this . playlist . length ) {
352+ if ( index >= this . queue . length ) {
353353 this . clearHowl ( ) ;
354354 }
355355 } else {
0 commit comments