Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon forgets what was already seen #88

Closed
dagwieers opened this issue Mar 23, 2019 · 14 comments
Closed

Addon forgets what was already seen #88

dagwieers opened this issue Mar 23, 2019 · 14 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@dagwieers
Copy link
Collaborator

Describe the bug
I don't know yet what caused this, and I can't remember having seen this in the past usage of the addon. But stuff I have already seen is no longer marked as such, especially if it's been some time.

I would expect every item has a unique identifier and this identifier is used to recognize if it was seen before (stored somewhere in an internal database). But I don't think we store such an identifier, so at some point it gets lost if the content is "rewritten".

@pietje666
Copy link
Collaborator

Issue #42

fixed with commit 0b08f7a

this needs to be set
=>> xbmcplugin.setContent(int(self._handle), "episodes")

@mediaminister
Copy link
Collaborator

"Resume from" and the check mark for watched programs works perfect for me. It works consistently in every menu throughout the whole addon.

@dagwieers Can you specify a bit more when it doesn't work for you?

@dagwieers
Copy link
Collaborator Author

@mediaminister It's simple, I don't know when it started, but I can see that older content is no longer tagged as seen. Newer content is correctly tagged as seen, but I don't know for how long until that is "forgotten" too. I was hoping maybe adding an dbid or something like that could help in better retaining this kind of information ?

@dagwieers
Copy link
Collaborator Author

It's hard to know if it is fixed unless it happens again (but this time I'll hopefully be more aware to when it exactly started to happen).

@dagwieers dagwieers added the bug Something isn't working label Mar 23, 2019
@dagwieers
Copy link
Collaborator Author

@pietje666 Does it have to say int(self._handle) ? All the other usages use self._handle directly.

xbmcplugin.setContent(int(self._handle), "episodes")

I may have inadvertently removed the in()...

@pietje666
Copy link
Collaborator

Not sure, i remembered that i copied it from another addon. Since i could not find the culprit

@mediaminister
Copy link
Collaborator

mediaminister commented Mar 23, 2019

That is not the cause, self._handle is already an int: https://github.com/pietje666/plugin.video.vrt.nu/blob/c25ac8c8f6924b337620a280811c9ffc970d5319/plugin.video.vrt.nu/addon.py#L21

I think we first have to understand how this functionality works before messing around.

@dagwieers
Copy link
Collaborator Author

Agreed, and always document why something is done especially if it is not obvious.

PS For some of the metadata I map to ListItem InfoLabels, I am not sure if it has any effect. Some of them at least don't have a visual effect. I think we may have to re-evaluate this later.

@dagwieers
Copy link
Collaborator Author

Also leave the possibility open that for this issue either Kodi did something wrong, or I did something wrong. I have a setup with multiple LibreELEC devices uses a shared MySQL database for keeping track of what has been watched.

@mediaminister
Copy link
Collaborator

mediaminister commented Mar 23, 2019

I think I got a clue. Kodi watched status (playCount value in files table in Kodi MyVideo db files) is probably based on the plugin://plugin.video.vrt.nu/ url's (strFilename value in db).
When adding new functionality past week, new parameters were added to these url's so all old-style url's and their watch status were lost.

For example:
New style url:
plugin://plugin.video.vrt.nu/?publication_id=pbs-pub-b52812cc-bd17-4390-af58-ca13fc64bca5&action=play&video_id=vid-35469c59-5dcd-405c-9eca-c36109bb5c12&video_url=https%3A%2F%2Fwww.vrt.be%2Fvrtnu%2Fa-z%2Fnachtwacht1%2F2019%2Fnachtwacht1-s2019a7%2F
Old style url:
plugin://plugin.video.vrt.nu/?action=play&video=%2Fvrtnu%2Fa-z%2Fteam-scheire%2F1%2Fteam-scheire-s1a2%2F

@dagwieers
Copy link
Collaborator Author

That makes a lot of sense, but I wonder if there is a way to (rather than the URL) give it a another identifier that is stable for the future. So either the most basic URL, or simply the video_id (which should be stable).

Is that not what the dbid is for ? I have a patch available for this, but didn't know how to test it.
The other solution may be to use path which now points to this URL and could be something more stable (if it does not change the location for the end-user, which is what I fear).

@mediaminister
Copy link
Collaborator

I did a little test and indeed the url is the unique identifier to store playcount and "resume from" bookmarks.

I did not yet found the time to investigate this thoroughly, but I think that to make use of dbid the addon has to store all "movie data" in the database first. I don't think xbmcplugin.addDirectoryItems or xbmcplugin.setContent stores this "movie data" to the database.

Only when you play an item, a minimum of data is stored to the database to make playcount and "resume from" functionality work.

@dagwieers
Copy link
Collaborator Author

Hmm, that looks like a design issue (if we can't add a unique identifier). As it's easy to understand that those URLs are not guaranteed to be identical. To me this is not a big issue, but we may want to be sure we are not adding/changing that URL in the future. Maybe sorting by key to ensure that the order is predictable.

@dagwieers
Copy link
Collaborator Author

I think a better interface using script.module.routing (#103) is the solution to his. (So we don't have to overload the current video_url interface).
Maybe for a 2.0 release, with reorganized code so we can do more/better unit testing.

@dagwieers dagwieers added the wontfix This will not be worked on label Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants