Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
script.watched.states for Matrix
#1
@devkid

Does anyone know if this addon is available for Matrix? script.watched.states? I cannot imagine not using this addon. It works great with Leia, and the reason I need it is because I cannot always depend on trakt. I recently installed Matrix, but trakt refuses to set the watched states on my library. This addon allowed me to import/export the entire watched states in seconds. Also, I've tried watchedlist, but for some reason it is not importing the DB file from Leia. It works great on Leia as well, but not on Matrix. I know the script.watched.states addon requires Python 3, but maybe someone can update it? Smile

Regards,

Shedrock
Reply
#2
Got a link to it?  Can't find it.

scott s.
.
Reply
#3
(2023-10-13, 02:45)scott967 Wrote: Can't find it.

same here but the original thread is 11 years old, dead for 8 years now - https://forum.kodi.tv/showthread.php?tid=129448

first post indicates a replacement though
Reply
#4
(2023-10-13, 02:53)izprtxqkft Wrote: first post indicates a replacement though
@izprtxqkft - I know, but as I indicated, that addon is also not working as it does on Leia.
(2023-10-13, 02:45)scott967 Wrote: Got a link to it?  Can't find it.
Here is the link to the file: https://mega.nz/file/IbIX2TSA#aXd-cXKaoP...OMqTz-Amh8

Regards,

Shedrock
Reply
#5
looks update-able ...

@scott967 you want to take a swing at it?

my first impression was to swap out the xml code in writeWatchedFile and importWatched for a json data file, easier to maintain (and i like json)

would have a better chance of future maintenance if someone other than me did an update, i tend to abandon things when i get bored
Reply
#6
actually it is much easier when converted to json objects

currently the code is converting json from a json-rpc output to xml to save it

then reconverting the xml back to json on import

all that really needs to be done is skip the conversion altogether, load and save directly to json

the strings conversion is a bigger issue, strings.xml -> strings.po, i went cheap and copied the strings to the code when i couldnt straight convert to strings.po

and def obj2u fails, not sure what older versions of kodi required unicode strings for, changed it to just return obj


i have a tentatively working version (that works in v21), needs more cleanup, i will do that tomorrow and do a public release of the code for everyone to devour - strictly as a code release
Reply
#7
question for you @shedrock

the current code skips importing watched states when playcount is 0 (item is unwatched)

i was having issues with the count not matching up between import and export when i figured this out

since you use this, wouldn't you actually want it to import the unwatched state (playcount 0) so that items which are now watched become unwatched when importing?

seems like a more logical import to match states as they were, regardless

i can leave it as is or make it match, up to you
Reply
#8
ah well. i did both.

tested on debian linux, 19.5 and 21ALPHA1 so as long as you fall between there it should work

recommend a backup before first use just in case something doesnt work correctly (should go unsaid but now i said it)

1. will function as it was initially written
https://transfer.sh/p86fmy2aoT/script.wa...231013.zip

2. will import unwatched statuses (resetting watched)
https://transfer.sh/xK7eSJwXnU/script.wa...atched.zip

i will reupload if the links go down just @ me
Reply
#9
(2023-10-13, 07:31)izprtxqkft Wrote: the current code skips importing watched states when playcount is 0 (item is unwatched)

i was having issues with the count not matching up between import and export when i figured this out

since you use this, wouldn't you actually want it to import the unwatched state (playcount 0) so that items which are now watched become unwatched when importing?

seems like a more logical import to match states as they were, regardless

i can leave it as is or make it match, up to you
Actually, it does not do that. All this addon has ever done was import watched states. If play-counts were at "0", then those are displayed in the watched text file, but items that were previoously watched, remains at watch, or whatever the playcount was.Hope you understand what I am saying.

Here is an example of an episode that watched, and then imported as watched:
Quote:<episode episode="17" lastplayed="2022-04-21 22:46:50" playcount="1" season="12" showtitle="Blue Bloods">12x17. Hidden Motive</episode>

Shedrock
Reply
#10
@izprtxqkft

I just tested it but there seems to be a problem. My watched.xml is stored in the storage/downloads folder on LibreELEC, but when I try to import it, the addon pops up with a message.

Image
Reply
#11
(2023-10-13, 14:54)shedrock Wrote: My watched.xml is stored in the storage/downloads folder on LibreELEC, but when I try to import it, the addon pops up with a message.

well, i was unaware you needed to import an existing watched.xml
as a result, all the code was moved to json and will only now import/export json and as a result of that it will only import files that it has exported

were you just testing with an old file for testing sake or do you need to be able to import that particular xml file?

(new files are watched.json)
Reply
#12
(2023-10-13, 15:02)izprtxqkft Wrote: were you just testing with an old file for testing sake or do you need to be able to import that particular xml file?
It is a current Leia file on my existing setup. I needed to import it into this new Matrix setup.

Regards,

Shedrock
Reply
#13
alright, non-issue, i will have to go back and re-add the xml import code for backwards compatibility

i still prefer the json so i will just make it detect a .xml for an import but new files will still save as .json
Reply
#14
(2023-10-13, 16:27)izprtxqkft Wrote: alright, non-issue, i will have to go back and re-add the xml import code for backwards compatibility

i still prefer the json so i will just make it detect a .xml for an import but new files will still save as .json
Thank you so much. I appreciate it.

Shedrock
Reply
#15
That's fast.  Agree that exporting json is simpler than fooling around with elementree, but to maintain backward compatibility...

scott s.
.
Reply

Logout Mark Read Team Forum Stats Members Help
script.watched.states for Matrix0