Release WatchedList - service to automatically save/restore watched state
Quick&dirty script to mark your rated movies on imdb as watched:

Code:

#!/usr/bin/env python3
import sqlite3
import csv
import datetime

q_select = '''select * from movie_watched where idMovieImdb=?'''
q_insert = '''insert into movie_watched ('idMovieImdb','playCount','lastChange','lastPlayed','title') values (?,?,?,?,?)'''

db = sqlite3.connect('watchedlist.db')
c = db.cursor()

f = open('ratings.csv', encoding = 'iso8859')
f.readline()

csv = csv.reader(f, delimiter = ',', quotechar = '"')
for i in csv:
    iid = int(i[0][2:])
    d = datetime.datetime.fromisoformat(i[2]).timestamp()
    title = i[3]

    c.execute(q_select, (iid,))
    if c.fetchone() != None:
        print('skipping', iid, title)
        continue

    print('adding', iid, title)
    c.execute(q_insert, (int(i[0][2:]), 1, d, d, i[3]))

db.commit()
c.close()

Save the script, (s)cp your current .kodi/userdata/addon_data/service.watchedlist/watchedlist.db next it to, same with your ratings.csv (exported from your imdb account) and run the script. Rated movies will be marked as watched. (s)cp watchedlist.db back, and just run the addon.

Maybe some
Reply


Messages In This Thread
RE: WatchedList - service to automatically save/restore watched state - by dhewg - 2019-11-08, 18:40
Logout Mark Read Team Forum Stats Members Help
WatchedList - service to automatically save/restore watched state3