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

Implementing before/after for get_home_stats #2231

Open
RaunoT opened this issue Jan 3, 2024 · 1 comment
Open

Implementing before/after for get_home_stats #2231

RaunoT opened this issue Jan 3, 2024 · 1 comment

Comments

@RaunoT
Copy link

RaunoT commented Jan 3, 2024

Is your feature request related to a problem?

I'm developing a new community app called plex-rewind, which serves as a sharable Dashboard and Spotify Wrapped style Rewind.

To get the users Top 5 (for a given year), I'm using get_home_stats and the time_range param. I'm using a simple function to calclulate how many days ago the current year started and set it as the time_range.

I'm now looking to implement new functionality to enable users to see their Rewind for previous years, however, I'm not able to use get_home_stats for it, since I'm unable to exclude results after a certain date.

What is your feature request?

For get_home_stats to support before/after params like get_history.

Are there any workarounds?

I was hoping I could use get_history, which supports before and after params. But for shows/audio, it only returns single items (episode or track) instead of the grouped parent.

I could theoretically write some complex logic to add up all the single items, then fetch their parents etc.. but it would be quite costly for a dynamic/real-time app, which is how I'm looking to build it.

Additional Context

Here's my getRewind utility, which uses the getTopMediaItems() I'm looking to alter: https://github.com/RaunoT/plex-rewind/blob/develop/src/utils/getRewind.ts#L139

Copy link

This feature has been added and will be available in the next release of Tautulli. This issue will be automatically closed once the update is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants