elgatito / plugin.video.elementum

Elementum add-on for Kodi. Development of this addon has been stopped!
http://elementum.surge.sh
MIT License
486 stars 159 forks source link

[Feature Request] "Mark as watched in Trakt" menu item #748

Closed matke-84 closed 3 years ago

matke-84 commented 3 years ago

I have a problem so I need help. When I watch a movie or tv show, mark movie in elementum as watched, or I started watching a movie it does not appear status on my trakt account. When I mark a movie in trakt account as seen, I see it in the elementum. What am I doing wrong?

elgatito commented 3 years ago

@matke-84 I do not understand what you talk about. If you have problems with specific Trakt functionality - provide a log file.

matke-84 commented 3 years ago

I'm talking about that elementum won't syncing with my trakt account. Everything I watch or my movie is currently in progress, I don't see on my trakt account on web. In the log, you have an example where I marked the movie as watched, but it didn't appear on my trakt account. However, if I mark a movie on my trakt account as watched, it appears in the elementum as watched. So synchronization doesn't work from elementum. Here's the log. https://paste.kodi.tv/oditomanub.kodi

matke-84 commented 3 years ago

@elgatito I tried with Seren, a similar concept as elementum, syncing with trakt works properly. But Seren has implemented some trakt manager.

matke-84 commented 3 years ago

@elgatito @antonsoroko The same thing happens with the latest version. Trakt synchronization only works in one direction. Everything I watched in elementum or mark as watched doesn't show up in my tract account. On the other hand if I mark something on my trakt account as watched it appears in elementum. Does elementum have this option at all? It seems to me that this worked before.

antonsoroko commented 3 years ago

it works well for me for a long time.

the only thing that i can mention is that there is a setting called "Percents of playback to mark as watched" that controls when to mark video as watched.

also you log file is almost empty. you need to set log level to "debug" in kodi and as well in elementum (last tab).

also, please try to reproduce this issue in a fresh environment (kodi w/o any old settings and addons). maybe then you will be able to provide reproducible steps, so others can test it. (or you will determine that there is something wrong with old environment)


p.s. i do not play from kodi library, but directly from elementum, but this should not affect sync as i can see.

matke-84 commented 3 years ago

@antonsoroko Please tell me, if if you click on the movie and mark it as watched, does the sync works? Was it marked on your trakt account as watched?

antonsoroko commented 3 years ago

where - in library or in elementum?

elgatito commented 3 years ago

@matke-84 Yes, sync of watched items from Kodi to Trakt works fine. Unless you expect to sync items, not added by Elementum.

matke-84 commented 3 years ago

@antonsoroko When you mark as watched in elementum whether it appears in your trakt account that it has been watched? unnamed

elgatito commented 3 years ago

@matke-84 "Mark as watched" is a context menu item from Kodi, not Elementum, and it sets something in internal cache, Elementum is not getting any notification about that, so it does not know there is something to do with that.

antonsoroko commented 3 years ago

@matke-84 yeah, that one does not work. and i guess it never worked, even in quasar, afair. i don't really use it - i just watch and then it will be properly marked as watched. but in my plans i had "investigate if it can mark in trakt as well" task.

@elgatito btw, since we started to talk about it - will we be able to mark it also in trakt? e.g. by adding our own menu item. i guess in this case it will work (but then we also need somehow to mark it as watched in kodi ui).

matke-84 commented 3 years ago

@elgatito @antonsoroko That's what I asked. So I asked because let’s say Seren has a trakt manager and has this option in it and a few more options. I thought it worked in a similar way here. I think this option is very useful. Also seren gives me information in my skin widget that something is in progress while let's say I don't have it in the elementum. Is there a chance that something similar can be done with the elementum? I'm thinking of some additional option in the context menu.

antonsoroko commented 3 years ago

i implement some PoC - it works for movies and should work for shows/seasons/episodes - but need to test it.

@matke-84 i can provide you a test build to test it if you are interested.

also i plan to add the same to context plugin (for kodi library items).

matke-84 commented 3 years ago

@antonsoroko Of course. If you can upload on gdrive, mediafire... wherever you want. I am here to help.

antonsoroko commented 3 years ago

@matke-84

so, it should work in every place (that i was able to find, of course) in elementum and for every type (movie/show/season/episode). you need to enable library integration options in elementum: "Enable Kodi library synchronization" "Enable synchronization while playback"

but you don't need to set up library in kodi.

otherwise addon will not be able to detect if video was watched or not and provide you correct action in context menu.

To test you need to:

  1. install zip or manually replace files in .kodi/addons/plugin.video.elementum/ directory https://github.com/antonsoroko/plugin.video.elementum/archive/refs/heads/trakt-mark-as-watched.zip

  2. put binary into appropriate folder, e.g. .kodi/addons/plugin.video.elementum/resources/bin/linux_x64/ elementum.zip

  3. if you also use context addon - install zip or manually replace files in .kodi/addons/context.elementum/ directory https://github.com/antonsoroko/context.elementum/archive/refs/heads/trakt-mark-as-watched.zip

then you will see new item in menu.

thanks!

matke-84 commented 3 years ago

@antonsoroko Great. Synchronization works! But now I don't have any notification that something has been watched in elementum. Can that be sorted out? Also in elementum I get in the menu option to synchronize with the trakt but in the widget of my skin no. So I have to get into elementum to sync. Is there a chance it is being optimized to work with skin widgets. Skin is Titan bingie mode and I am one of the developers of this skin. It would be really nice if a little optimization for the skin was done. Seren, for example, works well with skin, but there is no streaming addon can compare with elementum.

antonsoroko commented 3 years ago

@matke-84

But now I don't have any notification that something has been watched in elementum.

what do you mean?

Is there a chance it is being optimized to work with skin widgets.

what do you mean exactly? :-)

but in the widget of my skin no.

what menu items do you have there?

can you please provide some visual example.

i do not use fancy skins, and I do not have any notifications, so i don't really understand what exactly you mean.

also, is there any standard skin that provides widget like yours? (i mean skin that is available directly from kodi 19 repo)

antonsoroko commented 3 years ago

if you mean something like this image

then it is not up to elementum as i can see. it is "drawn" by kodi, so only kodi menu is here, but you can use context menu addon.

if you mean something different - please show screenshots and provide info for my questions from previous message.

matke-84 commented 3 years ago

@antonsoroko Ok. As for wotched notification in the elementum works. There was my mistake. I was off because of some testing. As for optimization for skins, this is for example. seren tv shows In Seren, these numbers set the number of non watched episodes. In elementum it doesn't work. elementum widgets Also ther is no movie progress in widgets. In Seren works. progress seren In the widgets, I don't have a new option watched in trakt. new menu2 new menu In Seren I get things like in local base. Elementum behaves a little differently. Seren has implemented trakt manager and it works fine. Seren trakt manager Seren trakt manager2

matke-84 commented 3 years ago

@antonsoroko The essence of elementum is not these things but the stream, I read in another comment that people asked to implement a fanart manager as in tmdb helper. It's also a nice idea. In addition to the functionality that is most important, I also like the nice look. That's why I got into the story with the skins in kodi. These are all things I would like to see in the elementum of course if it is possible to implement. But even if this is not possible, this remains best addon for the kodi.

antonsoroko commented 3 years ago

@matke-84 there are a lot of info, so let's deal with this one by one.

1.

In Seren, these numbers set the number of non watched episodes. In elementum it doesn't work.

i think you already described this before here https://github.com/elgatito/plugin.video.elementum/issues/684#issuecomment-813625047

this probably can be done. but it will take some effort since trakt does not give this info "out of the box". so after call https://trakt.docs.apiary.io/#reference/shows/popular/get-popular-shows that elemetum already does we also need to call https://trakt.docs.apiary.io/#reference/sync/get-watched/get-watched and then calculate somehow difference to show watched/unwatched numbers.

i would suggest to split that old issue into 2 separate issues. it is hard to deal with multi request issues. so they are usually ignored.

particularity i do not need this info, but maybe it can be implemented just for fun, when there will be a free time.

2.

Also ther is no movie progress in widgets. In Seren works.

do you have it in elementum UI? (not via widgets) if not - it should be implemented first, so separate issue.

(looks like my skin takes this info from kodi, not from elementum (trakt). so it is shown only if i started to watch video in kodi+elementum )

3.

In the widgets, I don't have a new option watched in trakt.

looks like widgets are really weird entities (at least as i can see in skin.aeon.nox.silvo) so it might be hard to deal with them (and benefit is minimal).

to confirm i need you to install https://github.com/antonsoroko/context.elementum/archive/refs/heads/trakt-mark-as-watched-TEST.zip

and then click "elementum menu..."->"info" you will see a message in UI and then in log file you will see something like "truelabel: %s; infolabel: %s; dbid: %s; mediatype: %s; path: %s;"

copy only this log line and post here please.

4.

Seren has implemented trakt manager and it works fine.

I am happy for them :-) But as you correctly mentioned elementum is not a trakt manager. It is expected that when you watch video in elementum it will be marked in trakt (and this works). And if you watch video outside elementum - you will mark this video outside elementum too. sounds logical to me. but this particular use case (mark as watched) - to get full answer i need your answer for question 3 first.

5.

In Seren I get things like in local base. Elementum behaves a little differently.

by looking into your screenshot it looks like they do not use context menu but dialog. and in code it also looks like it https://github.com/nixgates/plugin.video.seren/blob/2e526cbdb4d3fa12078bb76946c92af8704aa27d/resources/lib/indexers/trakt.py#L1044

we do not use things like this. if something inside elementum (i mean in elementum "folders") - we create menu items in main addon and pass them to kodi. there we have all this info if something outside elementum (i mean kodi library, widgets, etc) - we create menu items in "context menu" addon and pass them to kodi. there we have only info provided by kodi (e.g. from library). we can get some info from elementum, like i did for "assign torrent" but it is very hacky. maybe Seren includes some breadcrumbs into "items" to make things easier.

to make things easier for "outside of elemetum" items we would have to do a lot of redesign and maybe some ui work too. personally i do not want to deal with all this hard work since for me benefits of that work will be from zero to none :-)

matke-84 commented 3 years ago

@antonsoroko First of all, I really want to thank you for such an extensive answer and thank you and @elgatito for keeping this fantastic addon alive. So let's go. :-)

  1. Yes, I know, I asked a question about movie studios information and information about number of seasons and episodes per season. Information about movies studios was arranged by @elgatito. I just asked him further if there could be network information instead of studio information for the tv shows. I think for tv shows this is better information about network (hbo, netflix...). This second thing about the number of seasons and episodes per season can be interesting information, so if you ever has free time try to implement.
  2. Yes. In elementum UI works. progress But there is no such information in the widgets. I would really like to see this feature in widgets. I would be very grateful if this could be implemented.
  3. I agree. Widgets with different addons behaves differently. Log

    2021-06-08 20:50:31.517 T:13868 WARNING : [context.elementum] truelabel: The Lord of the Rings: The Two Towers; infolabel: The Lord of the Rings: The Two Towers; dbid: ; mediatype: movie; path: plugin://plugin.video.elementum/movie/121/links/The%20Lord%20of%20the%20Rings:%20The%20Two%20Towers%20%282002%29; 2021-06-08 20:50:31.517 T:13868 INFO : CPythonInvoker(59, C:\Users\Marko\AppData\Roaming\Kodi\addons\context.elementum\context_menu.py): script successfully run 2021-06-08 20:50:31.517 T:13868 DEBUG : CPythonInvoker::onExecutionDone(59, C:\Users\Marko\AppData\Roaming\Kodi\addons\context.elementum\context_menu.py) 2021-06-08 20:50:31.530 T:14164 DEBUG : ------ Window Init (DialogNotification.xml) ------

  4. I don't know how much that is possible in the elementum, but in the TMDB helper menu there are a lot of useful things, including the trakt menu, brows lists, manage artwork... Try it tmdb helper and see what these features bring to not to explain each one individually now. Really interesting features. tmdb helper menu
  5. Fair enough. ;-)
antonsoroko commented 3 years ago

@matke-84

1) what i meant is that it is better to split feature requests into small ones. one issue - one task. and it is easier to keep track of them and to search among them.

2) on you screenshot i do not see any progress % but i am sure that we do not expose such info, we just use kodi feature (if you watch in kodi - kodi stores progress and provides it to skins so the can attach labels). so if you watched outside of kodi - no progress. if other plugins really read % from trakt and then expose this info to kodi - then i guess we also need a person who will implement this :-)

3) this confirms bad news. for widget kodi takes item from plugin but uses menu from kodi. so in the end it does not belong to elementum nor to kodi. thus to correctly handle such item elementum would have to put some breadcrumbs. we already have some, but not enough to make things easy for context addon. in a nutshell - it can be done, but it will take some effort and i am not sure that value of this feature (to be able to mark as watched something that you decided not to watch in elementum via elementum widget) worth it. if i will have some free boring time - i will try to fix it.

4) >but in the TMDB helper menu there are a lot of useful things

i guess TMDB helper menu works only for library items but not for elementum's or other video plugin's items?
our context plugin also works perfectly with kodi items since they are standardized (library has IDs that addons can use to interact with external websites).
matke-84 commented 3 years ago

@antonsoroko

  1. OK. I will separate them.
  2. Look The Dark Knight in corner. :-)
  3. Ok. Thanks.
  4. The TMDB helper works similarly as elementum. So it has its own lists and doesn’t work just with the local library. The only thing it doesn't have is a player but you can force an elementum to play a movie. All these functions that I mentioned works with the online database. That's why I told you to try it. A lot of useful things can be applied in the elementum. ;-)
antonsoroko commented 3 years ago

2 then it is strange that widget does not have it.

4 does it show the same menu for widgets?

matke-84 commented 3 years ago

@antonsoroko

  1. Well, it's not clear to me either. That's why I asked.
  2. Yes, screenshots are from the widgets.
antonsoroko commented 3 years ago
  1. i guess they somehow store all the necessary info inside the kodi ListItem object (or similar), while we put majority of the info inside our own database. i would need to check somehow if my guess is correct. if it is correct, then maybe we also can try to put some breadcrumbs into ListItem to make things easier.

i mean items generated by kodi library have bunch of IDs, if we can also put some IDs into items generated by us - then it will be easy to get these IDs from context menu addon and use these IDs to make requests to elementum API.

matke-84 commented 3 years ago

@antonsoroko This is great news. I hope for the best. I'm here if you need some help, testing...

antonsoroko commented 3 years ago

@matke-84 please rename this issue to [Feature Request] "Mark as watched in Trakt" menu item

matke-84 commented 3 years ago

@matke-84 please rename this issue to [Feature Request] "Mark as watched in Trakt" menu item

@antonsoroko Done. ;-)