Incomplete response to Playlist.GetItems when starting movie playback via Kodi widget
#1
Hi,

during testing of a release candidate for the iOS Remote App a bug was reported which seems to be caused inside Kodi. Following details were seen with Kodi 19.4 on Linux.

When a new playlist is announced via notification, the Remote App requests the details for the new playlist via Playlist.GetItems. This content is used to visualize the content in the App's UI.

JSON request:
{"jsonrpc":"2.0","method":"Playlist.GetItems","params":{"playlistid":1,"properties": ["thumbnail", "duration", "artist", "album", "runtime", "showtitle", "season", "episode", "artistid", "albumid", "genre", "tvshowid", "channel", "file", "title", "art"]}, "id":2}

Good case:
When starting playback (music, movie, TV show episode, music video) from a UI-list in Kodi, the JSON command response has all contents expected (e.g. title, thumbnail, art, ...). For movies and music videos such UI-list can be entered via "Recently added" or "Genre".

Example response (movie "Vampires"):
{
    items =     (
                {
            album = "";
            art =             {
                banner = "image://https%3a%2f%2fassets.fanart.tv%2ffanart%2fmovies%2f9945%2fmoviebanner%2fvampires-521437922da5c.jpg/";
                clearart = "image://https%3a%2f%2fassets.fanart.tv%2ffanart%2fmovies%2f9945%2fhdmovieclearart%2fvampires-52143771b367a.png/";
                clearlogo = "image://https%3a%2f%2fassets.fanart.tv%2ffanart%2fmovies%2f9945%2fhdmovielogo%2fvampires-5174b64aa57c1.png/";
                discart = "image://https%3a%2f%2fassets.fanart.tv%2ffanart%2fmovies%2f9945%2fmoviedisc%2fvampires-53a3cb6e47315.png/";
                fanart = "image://https%3a%2f%2fassets.fanart.tv%2ffanart%2fmovies%2f9945%2fmoviebackground%2fvampires-521437ad5a406.jpg/";
                icon = "image://DefaultVideo.png/";
                keyart = "image://https%3a%2f%2fassets.fanart.tv%2ffanart%2fmovies%2f9945%2fmovieposter%2fvampires-5f17fe9db9375.jpg/";
                landscape = "image://https%3a%2f%2fassets.fanart.tv%2ffanart%2fmovies%2f9945%2fmoviethumb%2fvampires-521437da92430.jpg/";
                poster = "image://https%3a%2f%2fassets.fanart.tv%2ffanart%2fmovies%2f9945%2fmovieposter%2fvampires-5f19d1967b646.jpg/";
                "set.fanart" = "image://https%3a%2f%2fimage.tmdb.org%2ft%2fp%2foriginal%2fgbzoe6GXgEP9c0RkSIPy0Oh6EIs.jpg/";
                "set.poster" = "image://https%3a%2f%2fimage.tmdb.org%2ft%2fp%2foriginal%2fgTxg3CMZXZBpGODWG5LOlxhXtDr.jpg/";
                thumb = "image://video@%2fhome%2fbuschel%2fVideos%2fMovies%2fVampires%2fVampires.mkv/";
            };
            artist =             (
            );
            episode = "-1";
            file = "/home/buschel/Videos/Movies/Vampires/Vampires.mkv";
            genre =             (
                Action,
                Fantasy,
                Horror
            );
            id = 39;
            label = Vampires;
            runtime = 46;
            season = "-1";
            showtitle = "";
            thumbnail = "image://video@%2fhome%2fbuschel%2fVideos%2fMovies%2fVampires%2fVampires.mkv/";
            title = Vampires;
            tvshowid = "-1";
            type = movie;
        }
    );
    limits =     {
        end = 1;
        start = 0;
        total = 1;
    };
}


Bad case:
When starting playback of movies or music videos directly via the widgets (the movie or music video covers) the JSON command response is incomplete and the relevant content is missing. This results in a non-usable playlist entry visualization.

Example response (movie "Vampires"):
{
    items =     (
            art =             {
            };
            file = "/home/buschel/Videos/Movies/Vampires/Vampires.mkv";
            label = "";
            thumbnail = "";
            title = "";
            type = unknown;
        }
    );
    limits =     {
        end = 1;
        start = 0;
        total = 1;
    };

@howie-f, is this something you might be able to help with?
Reply
#2
i can reproduce and think i know where the problem is in core.
will have to take a close look at the items on home-screen (the bad case) and check back if we can do anything about it.

the issue is that the items on home-screen can just be anything: movies, episodes, plug-ins/add-ons, folders, songs, playlists (e.g. under favourites), pvr recordings..... etc, etc.
so it might get tricky to populate the art correctly.. let's see
Reply
#3
Thanks for looking into this. Btw, Player.GetItem always provides the expected results. Maybe this helps.
Reply
#4
ok, but what we see on the remote is always a playlist, even though there's just a single movie in it. is this correct?
Reply
#5
The playlist might be updated with content which is not played at this time. So there are really two separate contents shown:
1. The playlist items (taken from Playlist.GetItems)
2. The NowPlaying screen content (taken from Player.GetItem)

I just thought that Kodi widgets can trigger the right metadata for the response to Player.GetItem. Maybe this helps searching for a solution to let widgets do the same for Playlist.GetItems. But I already heard a while back that the Kodi-internal playback engines are a bit hard to maintain.
Reply
#6
@Buschel 

i'm discussing with mates and we're not finished yet. but it may become tricky because kodi's internally firing the built-in PlayMedia when you click on a home-screen widget.
means all kodi is getting from that click is something like executebuiltin(PlayMedia("/path/to/my/movie.mkv") so art doesnt reach the playlist.

i noticed that ios remote is constantly polling GetActivePlayers() .. and, if there is one, Playlist.GetItems().... so maybe it is possible to (hack) work around with something like

if (PlayList.NumberOfItems = 1)
  HackUseArtFromPlayerGetItem();
else
  Playlist.GetItems() as usual?

i think Player.GetItem with the art is called anyways because of the "Now Playing screen".
i know it's ugly.. sometimes it's the only way. will keep you up to date if we find something else
Reply
#7
I was thinking of the same, if there is no other choice. Really ugly though...
Reply
#8
I thought through this and there is a problem with such workaround. The playlist might be not empty, but nothing is playing. I have just seen this during tests yesterday.

How to get there:
- Start playing a movie via a widget
- Stop the movie or wait until the playback ended
- Start the App and check the playlist view

In this case GetActivePlayers will not succeed and still Playlist.GetItems will show incomplete results.
Reply
#9
yes, was just a quick idea Smile Playlist.GetItems needs to be fixed, investigating if it's possible somehow
Reply
#10
I just finally realized that this is the issue as to why sometimes the now playing playlist shows blank entries on my phone.

Was any further progress made on fixing the root of the problem where starting media from widgets doesn’t provide the info expected in the iOS app?
Reply

Logout Mark Read Team Forum Stats Members Help
Incomplete response to Playlist.GetItems when starting movie playback via Kodi widget0