Release - WatchedList - service to automatically save/restore watched state

  Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Havoc2k15 Offline
Junior Member
Posts: 3
Joined: Feb 2015
Reputation: 0
Post: #46
In Kodi 14.2 Beta 1 I have a bug. After start of kodi when you click on movie. Then its open the Video list not the Movie list. When you go back and click again on Movie, the correct list apears.
Its a fresh install with no further addons and new kodi profile. After uninstall WatchedList the bug doesnt apears.

A other question.
I have tried used your addon with two profiles and with two dbs. But the addon synced the watched state over the different profiles and dbs.
I think you have not implement a multi profile feature. Could you implement this feature?
find quote
schapplm Offline
Junior Member
Posts: 41
Joined: Apr 2013
Reputation: 1
Post: #47
(2015-02-21 20:56)Havoc2k15 Wrote:  In Kodi 14.2 Beta 1 I have a bug. After start of kodi when you click on movie. Then its open the Video list not the Movie list. When you go back and click again on Movie, the correct list apears.
Its a fresh install with no further addons and new kodi profile. After uninstall WatchedList the bug doesnt apears.
What options do you use? I can only imagine the permanent watching of the user actions to be the reason.
(2015-02-21 20:56)Havoc2k15 Wrote:  I have tried used your addon with two profiles and with two dbs. But the addon synced the watched state over the different profiles and dbs.
I think you have not implement a multi profile feature. Could you implement this feature?
I do not use multiple profiles in Kodi, do I'm not familiar with this. If every user profile had his own settings for the addon, one could use different databases for each profile? Does that work like this?

My addon: service.watchedlist
My HTPC: Kodi 14.0; Ubuntu 14.04 LTS x64; AMD A6-6400K; MSI FM2-A55M-E33; 4GB Kingston HyperX RAM; Digital Devices Cine CT V6 DVB-C; Streacom FC8B Evo with 120W picoPSU
find quote
Havoc2k15 Offline
Junior Member
Posts: 3
Joined: Feb 2015
Reputation: 0
Post: #48
Sorry for my late reply.

Yes, I have activate the automatet start up and the follow feature. I have tested it and the problem apears when I switch from one profile to next profile (Kodi Logoff). When I use only one profile the bug does not apear.

For test purposes I use one Kodi installation with two profiles. The Kodi db is on a Synology NAS with MariaDB. The two users use the same Kodi db with one sql user.
For WatchedList I create two separate databases. I configured WatchedList to use under every Kodi profile a different database. But they use the same sql user.

WatchedList ignore the diffrent databases and updated every time the wateched state with the data from the other profile.

I'll try it with different SQL usern.
find quote
Havoc2k15 Offline
Junior Member
Posts: 3
Joined: Feb 2015
Reputation: 0
Post: #49
Now, I used different sql users for the profiles. But it does not help.

1.) Open Kodi with Profile1 wait for watchedlist db update. Change all movies (I test with two movies) to unwatched. Close Kodi.
2.) Open Kodi with Profile1 wait for watchedlist db update. All movies are unwatched. Good. Close Kodi.
3.) Open Kodi with Profile2 wait for watchedlist db update. All movies are unwatched. I changed all movies to watched. Close Kodi.
4.) Open Kodi with Profile2 wait for watchedlist db update. All movies are watched. Good. Close Kodi.
According to my understanding now Profile1 = unwatched and Profile2 = watched
5.) Open Kodi with Profile1 wait for watchedlist db update. All movies are watched. -.-
find quote
ColonelSceneCut Offline
Junior Member
Posts: 9
Joined: Sep 2014
Reputation: 0
Post: #50
Thanks for this addon, Very handy - Excellent work!

I am looking to add a bunch of manually created nfos for my home videos. I would like WatchedList to take these into account. Since (if I understand correctly) WatchedList uses the IDs which are stored in the NFOs (I am assuming this is so - I use local scraper only), can I just makeup any ID/UniqueID and have WatchedList do its magic?

ie:
for TV show NFO:

<id>9000000000110000</id>

for Episode NFO:

<uniqueid>9000000000110001</uniqueid>
<uniqueid>9000000000110002</uniqueid>
<uniqueid>9000000000110003</uniqueid>
.....
<uniqueid>9000000000110020</uniqueid>
<uniqueid>9000000000110021</uniqueid>
<uniqueid>9000000000110022</uniqueid>

Are there any restrictions on this?
If this doesn't work, is there a way to pull this off?

Regards C.SC
find quote
schapplm Offline
Junior Member
Posts: 41
Joined: Apr 2013
Reputation: 1
Post: #51
(2015-04-07 19:31)ColonelSceneCut Wrote:  I am looking to add a bunch of manually created nfos for my home videos. I would like WatchedList to take these into account. Since (if I understand correctly) WatchedList uses the IDs which are stored in the NFOs (I am assuming this is so - I use local scraper only), can I just makeup any ID/UniqueID and have WatchedList do its magic?
...
Are there any restrictions on this?
If this doesn't work, is there a way to pull this off?

WatchedList uses the IDs that are in the Kodi Video Library itself.
The corresponding columns are "imdbnumber" for movies and "tvshowid", "season", "episode" for tv episodes. I use the standard-json-queries VideoLibrary.GetMovies and VideoLibrary.GetEpisodes.
So if you somehow get Kodi to recognize your home videos as tv episodes, then it should work.
I have no experience with the uniqueid-tag though. I think it will only work with tvshowid-season-episode convention.
IMO there should be no restriction on the IDs except perhaps being integers. Your numbers are above 32 Bit integer scale (but below 64 Bit). I do not know, if Kodi python uses 32 Bit or 64 Bit Integer precision. To be save, you can choose smaller values.

My addon: service.watchedlist
My HTPC: Kodi 14.0; Ubuntu 14.04 LTS x64; AMD A6-6400K; MSI FM2-A55M-E33; 4GB Kingston HyperX RAM; Digital Devices Cine CT V6 DVB-C; Streacom FC8B Evo with 120W picoPSU
find quote
ColonelSceneCut Offline
Junior Member
Posts: 9
Joined: Sep 2014
Reputation: 0
Post: #52
Thanks schapplm!
With the info you just gave me, there shouldn't be a problem. Big Grin (Now doing happy dance)
(This post was last modified: 2015-04-08 07:40 by ColonelSceneCut.)
find quote
EvilDude Offline
Senior Member
Posts: 106
Joined: Feb 2006
Reputation: 0
Location: Sydney Australia
Post: #53
Is there any way to use WatchedList on remote files that are not in my database. E.g. I use Kodi to watch files on FTP share, and I have multiple devices and would like to sync the watched status for this FTP share. I'd like to avoid scanning the files into a library, since the files are transient.
find quote
TTTG Offline
Junior Member
Posts: 20
Joined: Feb 2015
Reputation: 0
Post: #54
Hi schapplm,

I think I've found a bug in service.py at line 1112. At the moment it tries to stick a unix timestamp in to the DATETIME/TIMESTAMP field which causes the script to fail.

Changing:

Code:
sql = 'UPDATE movie_watched SET playCount = %s, lastplayed = %s, lastChange = FROM_UNIXTIME(%s) WHERE idMovieImdb LIKE %s'

To:

Code:
sql = 'UPDATE movie_watched SET playCount = %s, lastplayed = FROM_UNIXTIME(%s), lastChange = FROM_UNIXTIME(%s) WHERE idMovieImdb LIKE %s'

Stops the error and the row is updated correctly.

Thanks
TTTG
find quote
schapplm Offline
Junior Member
Posts: 41
Joined: Apr 2013
Reputation: 1
Post: #55
(2015-05-07 21:51)TTTG Wrote:  I think I've found a bug in service.py at line 1112. At the moment it tries to stick a unix timestamp in to the DATETIME/TIMESTAMP field which causes the script to fail.
...

Thanks for looking in the code. Fixed this.
Since this the error never occured on my machine and all my lastplayed-information is correct, I think some combination of kodi version/mysql version/malformed timestamp data in the kodi database could have caused that.
Which kodi version are you using?

My addon: service.watchedlist
My HTPC: Kodi 14.0; Ubuntu 14.04 LTS x64; AMD A6-6400K; MSI FM2-A55M-E33; 4GB Kingston HyperX RAM; Digital Devices Cine CT V6 DVB-C; Streacom FC8B Evo with 120W picoPSU
find quote
schapplm Offline
Junior Member
Posts: 41
Joined: Apr 2013
Reputation: 1
Post: #56
(2015-05-05 16:42)EvilDude Wrote:  Is there any way to use WatchedList on remote files that are not in my database. E.g. I use Kodi to watch files on FTP share, and I have multiple devices and would like to sync the watched status for this FTP share. I'd like to avoid scanning the files into a library, since the files are transient.
This is currently not possible. If the data is not scraped and not in the database, then it is not possible to save the watched-information in form of imdb/tvdb-numbers.
An alternative could be a shared kodi database between the different machines, if the FTP-files are all accessible under the same address on all machines.

My addon: service.watchedlist
My HTPC: Kodi 14.0; Ubuntu 14.04 LTS x64; AMD A6-6400K; MSI FM2-A55M-E33; 4GB Kingston HyperX RAM; Digital Devices Cine CT V6 DVB-C; Streacom FC8B Evo with 120W picoPSU
find quote
TTTG Offline
Junior Member
Posts: 20
Joined: Feb 2015
Reputation: 0
Post: #57
(2015-05-16 16:17)schapplm Wrote:  
(2015-05-07 21:51)TTTG Wrote:  I think I've found a bug in service.py at line 1112. At the moment it tries to stick a unix timestamp in to the DATETIME/TIMESTAMP field which causes the script to fail.
...

Thanks for looking in the code. Fixed this.
Since this the error never occured on my machine and all my lastplayed-information is correct, I think some combination of kodi version/mysql version/malformed timestamp data in the kodi database could have caused that.
Which kodi version are you using?

Thanks.

I'm running version 14.2.

Yes the error was only very rarely occurring for me, I think I managed to track it down to only occurring when a movie existed in the database already that was marked as watched, then an upgraded version was downloaded (i.e. when the BluRay came out), it would then fail to mark the newly downloaded file as watched.

I'm having another issue as well, the addon seems to just randomly decide to stop running the periodic update, restarting kodi will get it to start again and there is absolutely nothing in the logs (even with debug enabled for both the addon and kodi) to indicate why it happened. The last mention you see in the logs is the previous run completing successfully, then nothing else. Once it happens if i kick off the addon manually it runs fine with no errors reported. Don't suppose you've ever noticed this?
find quote
schapplm Offline
Junior Member
Posts: 41
Joined: Apr 2013
Reputation: 1
Post: #58
(2015-05-17 05:00)TTTG Wrote:  ...
I'm having another issue as well, the addon seems to just randomly decide to stop running the periodic update, restarting kodi will get it to start again and there is absolutely nothing in the logs (even with debug enabled for both the addon and kodi) to indicate why it happened. The last mention you see in the logs is the previous run completing successfully, then nothing else. Once it happens if i kick off the addon manually it runs fine with no errors reported. Don't suppose you've ever noticed this?
I never paid attention to that specific function. I will look into my logs after my HTPC ran for several hours and an update of WL should have happened. If this is really random, it will be hard to track though.

My addon: service.watchedlist
My HTPC: Kodi 14.0; Ubuntu 14.04 LTS x64; AMD A6-6400K; MSI FM2-A55M-E33; 4GB Kingston HyperX RAM; Digital Devices Cine CT V6 DVB-C; Streacom FC8B Evo with 120W picoPSU
find quote
Steihl Offline
Junior Member
Posts: 37
Joined: Jan 2015
Reputation: 5
Post: #59
Getting following error of late when attempting to update WL:

11:05:55 T:6008 NOTICE: service.watchedlist: Update Library Manual Run.
11:05:55 T:6008 NOTICE: service.watchedlist: Notification. WatchedList: 64 movies and 598 episodes read from WL.
11:05:55 T:9292 WARNING: No information found for item 'smb://192.168.1.92/Plex/MOVIES/Indian Jones Raiders of the Lost Ark.1981/Indian Jones Raiders of the Lost Ark.1981.m4v', it won't be added to the library.
11:05:57 T:6008 NOTICE: service.watchedlist: Notification. WatchedList: 2076 movies and 9082 episodes read from xbmc-db.
11:05:57 T:9292 WARNING: No information found for item 'smb://192.168.1.92/Plex/MOVIES/Iron Man 2.2010/Iron Man 2.2010.mp4', it won't be added to the library.
11:05:57 T:6008 NOTICE: service.watchedlist: wl_update_movie: new entry for wl database: "Alien Abduction (2014)", lastChange="2015-07-14 11:05:57", lastPlayed="2015-07-12 21:04:49", playCount=1
11:05:57 T:6008 NOTICE: service.watchedlist: Notification. Remember as newly watched (WL-DB): Alien Abduction (2014)
11:05:57 T:6008 NOTICE: service.watchedlist: wl_update_movie: new entry for wl database: "Insurgent (2015)", lastChange="2015-07-14 11:05:57", lastPlayed="2015-07-13 21:54:00", playCount=1
11:05:57 T:6008 NOTICE: service.watchedlist: Notification. Remember as newly watched (WL-DB): Insurgent (2015)
11:05:58 T:6008 ERROR: service.watchedlist: write_wl_wdata: MySQL Database error 1292 (22007): Incorrect datetime value: '1436729908' for column 'lastPlayed' at row 65 while updating movie Vice (2015)
11:05:58 T:6008 NOTICE: service.watchedlist: Notification. Watchedlist: Error: Error updating WL database
find quote
dags Offline
Junior Member
Posts: 14
Joined: Sep 2013
Reputation: 0
Post: #60
(2015-07-14 18:10)Steihl Wrote:  Getting following error of late when attempting to update WL:

11:05:55 T:6008 NOTICE: service.watchedlist: Update Library Manual Run.
11:05:55 T:6008 NOTICE: service.watchedlist: Notification. WatchedList: 64 movies and 598 episodes read from WL.
11:05:55 T:9292 WARNING: No information found for item 'smb://192.168.1.92/Plex/MOVIES/Indian Jones Raiders of the Lost Ark.1981/Indian Jones Raiders of the Lost Ark.1981.m4v', it won't be added to the library.
11:05:57 T:6008 NOTICE: service.watchedlist: Notification. WatchedList: 2076 movies and 9082 episodes read from xbmc-db.
11:05:57 T:9292 WARNING: No information found for item 'smb://192.168.1.92/Plex/MOVIES/Iron Man 2.2010/Iron Man 2.2010.mp4', it won't be added to the library.
11:05:57 T:6008 NOTICE: service.watchedlist: wl_update_movie: new entry for wl database: "Alien Abduction (2014)", lastChange="2015-07-14 11:05:57", lastPlayed="2015-07-12 21:04:49", playCount=1
11:05:57 T:6008 NOTICE: service.watchedlist: Notification. Remember as newly watched (WL-DB): Alien Abduction (2014)
11:05:57 T:6008 NOTICE: service.watchedlist: wl_update_movie: new entry for wl database: "Insurgent (2015)", lastChange="2015-07-14 11:05:57", lastPlayed="2015-07-13 21:54:00", playCount=1
11:05:57 T:6008 NOTICE: service.watchedlist: Notification. Remember as newly watched (WL-DB): Insurgent (2015)
11:05:58 T:6008 ERROR: service.watchedlist: write_wl_wdata: MySQL Database error 1292 (22007): Incorrect datetime value: '1436729908' for column 'lastPlayed' at row 65 while updating movie Vice (2015)
11:05:58 T:6008 NOTICE: service.watchedlist: Notification. Watchedlist: Error: Error updating WL database

Hi All,
I am now having this same issue too.
Code:
13:42:37 T:6764  NOTICE: service.watchedlist: Notification. WatchedList: running observation of changes of watched states
13:42:38 T:6764  NOTICE: service.watchedlist: Notification. WatchedList: 54 movies and 1603 episodes read from WL.
13:42:39 T:6764  NOTICE: service.watchedlist: Notification. WatchedList: 1843 movies and 4224 episodes read from xbmc-db.
13:42:39 T:6764   ERROR: service.watchedlist: write_wl_wdata: MySQL Database error 1292 (22007): Incorrect datetime value: '1436576466' for column 'lastPlayed' at row 15 while updating movie Cars 2 (2011)
13:42:39 T:6764  NOTICE: service.watchedlist: Notification. Watchedlist: Error: Error updating WL database
13:42:39 T:6764  NOTICE: service.watchedlist: wait 10800 seconds until next update
13:42:39 T:6764  NOTICE: service.watchedlist: Notification. WatchedList: next update in 3 hours
find quote
Post Reply