• 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
[RELEASE] Export Watched Data - Backup your watched status
#61
This script is exactly, what I was looking for, but it doesn't work out for me.

Export tells me 465 flags found and saved.
After import all movies are marked as watched.

What happened?
I have all my videos as DVD rips on my HDD, means they are sorted in:

Moviename
> Video_TS
>> Video_ts.ifo

Now there are 465 entries in the XML export file, all with Video_ts.ifo as movie name.
So after importing, all DVDs were marked as watched.

Is there a way to handle it?
Reply
#62
(2012-08-28, 14:30)MicF Wrote: This script is exactly, what I was looking for, but it doesn't work out for me.

Export tells me 465 flags found and saved.
After import all movies are marked as watched.

What happened?
I have all my videos as DVD rips on my HDD, means they are sorted in:

Moviename
> Video_TS
>> Video_ts.ifo

Now there are 465 entries in the XML export file, all with Video_ts.ifo as movie name.
So after importing, all DVDs were marked as watched.

Is there a way to handle it?

That is a limitation with this backup script, as it uses the filename, which doesn't work properly in your case. I developed my own script (unreleased) which handles all this issue based on on a standard database backup.
___________________________________
No Backup, No Mercy
Reply
#63
are you going to release it?
Reply
#64
I didn't know about this, but I've kept track of watched status w/in the NFOs.
Then I used a vb script I wrote to manually update the SQL tables (from the NFOs), but also found out there is a xml setting to tell it to read that value from the NFO too.
Search first, provide details and keep forums clean. Mark things solved, to close them out and acknowledge helpful volunteers who share. If I have helped, click the plus button.
Reply
#65
transcender if you use nfo for all your files then you can use the built in system, this is built more for people that don't.
MicF I think you might get better response if you ask him in a PM Wink

Now please let this thread sleep unless there are questions about the old script.

The new thread for the working addon is here: http://forum.xbmc.org/showthread.php?tid=129448
If you find any spelling mistakes you can keep them ;)
Reply
#66
(2012-09-08, 00:23)MicF Wrote: are you going to release it?

You can find it here:

script.movies.importwatched.zip

Please note: tested only for private purpose by now.


___________________________________
No Backup, No Mercy
Reply
#67
thanx, will try.
Reply
#68
I had to rebuild my db this week. Trakt utility can do this now also fyi if you want an alternative
first_time_user (wiki) | free content (wiki) | forum rules (wiki) | PVR (wiki) | Debug Log (wiki)

IMPORTANT:
The official Kodi version does not contain any content what so ever. This means that you should provide your own content from a local or remote storage location, DVD, Blu-Ray or any other media carrier that you own. Additionally Kodi allows you to install third-party plugins that may provide access to content that is freely available on the official content provider website. The watching or listening of illegal or pirated content which would otherwise need to be paid for is not endorsed or approved by Team Kodi.
Reply
#69
(2012-10-05, 13:53)MicF Wrote: thanx, will try.

Any Feedback if it worked?
___________________________________
No Backup, No Mercy
Reply
#70
(2012-10-05, 12:32)thica Wrote:
(2012-09-08, 00:23)MicF Wrote: are you going to release it?

You can find it here:

script.movies.importwatched.zip

Please note: tested only for private purpose by now.

hi, will this work on the latest frodo beta?

thanks!
Reply
#71
(2012-12-12, 14:17)bigbear77 Wrote: hi, will this work on the latest frodo beta?

thanks!

I didn't Install any betas, so I can't confirm or deny

___________________________________
No Backup, No Mercy
Reply
#72
doesnt work in frodo because there is no more Http
Image

If my replies help you, please click on my reputation Image below :) thanks :)
Reply
#73
okay, thanks for the info saitoh183!
Reply
#74
Here is a Python script that I quickly whipped up when I saw the current script is not compatible with FRODO.

This script is for interacting with a MySQL implementation ONLY however you can easily change it to talk to the local SQlite database instead, SQL queries will be the same.

This will basically do the same thing, query all files that are "watched", save the play count, date watched and name to a file then when you import lookup each file by name and mark it as watched - simple!

You will need MySQL connector for python.

http://pastebin.com/gNvK2LNg

Code:
import MySQLdb as mdb
import sys
import cPickle

# change to import for import and export for export
MODE = "import"

try:
    #enter your MySQL server ip address here and your username/password will be xbmc/xbmc if you used guide on the wiki
    con = mdb.connect('192.168.1.10', 'xbmc', 'xbmc');
    cur = con.cursor()
    
    if MODE == "export":
        cur.execute('SELECT strFileName, lastPlayed, playCount FROM mainvideo75.files WHERE playCount >= 1 and strFileName != "";')
        rows = cur.fetchall()
        for row in rows:
            print row
        cPickle.dump(rows, open('watchedItems.p', 'wb'))
        print "Exported"
    else:
        rows = cPickle.load(open('watchedItems.p', 'rb'))
        for row in rows:
            qu = "UPDATE `mainvideo75`.`files` SET playCount = {}, lastPlayed = '{}' WHERE strFileName= '{}';".format(row[2],con.escape_string(row[1]),con.escape_string(row[0]))
            cur.execute(qu)
            print con.info() ,", Command ::> ", qu
        con.commit()
        print "Imported"
        print con.info()
        
except mdb.Error, e:
    print "Error %d: %s" % (e.args[0],e.args[1])
    sys.exit(1)
    
finally:    
    if con:    
        con.close()

Enjoy!

Tom
Reply
#75
About the same thing, but import only, and in Ruby: https://github.com/JustinAiken/xbmc_watc...s_importer
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
Reply
  • 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7

Logout Mark Read Team Forum Stats Members Help
[RELEASE] Export Watched Data - Backup your watched status1