Skip to content

Commit

Permalink
fix for updating current item in playing list
Browse files Browse the repository at this point in the history
  • Loading branch information
wdehoog committed Feb 4, 2019
1 parent c288423 commit 118b095
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions qml/pages/Playing.qml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Page {
property string currentId: ""
property string currentSnapshotId: ""
property string currentTrackId: ""
property string currentTrackUri: ""

property string viewMenuText: ""
property bool showTrackInfo: true
Expand Down Expand Up @@ -627,7 +626,7 @@ Page {
}

onCurrentIdChanged: {
console.log("onCurrentIdChanged: " + currentId)
console.log("Playing.onCurrentIdChanged: " + currentId)
if (app.controller.playbackState.context) {
switch (app.controller.playbackState.context.type) {
case 'album':
Expand Down Expand Up @@ -656,6 +655,7 @@ Page {

onContextDetailsChanged: {
currentId = app.controller.playbackState.contextDetails.id
//console.log("Playing.onContextDetailsChanged: " + currentId)
/*switch (app.controller.playbackState.context.type) {
case 'album':
break
Expand All @@ -667,6 +667,7 @@ Page {
}

onItemChanged: {
//console.log("Playing.onItemChanged")
if (app.controller.playbackState.context) {
switch (app.controller.playbackState.context.type) {
case 'album':
Expand All @@ -676,7 +677,8 @@ Page {
pageHeaderDescription = app.controller.playbackState.artistsString
break
case 'playlist':
pageHeaderDescription = app.controller.playbackState.contextDetails.name
if(app.controller.playbackState.contextDetails)
pageHeaderDescription = app.controller.playbackState.contextDetails.name
break
default:
pageHeaderDescription = ""
Expand All @@ -689,9 +691,12 @@ Page {
pageHeaderDescription = ""
}
currentTrackId = app.controller.playbackState.item.id
// still needed? currentTrackUri = app.controller.playbackState.item.uri
//console.log(" currentTrackId: " + currentTrackId)
if(currentIndex === -1)
updateForCurrentTrack()
}
onIs_playingChanged: {
//console.log("Playing.onIs_playingChanged ")
if(!_isPlaying && app.controller.playbackState.is_playing) {
if(currentIndex === -1)
updateForCurrentTrack()
Expand Down

0 comments on commit 118b095

Please sign in to comment.