[RELEASE] Trakt Utilities (addon for Trakt.tv usage) - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27) +---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151) +---- Thread: [RELEASE] Trakt Utilities (addon for Trakt.tv usage) (/showthread.php?tid=98582) Pages:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
RE: [RELEASE] Trakt Utilities (addon for Trakt.tv usage) - Martijn - 2012-08-30 (2012-08-30, 22:36)seadog Wrote:jup.(2012-08-30, 21:32)Martijn Wrote:(2012-08-30, 21:31)seadog Wrote: I think I'll try filing a bug report with xbmc, since I believe it's a bug in the JSON RPC, though I could be wrong XBMC shouldn't hang Give detailed instruction on how to reproduce in the ticket RE: [RELEASE] Trakt Utilities (addon for Trakt.tv usage) - seadog - 2012-09-01 SpoBo how many episodes are you trying to set as seen on XBMC with the sync? I've set ~5000 episodes and I only get 1 hang per total sync, if I then kill xbmc and sync again it all goes through and after that it's not a problem anymore (though I need to add some more error checking and nice information code) RE: [RELEASE] Trakt Utilities (addon for Trakt.tv usage) - SpoBo - 2012-09-01 About 3500. crashes all the time. Ubuntu 11.10 and XBMC nightlies https://launchpad.net/~nathan-renniewaldock/+archive/xbmc-nightly. I'll try the most recent code soon. RE: [RELEASE] Trakt Utilities (addon for Trakt.tv usage) - seadog - 2012-09-02 OK I just did 3 complete syncs with my new change I just pushed (basically just adding a couple of sleeps which is a bit ugly), and I can't get it to hang on sync any more, so hopefully that's an acceptable workaround for now RE: [RELEASE] Trakt Utilities (addon for Trakt.tv usage) - SpoBo - 2012-09-02 It works!!! Thx man I'm assuming you only start the sleep after X items have been marked as seen? That way it works fast when there is no work? Can you do the same thing for movies? It hangs as well for me :x But less frequent than the tv shows. edit: trying movies now. seems to be working. hung around 70%. RE: [RELEASE] Trakt Utilities (addon for Trakt.tv usage) - seadog - 2012-09-02 OK I'll add a sleep for the movies, seems to be some sort of race condition I think then, hopefully the xbmc devs can hunt down the problem Nearly finished re-adding eden support which has turned out to be an... interesting experience to say the least Just pushed it into develop (I merged the frodo branch with develop) As for the sleep I'm just sleeping 0.2s before and after a json rpc call, since I'm only doing one call per show or per movie it doesn't slow down the process much at all (since the json calls themselves take longer) RE: [RELEASE] Trakt Utilities (addon for Trakt.tv usage) - SpoBo - 2012-09-04 Ok makes sense. I hopped over to OpenELEC (sort of tired with Ubuntu crashing out all the time) which is still on Eden. I tested your script. Works beautifully For TV Shows & Movies. Thx for all your hard work. The reason I use trakt is not the social aspect but a backup in the cloud of the stuff I have watched. So beeing able to sync it back to my box is crucial for me You mention re-adding eden support as an interesting experience. well ... you could make it cleaner by instantiating a handler object that knows how to do the action specific for the version of XBMC. You'd have 2 classes. PreFrodoHandler and FrodoHandler. Both classes contain implementationdetails for functions like setXBMCMoviePlaycount but just for their specific version. At the start of the script you check the XBMC version and set a handler variable to to the right class/instance. After that your code just has to deal with 'handler.setXBMCMoviePlaycount' and you don't have to worry about Frodo or Pre-Frodo So no if statements everywhere. The handler knows how to handle what you want :p In addition, if they ever change the implementation again it's as easy as creating a new Handler class or inheriting and overriding parts of an existing handler. Hope that made sense? ;o edit: Another addition could be the addition of a JSONrpcCall function. Just have it accept the same functions as xbmc.executeJSONRPC and inside your new function call xbmc.executeJSONRPC with the received arguments. But before and after do the 0.2s sleep. If you use that new function everywhere in your code instead of the xbmc one it'll be very easy later on to remove the 2 sleep calls everywhere as soon as they fixed their API. And this function would only have to be present and used in the FrodoHandler. Just handing out best practices here. Do with it what you will RE: [RELEASE] Trakt Utilities (addon for Trakt.tv usage) - seadog - 2012-09-04 I use the addon in the exact same way, I don't use all the watch list stuff either (though I do use the rating code sometimes), I just re-added my advanced rating support patches too. My plan at the moment is to finish the last few of features on my todo list then create a release candidate people can use easily, then hopefully do a first release. Then I'm going to refactor the rest of the code (for example the utilities file really shouldn't exist) since I assume people would prefer the last few things on my list (fix sync on startup, add clean tv option, add sync on startup popups and fix the get current rating code for the rating popups) than cleaner code that they almost certainly won't look at anyway RE: [RELEASE] Trakt Utilities (addon for Trakt.tv usage) - Martijn - 2012-09-04 my advice is to don't bother with the version check and just aim for Frodo. you can specify the minimal xbmc.addon version from which this will work. RE: [RELEASE] Trakt Utilities (addon for Trakt.tv usage) - seadog - 2012-09-04 (2012-09-04, 20:35)Martijn Wrote: my advice is to don't bother with the version check and just aim for Frodo. The code to support eden's only about 60 lines and most of that's hidden away from view anyway so I don't really mind leaving it in, but I'm removing it as soon as frodo is stable. RE: [RELEASE] Trakt Utilities (addon for Trakt.tv usage) - tripkip - 2012-09-04 Failed to sync watched movies. Debugging for the addon enabled. This is what I get: Code: 21:16:05 T:2958716928 NOTICE: Trakt Utilities: service: script.TraktUtilities - version: 0.6.4 RE: [RELEASE] Trakt Utilities (addon for Trakt.tv usage) - seadog - 2012-09-04 (2012-09-04, 21:17)tripkip Wrote: Failed to sync watched movies. Debugging for the addon enabled. This is what I get: Looks to me like you're using the "master" branch, you need to go to the develop branch: https://github.com/seadog/script.traktutilities/tree/develop make sure you uninstall the currently installed version you have properly (remove it from the addon menu, close xbmc, delete .xbmc/packages/addon/script.traktutilities/(whatever).zip, then restart xbmc, install the develop version from a zip file then restart xbmc again, I'll fix the terrible "install new version" behavior once I've added the last features to be able to release a "proper" version. edit: hit the wrong posts quote button RE: [RELEASE] Trakt Utilities (addon for Trakt.tv usage) - tripkip - 2012-09-04 (2012-09-04, 21:37)seadog Wrote: Looks to me like you're using the "master" branch, you need to go to the develop branch: https://github.com/seadog/script.traktutilities/tree/develop make sure you uninstall the currently installed version you have properly (remove it from the addon menu, close xbmc, delete .xbmc/packages/addon/script.traktutilities/(whatever).zip, then restart xbmc, install the develop version from a zip file then restart xbmc again, I'll fix the terrible "install new version" behavior once I've added the last features to be able to release a "proper" version. Code: 21:43:08 T:2958716928 NOTICE: -->Python Interpreter Initialized<-- RE: [RELEASE] Trakt Utilities (addon for Trakt.tv usage) - seadog - 2012-09-04 Are you using the auto sync on startup feature? I've just added a new commit that should solve that error for movies (but don't use autosync for TV yet, I'm re-adding that feature later tonight) and as far as I know there aren't any autosync pop ups yet (doing that later tonight again) RE: [RELEASE] Trakt Utilities (addon for Trakt.tv usage) - tripkip - 2012-09-04 (2012-09-04, 22:00)seadog Wrote: Are you using the auto sync on startup feature? I've just added a new commit that should solve that error for movies (but don't use autosync for TV yet, I'm re-adding that feature later tonight) and as far as I know there aren't any autosync pop ups yet (doing that later tonight again) I tried again with your latest commits in place (ca91c1d884784e77afb0ba89ca73a8183ee45d4a) but same error still. I only checked movies sync. Code: 22:02:50 T:2957651968 ERROR: Error Type: <type 'exceptions.UnboundLocalError'> |