CDrummond / lms-material

Material skin for LMS (Lyrion Music Server)
MIT License
326 stars 76 forks source link

Album tracks are not displayed #128

Closed chrober closed 5 years ago

chrober commented 5 years ago

I am using v0.8.1 and realized for certain albums in the album view of the "Browse" area not all tracks are displayed (see the following screenshot where tracks 3 and 5 are not listed): image

Using the "Default" skin and browsing to the very same album all tracks are being listed: image

In addition, when playing such an album via the Material skin also the queue will not show these missing tracks: image

Again, when switching to the "Default" Skin all tracks can be seen in the queue: image

When the queue in Material Skin reaches the position of a not displayed track the actual missing track is being played, but the skin shows a wrong title (in the screenshot below track 3 is actually being played, but it is shown as track 4): image In addition, the progress bar and time info at the very bottom are not displayed at all for this track while it is being played: image

When the playlist advances to the actual song 4 the queue suddenly displays the following: image

When the playlist reaches the position of the 7th track it looks as follows (Note that "Don't stop the music" already added some new tracks): image

This is the queue that is being displayed by "Default" skin: image

When hitting the refresh button of the browser, I get the following (which is also wrong): image

Here's the correct information given ny "Default" skin: image

CDrummond commented 5 years ago

Please start material as follows:

http://SERVER:9000/material/desktop?debug=json

This will cause the messages sent to LMS, and responses received to be logged to the console tab in your browser's developer tools. Please do the following:

  1. Open console tab in developer tools
  2. Navigate to the listing of albums
  3. Clear your browser's console (should be a clear icon, or trash icon)
  4. Click on the album to show the track list

Your console should now have the REQ and RESP messages used to ask for and receive the track listing. Please post those here. Thanks.

chrober commented 5 years ago

Here is what asked for, hope it helps.

[08:36:29] JSON REQ: ["aa:aa:93:0a:1b:fa",["tracks",0,25000,"album_id:11821","tags:ACRdts","sort:tracknum","artist_id:12666","library_id:0"]] utils.min.js:26:210
[08:36:29] JSON RESP: {"params":["aa:aa:93:0a:1b:fa",["tracks","0",25000,"album_id:11821","tags:ACRdts","sort:tracknum","artist_id:12666","library_id:0"]],"method":"slim.request","id":1,"result":{"titles_loop":[{"id":136574,"title":"Make It","albumartist":"Aerosmith","trackartist":"Aerosmith","compilation":"0","duration":220.316,"tracknum":1,"artist_id":12666},{"id":136575,"title":"Somebody","albumartist":"Aerosmith","trackartist":"Aerosmith","compilation":"0","duration":225.567,"tracknum":2,"artist_id":12666},{"id":136577,"title":"One Way Street","albumartist":"Aerosmith","trackartist":"Aerosmith","compilation":"0","duration":422.164,"tracknum":4,"artist_id":12666},{"id":136579,"title":"Write Me","albumartist":"Aerosmith","trackartist":"Aerosmith","compilation":"0","duration":252.081,"tracknum":6,"artist_id":12666},{"id":136580,"title":"Movin' Out","albumartist":"Aerosmith","trackartist":"Aerosmith","compilation":"0","duration":302.497,"tracknum":7,"artist_id":12666},{"id":136581,"title":"Walkin' the Dog","albumartist":"Aerosmith","trackartist":"Aerosmith","compilation":"0","duration":192.679,"tracknum":8,"artist_id":12666}],"count":6}} utils.min.js:26:210
CDrummond commented 5 years ago

Thanks. Looking at the response received from LMS:

{
   "params":[
      "aa:aa:93:0a:1b:fa",
      [
         "tracks",
         "0",
         25000,
         "album_id:11821",
         "tags:ACRdts",
         "sort:tracknum",
         "artist_id:12666",
         "library_id:0"
      ]
   ],
   "method":"slim.request",
   "id":1,
   "result":{
      "titles_loop":[
         {
            "id":136574,
            "title":"Make It",
            "albumartist":"Aerosmith",
            "trackartist":"Aerosmith",
            "compilation":"0",
            "duration":220.316,
            "tracknum":1,
            "artist_id":12666
         },
         {
            "id":136575,
            "title":"Somebody",
            "albumartist":"Aerosmith",
            "trackartist":"Aerosmith",
            "compilation":"0",
            "duration":225.567,
            "tracknum":2,
            "artist_id":12666
         },
         {
            "id":136577,
            "title":"One Way Street",
            "albumartist":"Aerosmith",
            "trackartist":"Aerosmith",
            "compilation":"0",
            "duration":422.164,
            "tracknum":4,
            "artist_id":12666
         },
         {
            "id":136579,
            "title":"Write Me",
            "albumartist":"Aerosmith",
            "trackartist":"Aerosmith",
            "compilation":"0",
            "duration":252.081,
            "tracknum":6,
            "artist_id":12666
         },
         {
            "id":136580,
            "title":"Movin' Out",
            "albumartist":"Aerosmith",
            "trackartist":"Aerosmith",
            "compilation":"0",
            "duration":302.497,
            "tracknum":7,
            "artist_id":12666
         },
         {
            "id":136581,
            "title":"Walkin' the Dog",
            "albumartist":"Aerosmith",
            "trackartist":"Aerosmith",
            "compilation":"0",
            "duration":192.679,
            "tracknum":8,
            "artist_id":12666
         }
      ],
      "count":6
   }
}

You can see that only has 6 tracks. So, not much Material can do here. It asks for the track listing, and LMS returns only 6 tracks.

As for the queue oddities. The problem here is that Material currently has no debug here. I've just added some, but you would need to install the code from git - which means manually copying the files. Another solution would be to look at the network tab in your browser's developer tools. So:

  1. Navigate to the album you want to play
  2. Go to your browser's network tab - this will show all network requests the current page is making
  3. Clear this list
  4. Play the album
  5. Firefox: Look at the 'jsonrpc.js' requests (there is a 'File' column, 'jsonrpc.js' should be there). If you click on one of these, the details should be shown on the right. Find one whose 'Params' has ["status",0,500,"tags:cdegltuysAKNRS"] (desktop browsers) or ["status",0,500,"tags:cdegltuysAKNS"] (mobile browsers). For this request, click on the 'Response' tab on the right - and paste here Chrome: On the left will be requests under 'Name', find 'jsonrpc.js' Click on this and you should see details on the right. Keep liking these until you see the status/tags display as detailed in Firefox above. Paste the whole response here.
chrober commented 5 years ago

I've already realized the two missing tracks in the JSON response from LMS. I just wonder why the Default skin sees eight tracks, though. I assume it's not requesting this information in JSON format? Still it's kind of strange. LMS' music library seems to be OK, just the JSON string LMS returns is lacking information.

Are you aware of any way to fix this? Doing a "Rescan Media Library" via LMS' "Basic Settings" did not help me here (not even when chosing "Clear library and rescan everything"). What did help is to temporarily remove such albums from the music directory, do a re-scan (to have them removed from the LMS library), re-add the albums and do re-scan again. This helped for the one album for which I've just tested this.

I will try temporarily clear the media library (e.g. by giving LMS a dummy path as media folder) and proceed as described above. (Of course, not before I helped to collect all relevant information on this issue.)

Here is the network response when playing the album for which I've sent the prvious JSON string (it also contains just those six tracks):

{
  "result": {
    "mode": "play",
    "power": 1,
    "playlist shuffle": 0,
    "playlist repeat": 0,
    "seq_no": 0,
    "duration": 220.316,
    "playlist_tracks": 8,
    "playlist_timestamp": 1560675532.72398,
    "can_seek": 1,
    "playlist_loop": [
      {
        "album_id": 11821,
        "album": "Aerosmith",
        "title": "Make It",
        "trackartist": "Aerosmith",
        "genre": "Hard Rock",
        "albumartist": "Aerosmith",
        "year": 1973,
        "trackartist_ids": "12666",
        "id": 136574,
        "tracknum": 1,
        "albumartist_ids": "12666",
        "playlist index": 0,
        "artist_id": 12666,
        "coverid": "dde2dfbf",
        "url": "file:///volume1/music/Aerosmith%20-%201973%20-%20Aerosmith/01.%20Make%20It.mp3",
        "duration": 220.316
      },
      {
        "album": "Aerosmith",
        "album_id": 11821,
        "title": "Somebody",
        "albumartist": "Aerosmith",
        "genre": "Hard Rock",
        "trackartist": "Aerosmith",
        "tracknum": 2,
        "trackartist_ids": "12666",
        "id": 136575,
        "year": 1973,
        "artist_id": 12666,
        "playlist index": 1,
        "albumartist_ids": "12666",
        "url": "file:///volume1/music/Aerosmith%20-%201973%20-%20Aerosmith/02.%20Somebody.mp3",
        "coverid": "dde2dfbf",
        "duration": 225.567
      },
      {
        "albumartist_ids": "12666",
        "artist_id": 12666,
        "playlist index": 2,
        "url": "file:///volume1/music/Aerosmith%20-%201973%20-%20Aerosmith/04.%20One%20Way%20Street.mp3",
        "coverid": "dde2dfbf",
        "duration": 422.164,
        "album_id": 11821,
        "album": "Aerosmith",
        "title": "One Way Street",
        "trackartist": "Aerosmith",
        "albumartist": "Aerosmith",
        "genre": "Hard Rock",
        "year": 1973,
        "tracknum": 4,
        "id": 136577,
        "trackartist_ids": "12666"
      },
      {
        "artist_id": 12666,
        "playlist index": 3,
        "albumartist_ids": "12666",
        "url": "file:///volume1/music/Aerosmith%20-%201973%20-%20Aerosmith/06.%20Write%20Me.mp3",
        "coverid": "dde2dfbf",
        "duration": 252.081,
        "album_id": 11821,
        "album": "Aerosmith",
        "title": "Write Me",
        "albumartist": "Aerosmith",
        "genre": "Hard Rock",
        "trackartist": "Aerosmith",
        "tracknum": 6,
        "id": 136579,
        "trackartist_ids": "12666",
        "year": 1973
      },
      {
        "id": 136580,
        "trackartist_ids": "12666",
        "tracknum": 7,
        "year": 1973,
        "albumartist": "Aerosmith",
        "genre": "Hard Rock",
        "trackartist": "Aerosmith",
        "title": "Movin' Out",
        "album_id": 11821,
        "album": "Aerosmith",
        "duration": 302.497,
        "coverid": "dde2dfbf",
        "url": "file:///volume1/music/Aerosmith%20-%201973%20-%20Aerosmith/07.%20Movin%27%20Out.mp3",
        "playlist index": 4,
        "artist_id": 12666,
        "albumartist_ids": "12666"
      },
      {
        "trackartist_ids": "12666",
        "id": 136581,
        "tracknum": 8,
        "year": 1973,
        "genre": "Hard Rock",
        "albumartist": "Aerosmith",
        "trackartist": "Aerosmith",
        "title": "Walkin' the Dog",
        "album_id": 11821,
        "album": "Aerosmith",
        "duration": 192.679,
        "coverid": "dde2dfbf",
        "url": "file:///volume1/music/Aerosmith%20-%201973%20-%20Aerosmith/08.%20Walkin%27%20The%20Dog.mp3",
        "playlist index": 5,
        "artist_id": 12666,
        "albumartist_ids": "12666"
      }
    ],
    "player_name": "Kitchen",
    "rate": 1,
    "mixer volume": 40,
    "signalstrength": 0,
    "waitingToPlay": 1,
    "player_ip": "192.168.1.100:39725",
    "digital_volume_control": 1,
    "time": 0,
    "playlist mode": "off",
    "playlist_cur_index": "0",
    "player_connected": 1
  },
  "id": 1,
  "method": "slim.request",
  "params": [
    "aa:aa:93:0a:1b:fa",
    [
      "status",
      "0",
      500,
      "tags:cdegltuysAKNRS"
    ]
  ]
}
CDrummond commented 5 years ago

OK, that is odd. LMS states there are 8 tracks, but only returns 6? Whilst this could be an issue with Material, its looking very much like an LMS issue to me. Have you tried with other control points - e.g. iPeng, Orange Squeeze, SqueezeCtrl, Squeezer? AFAIK these use JSONRPC too (but some, e.g. iPeng/SqueezCtrl, send control messages via Cometd) . Not 100% sure what the default web UI uses.

What version of LMS are you using?

chrober commented 5 years ago

The only other controller I have tried so far is Squeezer. It also gives me the correct information (8 tracks), but it connects to LMS via the telnet port (9090), therefore I guess it does not retrieve the album information via a JSON response.

I am running LMS on a Synology DS415play. However, I am not using the 7.9.1 image provided by Synology but I've downloaded a 7.9.2 image from here: https://sourceforge.net/projects/lmsupdate/files/DSM6.x/

This is what LMS tells me:

Logitech Media Server Version: 7.9.2 - 0023.1559540205 @ Wed Jun 5 14:51:56 CEST 2019
Hostname: coberNAS
Server IP Address: 192.168.1.100
Server HTTP Port Number: 9002
Operating system: Synology DiskStation - EN - utf8
Platform Architecture: i686-linux
Perl Version: 5.24.0 - i686-linux
Audio::Scan: 0.95
IO::Socket::SSL: 2.037
Database Version: DBD::SQLite 1.34_01 (sqlite 3.7.7.1)
Total Players Recognized: 3
CDrummond commented 5 years ago

Can you use curl from a commandline? If so, try:

curl 'http://SERVER:9000/jsonrpc.js' --data '{"id":1,"method":"slim.request","params":["aa:aa:93:0a:1b:fa",["status",0.100]]}'

Replace SERVER with your LMS's hostname/IP. Does this return details for 8 tracks?

chrober commented 5 years ago

Here's what curl gave me (it's eight tracks):

{
  "id": 1,
  "method": "slim.request",
  "params": [
    "aa:aa:93:0a:1b:fa",
    [
      "status",
      0.1
    ]
  ],
  "result": {
    "rescan": "1",
    "player_name": "Kitchen",
    "player_connected": 1,
    "player_ip": "192.168.1.100:41860",
    "power": 1,
    "signalstrength": 0,
    "mode": "play",
    "time": 39.6702580966949,
    "rate": 1,
    "duration": 220.316,
    "can_seek": 1,
    "mixer volume": 40,
    "playlist repeat": 0,
    "playlist shuffle": 0,
    "playlist mode": "off",
    "seq_no": 0,
    "playlist_cur_index": "0",
    "playlist_timestamp": 1560681206.88821,
    "playlist_tracks": 8,
    "digital_volume_control": 1,
    "playlist_loop": [
      {
        "title": "Make It",
        "playlist index": 0.1,
        "id": 164189
      },
      {
        "id": 164190,
        "title": "Somebody",
        "playlist index": 1.1
      },
      {
        "title": "Dream On",
        "playlist index": 2.1,
        "id": 164191
      },
      {
        "id": 164192,
        "playlist index": 3.1,
        "title": "One Way Street"
      },
      {
        "id": 164193,
        "title": "Mama Kin",
        "playlist index": 4.1
      },
      {
        "id": 164194,
        "title": "Write Me",
        "playlist index": 5.1
      },
      {
        "id": 164195,
        "title": "Movin' Out",
        "playlist index": 6.1
      },
      {
        "playlist index": 7.1,
        "title": "Walkin' the Dog",
        "id": 164196
      }
    ]
  }
}

And here's what I see with Material Skin (same screenshot as above): image

CDrummond commented 5 years ago

That's! great! What that means is something in the tags: parameter is causing LMS to filter out items. So, I'm assuming the following will only give 6 tracks:

curl 'http://SERVER:9000/jsonrpc.js' --data '{"id":1,"method":"slim.request","params":["aa:aa:93:0a:1b:fa",["status",0.100,"tags:cdegltuysAKNRS"]]}'

...as this is the command Material is using. Please check the above still works (as in still returns incorrect amount). Then, please do the command but remove a letter from tags: until all 8 tracks are returned.

chrober commented 5 years ago

Hmm. Not sure what you would have expected.

Here is what I got for

curl 'http://192.168.1.100:9002/jsonrpc.js' --data '{"id":1,"method":"slim.request","params":["aa:aa:93:0a:1b:fa",["status",0.100,"tags:cdegltuysAKNRS"]]}'

It contains the first track only:

{
  "params": [
    "aa:aa:93:0a:1b:fa",
    [
      "status",
      0.1,
      "tags:cdegltuysAKNRS"
    ]
  ],
  "result": {
    "rescan": "1",
    "player_name": "Kitchen",
    "player_connected": 1,
    "player_ip": "192.168.1.100:42407",
    "power": 1,
    "signalstrength": 0,
    "mode": "play",
    "time": 79.0941779441833,
    "rate": 1,
    "duration": 252.081,
    "can_seek": 1,
    "mixer volume": 40,
    "playlist repeat": 0,
    "playlist shuffle": 0,
    "playlist mode": "off",
    "seq_no": 0,
    "playlist_cur_index": "5",
    "playlist_timestamp": 1560681206.88821,
    "playlist_tracks": 8,
    "digital_volume_control": 1,
    "playlist_loop": [
      {
        "playlist index": 0.1,
        "title": "Make It",
        "id": 164189
      }
    ]
  },
  "id": 1,
  "method": "slim.request"
}

And it does not change, no matter how many letters I remove from tags.

CDrummond commented 5 years ago

D'oh!!! I made an error in the previous example 0.100 should have been 0,100 - this is the range of tracks to return (0 to 100). So, can you try:

curl 'http://SERVER:9000/jsonrpc.js' --data '{"id":1,"method":"slim.request","params":["aa:aa:93:0a:1b:fa",["status",0,100,"tags:cdegltuysAKNRS"]]}'

Please check the above still works (as in still returns incorrect amount). Then, please do the command but remove a letter from tags: until all 8 tracks are returned.

chrober commented 5 years ago

OK, here we go. For the sake of readability I've attached a zip-File containing four JSON files named after the tags I've used to create these responses.

json.zip

While with tags:cdegltuysAKNRS and tags:cdegltuysAKNR there were only six tracks present in the response, with tags:cdegltuysAKN all eight tracks were present. I've then tried tags:cdegltuysAKNS which also resulted in the correct list of eight tracks.

CDrummond commented 5 years ago

Thanks for that. So, its the R which is supposed to return a track;s rating. Not sure why that's causing tracks to not appear. Pretty sure this is also the reason for the browse error too.

Are any of these songs rated? Have a rating tag? Do you use TrackStat?

chrober commented 5 years ago

I am not aware of having rated any of the songs in my library. How/where would I do that and how/where can I check if I have maybe rated them by accident?

I am also not aware of any rating tags in the files themselves. I actually don't see any significant differences in the ID3 metadata between the two tracks not displayed and the other six tracks. And as I wrote earlier, for another album also having this issue, I succeeded to make previosuly not displayed tracks visible again by temporarily removing them from and re-adding them to the LMS library. This indicates it has nothing to do with the metadata in the file itself but with whatever metadata/information stored in LMS' library.

And I've just verified I don't have the TrackStat plugin installed. Do you suspect any other LMS plugin to mess things up? Would it help to give you a list of LMS plugins I have installed?

CDrummond commented 5 years ago

Sorry, I really have no idea about other plugins - I'm actually pretty new to LMS!

Anyhow, for 0.8.2 I've updated the code to only use R if TrackStat is installed - the rating would only be displayed if this was installed, so there is no need to fetch if not.

However, using R in the tags: section should not cause any filtering. the tags: section indicates which info a controller would like to know about, not what it should filter on. I'm guessing that LMS has some sort of error when accessing ratings for these files (for whatever reason), causing them not to be added to the respective lists. This is an LMS issue. It's not seen in other controllers, as I'd imagine they are not requesting this info. I suggest you raise an issue on LMS's github issue tracker.

But as for Material, I think this issue is now resolved - so I'm closing. I'll release 0.8.2 soon.