XBMCSync - Sync Watched Flag Across Multiple Boxes - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116) +--- Thread: XBMCSync - Sync Watched Flag Across Multiple Boxes (/showthread.php?tid=65824) |
- RockDawg - 2010-01-07 A while ago I manually ran a full sync and noticed a problem if we use it all the the time. Both of my machines are suspended when not in use which makes it likely that HTPC2 could be asleep when HTPC1 tries to run the script. When I initiated the script, HTPC2 was indeed asleep. It "processed frontend" HTPC1 and then tried HTPC2 which quickly errored. It then goes back to HTPC1 and scans all the videos. The problem is that it seems to now come back and try to find each and every one of those videos on HTPC2 (at least I think that's what it's doing). Of course every one errors out (URLError = [Errno 113] No route to host), but it just keeps doing it. It must not return the error until something times out because it's about 2-3 seconds between each new message. If I'm right and it's checking for each file it found on HTPC1 then this is going to go on for about 130 minutes. I don't know squat about scripting, but would it be possible to add some error handling where when it sees an error as it "Processes frontend", then it doesn't bother searching for the files on that HTPC? That would work great because it only takes a second or two for it to error out when "processing frontend" if the HTPC isn't there. Just an idea - tim- - 2010-01-07 Rockdawg: Yeah, that is actually on my list of things to fix. It should only be when trying to update that cause that. When its reading for changes it only does a single read, but it does have to make a web api call for each file it updates. Shouldnt be a huge issue to fix. - tim- - 2010-01-10 Okay, I finally got around to updating this version 0.6 is out now. It has returned back to not following the path but added the argument of "path" to do so. It also fixes the issue you pointed out Rockdawg of trying to connect for every file even if the host is down. It will now only try to connect once. Please let me know how any testing goes. - mtehonica - 2010-01-10 Just updated to 0.6. Will let you know how it goes. My cron runs every 10 minutes. Any progress on the logging? Also, a quick and simple suggestion would be to add a "version" argument to output what version we are using. It doesn't seem to be noted anywhere. Thanks for the progress on this! Has been working great! - tim- - 2010-01-10 mtehonica: I just put up another version. I havent tested much, but it has a new argument "silent" this will print everything into a log (xbmcsync.log) instead of to the screen. It outputs the version as part of that log. I also updated the "help" argument to output all of the new arguments as well as the current version. Try it out and let me know how it goes. I havent run it yet against my machines just because they are being worked on at the moment =) Thanks tim- - RockDawg - 2010-01-10 tim- Wrote:Okay, I finally got around to updating this version 0.6 is out now. It has returned back to not following the path but added the argument of "path" to do so. It also fixes the issue you pointed out Rockdawg of trying to connect for every file even if the host is down. It will now only try to connect once. Please let me know how any testing goes. So if I'm starting from scratch again, I should type: Code: python xbmcsync.py newdb path Is that correct? - mtehonica - 2010-01-10 RockDawg Wrote:So if I'm starting from scratch again, I should type: EDIT: Sorry, thought you were using the old version he released. Yes, that should be correct. - mtehonica - 2010-01-10 Just downloaded 0.7 and getting the following error: ~/Scripts$ python xbmcsync.py silent Traceback (most recent call last): File "xbmcsync.py", line 118, in <module> curs.execute("INSERT INTO SyncFiles(strFilename,IsNew) VALUES (?, 'Y')", (strFilename,)) NameError: name 'strFilename' is not defined - RockDawg - 2010-01-10 Here's what I'm getting: Code: kevin@XBMCLive:/home$ sudo python xbmcsync.py newdb path HTPC2 is sleeping. It seems to have only added one file to the db. Considering that I deleted the old db and used the newdb argument, it should've been thousands. - revelation22 - 2010-01-10 What an excellent idea. I'd like to give this a try. Where do I download the files? - tim- - 2010-01-10 Okay, I think I found the problem with both errors. I am cleaning it up now and then I'll get 0.7.1 out. revelation22: As soon as I get the fixed version out I'll PM you with the info to get access. Thanks tim- - tim- - 2010-01-10 Okay, updated and tested a little (much more than 0.7 obviously). Let me know how it goes revelation22: PM sent - mtehonica - 2010-01-10 tim- Wrote:Okay, updated and tested a little (much more than 0.7 obviously). Let me know how it goes Just downloaded and tested the new version. The silent argument appears to be working great. I'm still having trouble getting all my machines updated without using the full argument. My log is below. It appears that the script picks up the new shows fine but if it fails to update just 1 machine, it doesn't update any of them. In the log below, I ran the script, it picked up 4 new shows/movies, tried to update every machine, failed on 1 and none of the machines show the stuff marked as watched. I might be wrong but that it was appears to happen. Will give it some more testing in a little. 2010-01-10 11:32:51,565 INFO Run using version 0.7.1 2010-01-10 11:32:51,566 INFO Processing frontend: Office-iMac 2010-01-10 11:32:51,725 INFO 0 new files watched 2010-01-10 11:32:51,725 INFO Processing frontend: AppleTV-Bedroom 2010-01-10 11:32:51,908 INFO 0 new files watched 2010-01-10 11:32:51,908 INFO Processing frontend: Matt-MBP 2010-01-10 11:32:51,909 INFO URLError = [Errno 111] Connection refused 2010-01-10 11:32:51,910 INFO Processing frontend: Mac-Mini 2010-01-10 11:32:51,974 INFO ncis.s07e09.720p.hdtv.x264-immerse.mkv appears to be new 2010-01-10 11:32:51,974 INFO ncis.s07e10.720p.hdtv.x264-ctu.mkv appears to be new 2010-01-10 11:32:51,987 INFO District.9.2009.1080p.BD9.x264-BDiSC.mkv appears to be new 2010-01-10 11:32:52,008 INFO ncis.711.ignition-sitv.mkv appears to be new 2010-01-10 11:32:52,009 INFO 4 new files watched 2010-01-10 11:32:52,009 INFO Total of 4 new files watched 2010-01-10 11:32:52,088 INFO Updating frontend: Office-iMac 2010-01-10 11:32:52,267 INFO Updating frontend: AppleTV-Bedroom 2010-01-10 11:32:53,858 INFO Updating frontend: Matt-MBP 2010-01-10 11:32:53,860 INFO URLError = [Errno 111] Connection refused 2010-01-10 11:32:53,860 INFO Updating frontend: Mac-Mini 2010-01-10 11:32:54,183 INFO Errors found! Not marking all files as updated 2010-01-10 11:34:54,022 INFO Run using version 0.7.1 2010-01-10 11:34:54,022 INFO Processing frontend: Office-iMac 2010-01-10 11:34:54,107 INFO 0 new files watched 2010-01-10 11:34:54,107 INFO Processing frontend: AppleTV-Bedroom 2010-01-10 11:34:54,620 INFO 0 new files watched 2010-01-10 11:34:54,620 INFO Processing frontend: Matt-MBP 2010-01-10 11:34:54,622 INFO URLError = [Errno 111] Connection refused 2010-01-10 11:34:54,622 INFO Processing frontend: Mac-Mini 2010-01-10 11:34:54,721 INFO 0 new files watched 2010-01-10 11:34:54,721 INFO Total of 0 new files watched 2010-01-10 11:34:54,721 INFO No files need updating - exiting - mtehonica - 2010-01-10 A new issue with 0.7.1 and using the silent flag. Since I run this via the root crontab it is storing the xbmcsync.log file in the root users home directory (/root). I think it should be stored in the same directory that the script resides in or have a setting for it in the config.ini. - tim- - 2010-01-10 mtehonica Wrote:A new issue with 0.7.1 and using the silent flag. Since I run this via the root crontab it is storing the xbmcsync.log file in the root users home directory (/root). I think it should be stored in the same directory that the script resides in or have a setting for it in the config.ini. Okay, that problem is fixed. I just uploaded 0.7.2 As for the other issue (around running without the full flag) I am not certain how that would happen. I'll have to do some testing. It updates each frontend independent of all others, so one failing shouldnt cause an issue. I did catch a flaw in my logic that was causing it not to update the machine it failed on until something else needed to be updated. I put in a quick hack but I'll do a more correct fix on it as well. I may add a debug command so we can see more about the issue you are having. |