Kodi Community Forum
[RELEASE] Watchlist script (was 'Adding Plex's 'On Deck' feature to XBMC') - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+---- Forum: Skin helper addons (https://forum.kodi.tv/forumdisplay.php?fid=300)
+---- Thread: [RELEASE] Watchlist script (was 'Adding Plex's 'On Deck' feature to XBMC') (/showthread.php?tid=113702)



- pecinko - 2011-12-17

Jeroen Wrote:I found this kind of weird. I added an overlay for items that are resumable:

PHP Code:
<property name="Progress">$INFO[Window(Home).Property(WatchList_Episode.1.IsResumable)]</property>
...
<
texture>overlays/OverlayResumable.png</texture>
<
visible>StringCompare(ListItem.Property(Progress),True)</visible

Which doesn't work. I replaced the StringCompare with a SubString and that does work. Wouldn't a StringCompare be more appropriate as it is an exact match?

Stupid question, have not tried it myself:

since $INFO[Window(Home).Property(WatchList_Episode.1.IsResumable)]

has only False or True value, wouldn't it be easier to use just

<visible>$INFO[Window(Home).Property(WatchList_Episode.1.IsResumable)]</visible>


- `Black - 2011-12-17

Probably wouldn't work because $INFO is a string, not a bool value.


- mortstar - 2011-12-19

I'm using the Watchlist script within the ReFocus skin. If I start an episode via the watchlist it is not reported by the trakt plugin to the trakt website. However, the same episode played from the normal library view will report as playing correctly. I believe this also happened with the, now defunct, recentlyadded script.

Here's a debug lof of me playing an episode; first from the library view where trakt connects properly and then playing the same episode from the watchlist which is not reported.

http://pastebin.com/6dYZz82Q


- ronie - 2011-12-19

mortstar Wrote:If I start an episode via the watchlist it is not reported by the trakt plugin to the trakt website.

best ask in the trakt support thread.
i have now clue how the trakt addon interacts with xbmc.
if there's something i need to add the watchlist in order to make it work, just let me know.


- othrayte - 2011-12-19

mortstar Wrote:I'm using the Watchlist script within the ReFocus skin. If I start an episode via the watchlist it is not reported by the trakt plugin to the trakt website. However, the same episode played from the normal library view will report as playing correctly. I believe this also happened with the, now defunct, recentlyadded script.

Here's a debug lof of me playing an episode; first from the library view where trakt connects properly and then playing the same episode from the watchlist which is not reported.

http://pastebin.com/6dYZz82Q

ronie Wrote:best ask in the trakt support thread.
i have now clue how the trakt addon interacts with xbmc.
if there's something i need to add the watchlist in order to make it work, just let me know.

Hey,

I'm one of the developers for Trakt Utilities (TU) to make watchlist work with TU there is one main thing to change. At the end I have a link to a modified default.py (based on v0.1.7) that includes the required changes to watchlist and I have also included the required changes a skinner would have to make.

The main problem was the way each item would get played, I tried out the script with the ReFocus skin and noticed that it was playing the item by directory, this is the problem, the json notification system that is in XBMC doesn't provided (or probably bother looking up) the extra info to identify what is playing; it just mentions that a movie is playing (even when it is a tv show). As TU relies on this notification system any lack of information is ignored.

To get around this all that is needed is to initiate the playback differently, one good way is to do it over jsonrpc from a python script. My patches provided the extra methods for requesting the playback of a movie or episode and add the identifiers that should be used to identify the item being requested.

Here is the modified default.py.

Here is a required skin changes:
Code:
<onclick>blah blah blah</onclick>
needs to be changed to
Code:
<onclick>RunScript(script.watchlist,episodeid=$INFO[Window(Home).Property(WatchList_Episode.%d.EpisodeID)])</onclick>



- Hitcher - 2011-12-19

Strange because it tracks my stuff - http://trakt.tv/user/Hitcher/history - pretty much all of the tv shows watched are through the WatchedList script.


- othrayte - 2011-12-19

Hitcher Wrote:Strange because it tracks my stuff - http://trakt.tv/user/Hitcher/history - pretty much all of the tv shows watched are through the WatchedList script.
It is the skin that generally requests plaback with watchedlist, what was found was the the method suggested causes problems, I would like to know what skin you are using, they might have come up with a more elegant solution than mine.


- Montellese - 2011-12-19

othrayte Wrote:The main problem was the way each item would get played, I tried out the script with the ReFocus skin and noticed that it was playing the item by directory, this is the problem, the json notification system that is in XBMC doesn't provided (or probably bother looking up) the extra info to identify what is playing; it just mentions that a movie is playing (even when it is a tv show). As TU relies on this notification system any lack of information is ignored.

Can you tell me how to reproduce this? I know that starting playback through recently added etc is not handled very well by XBMC (it e.g. doesn't add the files to any or the right playlist) so that might be the reason why JSON-RPC reports invalid/wrong information.

EDIT: Nevermind I managed to reproduce it myself. Will see if the problem is the JSON-RPC code or the code from the BuiltIn method used by scripts to play items.


- Hitcher - 2011-12-19

othrayte Wrote:It is the skin that generally requests plaback with watchedlist, what was found was the the method suggested causes problems, I would like to know what skin you are using, they might have come up with a more elegant solution than mine.

ZeeBo (my skin Wink)

PHP Code:
<onclick>$INFO[Window.Property(WatchList_Episode.1.Path),PlayMedia(,)]</onclick>

<
onclick>$INFO[Window.Property(WatchList_Movie.1.Path),PlayMedia(,)]</onclick



- pecinko - 2011-12-19

Hitcher Wrote:ZeeBo (my skin Wink)

PHP Code:
<onclick>$INFO[Window.Property(WatchList_Episode.1.Path),PlayMedia(,)]</onclick>

<
onclick>$INFO[Window.Property(WatchList_Movie.1.Path),PlayMedia(,)]</onclick

I use

<onclick>$INFO[Window.Property(WatchList_Movie.1.Path)]</onclick>

Hitch, care to check if that works with trakt?


- mortstar - 2011-12-20

@othrayte - Your default.py + skin change properly updates trakt when opening an episode from Watchlist for me.

@Hitcher - I had to make the change to <onclick> for XeeBo Nightly 2.7.0 using the latest Win32 nightly available (11th Dec I think) to make it work. Without it, then trakt is not updated.


- othrayte - 2011-12-20

Hitcher Wrote:ZeeBo (my skin Wink)

PHP Code:
<onclick>$INFO[Window.Property(WatchList_Episode.1.Path),PlayMedia(,)]</onclick>

<
onclick>$INFO[Window.Property(WatchList_Movie.1.Path),PlayMedia(,)]</onclick

I tried out XeeBo nightly and it has the same problem as the other skins, we will need to wait to see what Montellese discovers but in the mean time my solution will correct it for any skin it is applied to.


- Hitcher - 2011-12-20

I'm using the 2nd Dec build because of the Unicode problem (trac) that stopped Apple Movie Trailers from working; could this also be affecting trakt?


- othrayte - 2011-12-20

Hitcher Wrote:I'm using the 2nd Dec build because of the Unicode problem (trac) that stopped Apple Movie Trailers from working; could this also be affecting trakt?
It is plausible but I wouldn't think it was that likely as older and more recent builds don't seem to work. If you could post a debug log we might find it useful.


- Hitcher - 2011-12-20

http://pastebin.com/eCxsnpMs