sbondCo / Watcharr

Open source, self-hostable watched list for all your content (movies, tv series, anime, games) with user authentication, modern and clean UI and a very simple setup.
https://watcharr.app
MIT License
358 stars 20 forks source link

Tv watched time count #579

Closed oPisiti closed 2 weeks ago

oPisiti commented 3 weeks ago

Hi :v:,

One of the few things I still see as possible upgrades is the tv watched time. As the comment on the actual code states, it is a "guesstimate".

After digging around trying to understand the codebase, I think the problem lies on the db not storing the runtime of each episode of every added show. Because of that, in order to calculate the precise time count, watcharr would need to call the TMDB API for all of it, every time the user goes to /profile, which would be a terrible use of the API, as well as pretty slow.

I imagine not storing all of this information was a deliberate decision. Are there any plans to improve the count?

I realize this isn't a priority, so I would try to implement a solution given here myself, but I do lack the expertise to do so :expressionless:. Therefore, this issue serves only to appease my curiosity.

IRHM commented 3 weeks ago

Hey @oPisiti, you are right. It mostly goes full guestimation mode because of a change with TMDB, they started to remove "usual" runtimes from shows when we request the show details (some shows still return usual runtimes I think, but most popular/new additions to the db won't).

The runtimes were moved to the individual episodes, so if we wanted to get a more accurate estimate we would probably have to get all episode runtimes manually then possible store a total_runtime in our db, then use that for the calculation.

Not sure if there's a nice way we could do that with tmdb, without needing a bunch of extra api requests. #62 seems loosely related, we'd probably need a recurring task that can update our cached version of the show to get new runtimes incase a show was updated.

Thanks for bringing this up, hopefully your curiosity is appeased!