removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
I'm not aware of any notification the library data provider script can pick up when a file is deleted, so (until someone corrects me) this isn't something that the script can do itself.
However, I have a similarly convoluted setup, and love a hack, so... The data that the widgets is built from is saved into window properties. To get the widgets to reload, then, the window properties have to be cleared. By including including a button in DialogYesNo that clears these properties when we're deleting an episode (easy enough to extend for a whole tv show or movie) and then sending a click to the original Yes button, we can trigger the library data provider to reload the widgets (next time they're accessed).
Code:
<item id="1110">
<description>Yes button proxy</description>
<label>$INFO[Control.GetLabel(11)]</label>
<onclick condition="StringCompare(Control.GetLabel(1),$LOCALIZE[20362])">ClearProperty(RecommendedEpisodes-Data,10000)</onclick>
<onclick condition="StringCompare(Control.GetLabel(1),$LOCALIZE[20362])">ClearProperty(RandomEpisodes-Data,10000)</onclick>
<onclick condition="StringCompare(Control.GetLabel(1),$LOCALIZE[20362])">ClearProperty(RecentEpisodes-Data,10000)</onclick>
<onclick>Control.Message(11,click)</onclick>
<visible>Control.IsEnabled(11)</visible>
</item>
(string 20362 is "Remove episode from library")
Posts: 214
Joined: Jul 2010
Reputation:
6
Thanks for a great script! I thought I just ask this here, have been thinking about it for a long time. What is the difference between random and recommended items exactly?
removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
(Hope you don't mind if I answer the ones I know, BigNoid)
(2014-11-29, 15:47)frellAn Wrote: Thanks for a great script! I thought I just ask this here, have been thinking about it for a long time. What is the difference between random and recommended items exactly?
Recommended movies - movies that are in progress
Recommended episodes - the first unwatched episode of in-progress tv series
Recommended albums - most played albums
(2014-11-29, 16:56)wyrm Wrote: BigNoid,
I have in the past used the skin.widgets script to provide home shelf content in my skin. By using skin widgets I could have multiple types of content appear on the one shelf, for example on the Movies shelf I could show recent movies and recommended movies. Is Library Data Provider capable of provide data for more than one type of content at the same time? That is can I make a call to the script like this?
PHP Code:
<content target="video">plugin://service.library.data.provider?type=randommovies&reload=$INFO[Window.Property(randommovies);?type=recentmovies&reload=$INFO[Window.Property(recentmovies)]</content>
To have both randommovies and recentmovies data provided by the script.
Wyrm (xTV-SAF)
From what I understand of the list-filling method (very happy to be corrected by someone who knows better
), only a single plugin can be used, so you can't include the plugin twice. It's simple enough to modify the script so that it can accept multiple types and return them though: try my fork (
https://github.com/unfledged/service.lib...a.provider) - if that works for you (and doesn't break the playliststats, which I haven't tested) I'll do a pull request.
PHP Code:
<content target="video">plugin://service.library.data.provider?type=randommovies+recentmovies&reload=$INFO[Window.Property(randommovies)]$INFO[Window.Property(recentmovies)]</content>
(Note the '+' between the content types, and both window properties include in the reload parameter)
removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
(2014-11-29, 20:59)pkscout Wrote: (2014-11-29, 12:42)Unfledged Wrote: I'm not aware of any notification the library data provider script can pick up when a file is deleted, so (until someone corrects me) this isn't something that the script can do itself.
However, I have a similarly convoluted setup, and love a hack, so... The data that the widgets is built from is saved into window properties. To get the widgets to reload, then, the window properties have to be cleared. By including including a button in DialogYesNo that clears these properties when we're deleting an episode (easy enough to extend for a whole tv show or movie) and then sending a click to the original Yes button, we can trigger the library data provider to reload the widgets (next time they're accessed).
I wasn't able to get what you included to work, but it did put me on the right track. It looks like to get stuff to reload you need to clear both the data property and the named property (where the cache date is). I also couldn't figure out how to trigger the fake button, so I just added the onclick stuff to the yes button. That all seems to be working. For completeness, this set of onclicks will clear the TV Show or Movie properties when an episode, TV Show, or movie is deleted.
<snip />
You might also want to clear episode data on string 26363 - though purely for the sake of completeness, as it's an unlikely usage from your needs - that's when an entire TV show is removed. Apologies I missed the cache date property and got the case wrong of the properties (that's what I get when I write something purely from memory!) The proxy button I used purely because that's how I do it myself - the proxy button is shown (so I can include it in a fixedlist) rather than the yes button with id 11, obviously not needed in most cases.
Edit: Ignore that, you're already checking for 26363. My bad.
removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
(2014-11-30, 16:08)wyrm Wrote: Sorry mate did not seem to work (but maybe my fault). So, problem at my end or yours?
This is when I wish I'd thought to add some extra logging in! No errors showing in the log, and pasting your code into an existing skin works for me. You're definitely using the fork, right...?
removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
(2014-12-01, 04:16)wyrm Wrote: DOHHHH!, that was it. Forgot that grabbing things via the github website appended -master to end of the zip, all good now. I guess I could not slip in a further request since this now appears to be working fine? In the implementation that I had with skin widgets I was able to change a heading label for the shelf based on the type of content that currently had focus, ie label changed from Recent Movie to Recommended Movie when moving from item that was recent movie item to a recommended movie item. Is this possible now, or could you please add something to let me do this if not currently possible.
Thank mate
Wyrm (xTV-SAF)
Good to know it works, I'll do a PR this afternoon. For the content type, You should be able to use ListItem.Property(type) for that.
removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
PR -
https://github.com/BigNoid/service.libra...er/pull/23
All art the item has (that Kodi returns anyway) is added to the items under ListItem.Art, even if they're not listed in the docs. ListItem.Art(tvshow.banner), for example
Posts: 27
Joined: Mar 2015
Reputation:
3
Are you accepting patches? I'd love to add a "_fetch_favourite_episodes" (and equivalent property setting, etc) that fetches the most recent unwatched episode of every tv show that's in your favourites.
It's kind of like "recommended episodes", but there are many shows that I watch a few of and then decide I'm not that into or am going to wait until later to finish. Shows I'm actively watching go into my favourites. It'd be cool to be able to quickly see just that list of new episodes for the shows I'm actively following at the moment.
I've already done a first pass of the code and have the queries working, if you're interested I'll finishing fleshing it out and adding the rest of the surrounding infrastructure (setting of properties, etc) and submit a patch.