Skip to content

✨ [Feature Request] Ability to combine multiple addon paths with item de-duplication (e.g. for a custom "Continue Watching" widget). #116

Description

@OfficerKD637

Hey Red!

Hope you've been doing well!

Firstly, big kudos to you for the amazing job on this addon! It has truly shaped up to be one of the best (if not THE best 😜) in such a short period of time! Thank you so much for all that you do for the community!

Apologies in advance for the long post...

I would like to create two custom widgets:

  1. Continue Watching (like the one on the Trakt website) by merging 3 paths - In Progress Movies, In Progress Episodes and Next Episodes.
    There also needs to be item de-duplication for the last two paths (In Progress Episodes and Next Episodes). I am aware that the Next Episodes path already contains partially watched episodes, but that's only the case for TV Shows that you have already started watching (i.e., watchedepisodes > 1). Any partially watched episode of a new TV Show (watchedepisodes = 0) only comes up in In Progress Episodes.
    It would also be nice to have everything sorted by the lastwatched parameter.

  2. A combined Watchlist for both movies and TV Shows sorted by the lastadded parameter.

Currently, I achieve this by using the Dynamic Nodes feature of the Skin Variables addon https://github.com/jurialmunkey/script.skinvariables

It works great but there are a few nitpicks that I feel could be resolved with a native solution in Red Light

As an example:
Several skins use $INFO[ListItem.EndTimeResume] to report the Ends At time of partially watched items. This works perfectly if the skin is pointed directly towards any of the Red Light widget paths.
But if I use a Skin Variables Dynamic Node to combine all 3 paths, it reports the incorrect $INFO[ListItem.EndTimeResume] value (i.e., it doesn't take the resume point into account).
Example: You start watching a 2 hour movie and pause it halfway. You want to finish the rest of it tomorrow, so you start watching it at 7PM the next day. The correct $INFO[ListItem.EndTimeResume] should be 8PM but it still shows up as 9PM

I reached out to the dev and they said:

End plugin should set total time and then it will work

info_tag.setResumePoint(resume_time, total_time)
https://xbmc.github.io/docs.kodi.tv/master/kodi-base/d9/dc2/group__python___info_tag_video.html#gac4af7bb610e112d28f5df8acf639d1f0

You can't have a percentage value without a denominator otherwise it's a divide by zero error.

Technically you can have a resume point without total time but it doesn't make a whole lot of sense (unless maybe for a live stream where you don't know the total duration yet)

The issue with adding a resume point without total time is SV can't calculate progress -- so I skip if there's no total time set. If I did add it, the "bug" report would be instead "why does this resumable item have 0% progress".

The reason it "works" from the addon is because the addon is setting a custom property to show progress and the skin you're using supports that custom property ("WatchedProgress" is not a standard Kodi progress property - just something I was using in TMDbHelper to show progress for tvshows and other addons started adopting it).

Likely the addon is doing it this way for legacy reasons (before Omega resume points were a bit awkward in plugins) and doesn't realise the new method supports total time. It has the duration right there (otherwise it couldn't calculate progress) it's just not passing it through.

So I followed their advice and tried changing these

info_tag.setResumePoint(watched_status.get_resume_seconds(progress, duration))

info_tag.setResumePoint(ws.get_resume_seconds(progress, duration))

info_tag.setResumePoint(ws.get_resume_seconds(progress, duration))

to this

info_tag.setResumePoint(watched_status.get_resume_seconds(progress, duration), float(duration))
info_tag.setResumePoint(ws.get_resume_seconds(progress, duration), float(duration))

And it worked!

My only guess is that Red Light deliberately didn't set the totaltime in info_tag.setResumePoint() to bypass Kodi's internal 'Resume' function (the option you get in the context menu that looks something like "Resume from HH:MM:SS" for resumable items).
Although, the user can set this behaviour directly in Kodi (Settings > Media > Videos > Default play action) perhaps the addon wanted Kodi to treat it like an unplayed listitem and handle the resume function itself.

I am not sure if this has any adverse effects somewhere else in the addon (or if there's another reason that I'm missing).

Would be really grateful if you could shed some light on this.

Thank you once again!

Metadata

Metadata

Assignees

No one assigned

    Labels

    new featureOne for the future, nice to have, etc.red lightRed Light plugin

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions