• 1(current)
  • 2
  • 3
  • 4
  • 5
  • 7
[RELEASE] Export Watched Data - Backup your watched status
Thumbs Up 
Have you ever wanted to re-scrape your TV episodes but did not want to lose the database information about what you've already watched? This is a little XBMC script that will backup and restore the watched field for each Movie and TV Show in XBMC.

When run Export Watched Data will ask if you want to export or import. When you choose export it will query the SQLight database for all video files that have been watched and create an xml file in the database folder listing each by file name. When you select import it will update the watched field for each record that matches a filename listed in the xml file.
  • Can be used to backup and restore the watched data when removing the database and re-scraping.
  • Useful for moving your watched data to a new XBMC box.
  • Because the export file only contains file names without full path information you can re-create your folder structure and keep the watched data.
  • If you have multiple files with the same name, but in different folders this script will not work for you. For example if you /Episodes/Lost/s01e01.avi and /Episodes/Monk/s01e01.avi and one is watched before you export both will be marked as watched after and import.

I've tested it with 9.4 under Windows and Linux and 9.10 Beta 1 under Linux.

Thanks. Saved me a lot of work
I have tested this on xbox rev23183. Any plans making this xbox compatible?
Just found out about this script, which would be like a dream come true... Anybody tried recently?
Kodi: Kodi 17.4, with Transparency!
50 TB Unraid Server: Docker Apps: SABnzbd, Sickrage, mariaDB
HTPC: Win10 (cause Steam), i7, GTX 1080
Watching on: Panasonic TC65-PS64 with lowend Sony 5.1 HTIB
Other devices: rMBP 15", MBA 13", nvidia shield
Just tried it...
Went from an pre-addon build so used it as a script there. Then after installation of Dharma beta 2 I made it into an addon and copied back the watched.xml file into the database dir and ran the addon. Worked flawlessly Smile
Thanks for creating this. Any idea if I can use it in conjunction with transferring my library from the SQLLite DB to a MySQL DB?
@Fox or anybody else:

How can I convert it to a Dharma compatible addon?
I need it to completely move to Dharma now.

Thanks in advance....
Great addon, was looking for something like this for a really long time..,
could you make it Dharma Compatible ?

(I only did the conversion to addon, no support from my side)
Seems to be working,

Question: Where is the backup file saved in dharma?
Now olympia already made it easy for you but the only thing you actually need to make is the addon.xml file, so if you are interested in doing it yourself then have a look at that on the wiki page.

The file should be in the database folder.

you said, the script will not work properly, in case you have the same filename for different movies. How about DVD copies, where every Filename in the DB is "VIDEO_TS.IFO" or for BD, where every Filename is "index.bdmv"? Should it be better, first try to match the full path and only if that fails to match the filename only?
It's working !!

But I use also MySQL (to share and synchronize XBMC userdata profiles between multiple machines) with configuration in advancedsettings.xml


how to modify default.py file to export watched data.

Many thanks for any tips.
Can't really help you that much other then to try to point you in the right direction, I don't know how much python you know but if you know a little programming it shouldn't be that hard.
Maybe you can have a look at some other addons for xbmc that handles mysql databases and see how they do it.

But the things in the default.py file you probably are interested in are these...
#this one enables connections to sqlite
from pysqlite2 import dbapi2 as sqlite

#this is the path to the file (db-server in the mysql case)
videoDB =  xbmc.translatePath("special://profile/Database/MyVideos34.db")

#this creates the actual connection
dbCon = sqlite.connect(videoDB)

If you figure out the equivalent ones for mysql then I think you should be done.
If you find any spelling mistakes you can keep them ;)
is this still working for you guys? i can install it but when i execute it theres just an error message Sad
  • 1(current)
  • 2
  • 3
  • 4
  • 5
  • 7

Logout Mark Read Team Forum Stats Members Help
[RELEASE] Export Watched Data - Backup your watched status1
This forum uses Lukasz Tkacz MyBB addons.