Kodi Community Forum

Full Version: [DEAD] Watched Data Export/Import - Programs Addon
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9
This add-on is no longer working, have a look at this one instead http://kodi.wiki/view/Add-on:WatchedList

Watched Data Export/Import - Programs Addon

This addon creates a backup of your watched data so you can import it back in at a later time.
It saves the name of the file so even if your path changes or you unpack packed files it will still mark them as watched.


  1. Download the latest version zip.
  2. Start XBMC.
  3. Goto System->Settings->Add-Ons->Install from zip file.
  4. Find the location of the downloaded file.
  5. Install.

  • XML-file path:
    Location for the watched data file. (default is local database folder)
  • Export file name only (for RAR archives).
    Check this to save only the file name and not the whole path. (default ON)
  • Amount of simultaneous sql inserts.
    This will speed up the process of importing watched data. (default 40)
    When turned off (slider = 0) it will import the exact amount of watched times.
  • More debug info in xbmc.log.
    Will print some debug info into the log file. (default OFF)

Other stuff:
  • If you have your tv episodes named with only season and episode number (ie. s01e01.avi) or movies without name, this addon won't work for you. Sad
  • If you get an error like "ERROR: Error Contents: invalid literal for float(): true", just go into the options and press OK.

- Fixed problem with special characters.

- Option to set path for the xml file. (default is local database folder)
- Fixed error when file is missing during import.

- Temp fix for when a filename starts with s, seems like the %% don't get all way through.

- Fixed missing count value in old files could lead to error.
- Added lastPlayed info.

- Exports playcount to the xml-file also.
- Quick import got changed so the user can set own value (default 40). If set to 0 it will import the playcount from the xml-file otherwise playcount = 1.
- Rewrote some code to clean it up a bit.

- Added id to the file element with the fileID from the db.

- Fixed error when an empty sub element was returned from ET.

- Fixed problems with import of ElementTree in some cases.

- Quick import option, makes 10 updates at once (need some more testing).

- Added some options, debug output and to skip the long rar paths.

- Hopefully fixed the UTF problem.

- Using the httpAPI to solve the problem with different type of databases.

- Cleaned out some unnecessary files in the resources folder.

- Should now follow the xbmc addon rules better.

- Made it work with nightly 20110731.

- ericwilkison's script portet to an addon.

The original thread started by ericwilkison can be found here:
I'm having a problem getting this to work. I'm exporting on a Dharma XBMCLive client and importing to a Eden XBMCBuntu client. I'm using the MySql database.

Export on the Dharma client worked. A quick review of the .xbmc/userdtat/Database/watched.xml file looked good.

Copied the file over to the appropriate location on the Eden client. Ran the import and it completed without errors (~1500 files imported).

Videos don't show marked as watched.

Re-ran it with the debug option. It posted data to xbmc.log showing the database update commands, but no errors.

Any ideas?

That sounds weird, never ran into something like that.
Only thing I can think of right now is if the db is write protected or something like that but then it should give an error in return.

I'm abroad atm and here I don't have a mysql setup, but I will make a virtual environment with it and do some testing.

Maybe you could turn on the full debug in XBMC and see if it gives some more useful information.
Sorry TugboatBill no luck reproducing your "error" here. I set up a mysql here and tried a few things I thought could cause it, but none gave your result. Sad
Have you had the chance to get a full debug log and see if it gives anything useful?

Some other things you could check for me...
*regular library update works?
*manually marking a video as watched works?
*did the import mark any video as watched at all?
*did you run the quick import (sql inserts > 0) or the slow one?
I gave up trying and went with a "can't fail" approach. A pen and paper. Fortunately I only had a dozen unwatched movies and shows tended to be watched sequentially so I was able to mark things manually without too much effort. My problem probably wasn't to do with this addon as I saw the problem before when I migrated from Dharma to Eden.
hopefully this works, I've had 3 hard drive crashes over past year and I have to always go back and mark my watched - PITA when you got 1400 movies and 100 different series

I just got my new SSD back today and I'll be reinstalling windows (and XBMC) again

PS OCZ Vertex II not reliable,, hopefully the agility III is better.
I see that you have added file id support from the db... could you add support for using thetvdb episode id? I believe that would allow it to make episodes as watched regardless of the actual file name and extension.

an example scenario where this would be useful:

I've got Bones added to my library using an addon like IceLibrary or 1Channel... and the current season I have sickbeard downloading the episodes. I do it like this so that I have access to the older seasons using .strm file's and the new episodes are downloaded as they release. unfortunatly this causes there to be duplicates of the current season as it has boyh .strm and .mp4/.avi files...

I think adding the tvdb episode id to the export/import would solve this by marking both copies as watched when seen. thanks
Sounds very reasonable akuiraz, but from what I could find (just from a quick glance) the id from thetvdb isn't saved anywhere in the db so that would make it quite slow to do a lookup for every file to get the id.
I saw that the series id was saved so maybe I could use that combined with the season and episode number to make something useful.

I'll have a look into it and see what I can do.
I just tested this and it worked well. On one of my xbmc installs, i have two profiles with different libraries. Will this create separate watched files for each library?
No, it will create one for the whole db.
Didn't even knew you could have separate libraries in the same db, something I'll have to look into.
Thanks for this!

I modified it a bit to include the lastPlayed field since I use that field to build some smart playlists. I am in no way a coder but here's my edit. This will only work if quickexec is set to 0, I was too lazy to modify the other if statement stuff.

Thanks acandido thats a good idea, the pastebin didn't work for me though. Sad
But no worries, I'll add that, I'm in the process of working out the tvshow id and stuff so I'll add the lastPlayed at the same time.
Is it possible to have this import saved data from another pc to remote pc on same network. I just got a rasp Pi and it would be great to sync up the watched data from time to time just not every time it boots up
Sure it would be possible with a timed script or such but why don't you use a shared database instead?
I don't even need a times script. I have no problem triggering the sync every couple weeks. Sharing the library has been considered. But the raspberry Pi is not really fast at importing stuff and I don't know how it will affect overall usage of the system It took almost 24 hours to import the library initially. For some reason it takes the Pi a minute or two per movie and about 20 to 30 seconds per tv episode to give you an idea. Actually navigating the library isn't too bad I can say it is similar to a slower pc but playback is damn near perfect I haven't played a lot of files but haven't found anything that doesn't play from my library. This script seems to give you no option to export to another machine or to import from another machine. Is there a file created by the script that I could share between the machines that would share the watched data or is it possible to get this feature added to this script? It would obviously only work on machines working from the same files anyways
Pages: 1 2 3 4 5 6 7 8 9