RaunoT / plex-rewind

Present Plex user statistics and habits in a beautiful and organized manner à la Spotify Wrapped.
GNU General Public License v3.0
69 stars 5 forks source link

Ability to view Rewind for a previous year #55

Open RaunoT opened 6 months ago

RaunoT commented 6 months ago

Description

We should be able to optionally set the year for which we want to see the Rewind for. Currently it's showing it for the ongoing year only.

Desired behavior

The Rewind year could be set in the .env file.

Additional context

No response

RaunoT commented 6 months ago

The issue I'm facing with implementing this currently is that we're using get_home_stats to fetch the "Top 5" media items from Tautulli, but that query only supports time_range. I was thinking we could use get_history, which supports the before and after params, but for shows/audio, it only returns the single items (episode or track) instead of the grouped parent.

Having had a quick look, it seems like aunefyren/wrapperr is using get_history to basically pull in all the information and transform it as needed. I'm not a fan of this approach, since from what I can understand, his app builds all the data at buildtime, plex-rewind fetches it dynamically/real-time which is not a behaviour I'm looking to change.

RaunoT commented 6 months ago

A workaround solution, or even a permanently different approach, would be to just always get Rewind for the past 365 days instead of the current year.

Would love to hear what others think.

tarunkumar519 commented 6 months ago

getting rewind for the past year by default seems great. Only few people may want to use rewind for a year at the end of current year. By default getting rewind for last year should be enough.

RaunoT commented 5 months ago

This behaviour has been altered in 1.7.1. Until get_home_stats can be updated, Rewind will get data for the past 365 days instead of the astronomical year. Dashboard "this year" has also been changed to "past year".