owntone / owntone-server

Linux/FreeBSD DAAP (iTunes) and MPD audio server with support for AirPlay 1 and 2 speakers (multiroom), Apple Remote (and compatibles), Chromecast, Spotify and internet radio.
https://owntone.github.io/owntone-server
GNU General Public License v2.0
2.06k stars 236 forks source link

[IOS remote] a mutating smarpl playlist does get updated/refreshed #1088

Open whatdoineed2do opened 4 years ago

whatdoineed2do commented 4 years ago

Similar to #1085

If we have smart pl that changes (such as a playlist that generates random tracks) the IOS remote appl does not show changes when you goto another screen (like now playing) and then revisit the playlist.

To reproduce:

On ii we hit the server for the playlist but on iv it looks like theres no request from remote but remote does look for albumart for the tracks

[DEBUG]     daap: DAAP request: '/update?revision-number=2&daap-no-disconnect=1&session-id=370912278'
[DEBUG]     daap: DAAP request (via 42c351) handled in 0 milliseconds

## step ii

[DEBUG]     daap: DAAP request: '/databases/1/containers/36/items?meta=dmap.itemname,dmap.itemid,daap.songartist,daap.songalbumartist,daap.songalbum,com.apple.itunes.cloud-id,dmap.containeritemid,com.apple.itunes.has-video,com.apple.itunes.itms-songid,daap.songyear,daap.songtracknumber,com.apple.itunes.extended-media-kind,dmap.downloadstatus,daap.songdisabled,daap.songtime&type=music&session-id=370912278'
[DEBUG]     daap: Fetching song list for playlist 36
[DEBUG]     daap: Asking for 15 meta tags
[ WARN]     daap: Could not find requested meta field 'com.apple.itunes.cloud-id'
[ WARN]     daap: Could not find requested meta field 'dmap.downloadstatus'
[DEBUG]     daap: Found 13 meta tags
[DEBUG]     daap: Done with song list, 3 songs
[DEBUG]     daap: DAAP request (via 42d27f) handled in 65 milliseconds
[DEBUG]     daap: DAAP request: '/databases/1/items/13925/extra_data/artwork?mw=96&mh=96&session-id=370912278'
[DEBUG]     daap: DAAP request (via 42ea38) handled in 663 milliseconds
[DEBUG]     daap: DAAP request: '/databases/1/items/65/extra_data/artwork?mw=96&mh=96&session-id=370912278'
[DEBUG]     daap: DAAP request (via 42ea38) handled in 6 milliseconds
[DEBUG]     daap: DAAP request: '/databases/1/items/15394/extra_data/artwork?mw=96&mh=96&session-id=370912278'
[DEBUG]     daap: DAAP request (via 42ea38) handled in 663 milliseconds
[DEBUG]     daap: DAAP request: '/databases/1/items/13925/extra_data/artwork?mw=96&mh=96&session-id=370912278'
[DEBUG]     daap: DAAP request (via 42ea38) handled in 695 milliseconds

## step iv

[DEBUG]     daap: DAAP request: '/databases/1/items/13925/extra_data/artwork?mw=96&mh=96&session-id=370912278'
[DEBUG]     daap: DAAP request (via 42ea38) handled in 186 milliseconds
[DEBUG]     daap: DAAP request: '/databases/1/items/65/extra_data/artwork?mw=96&mh=96&session-id=370912278'
[DEBUG]     daap: DAAP request (via 42ea38) handled in 5 milliseconds
[DEBUG]     daap: DAAP request: '/databases/1/items/15394/extra_data/artwork?mw=96&mh=96&session-id=370912278'
[DEBUG]     daap: DAAP request (via 42ea38) handled in 647 milliseconds
[DEBUG]     daap: DAAP request: '/databases/1/items/13925/extra_data/artwork?mw=96&mh=96&session-id=370912278'
[DEBUG]     daap: DAAP request (via 42ea38) handled in 656 milliseconds
[DEBUG]     daap: DAAP request: '/databases/1/items/65/extra_data/artwork?mw=96&mh=96&session-id=370912278'
[DEBUG]     daap: DAAP request (via 42ea38) handled in 5 milliseconds
[DEBUG]     daap: DAAP request: '/databases/1/items/15394/extra_data/artwork?mw=96&mh=96&session-id=370912278'
[DEBUG]     daap: DAAP request (via 42ea38) handled in 655 milliseconds

I can see in httpd_daap.c:daap_request() that there is a cache for respones but I doesn't hit this on step iv. I also modified the code so that Cache-Control: no-store is added to the response headers but it looks like remote doesn't obey this.

Is there anywhere else that we could force the DAAP client (remote) to make the call to the backend?

ejurgensen commented 4 years ago

It's been a while since I worked on this part, and looking at the code now I don't really understand what is going on :-) You can see that for DACP there is a listener event that is triggered on certain events, which causes an update "push" to Remote, but for DAAP it doesn't seem to be the case. There is linked list of update_requests, but I don't see any event that triggers these updates. Not sure why that is.