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

Add Caching for api calls #118

Merged
merged 7 commits into from
Mar 8, 2024
Merged

Add Caching for api calls #118

merged 7 commits into from
Mar 8, 2024

Conversation

scampower3
Copy link
Member

Caches the results from api calls for an hour. Caches Languages and ArtworkTypes for a day

Copy link
Contributor

@Shadowghost Shadowghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we want an option to reset the cache

@scampower3
Copy link
Member Author

@Shadowghost added a task with no default trigger to allow for purging of the cache

@BobSilent
Copy link
Contributor

BobSilent commented Mar 4, 2024

I would have preferred a simple button in the settings to purge all TVdB cached data only. E.g. by adding a cancelationtoken to each entry when adding to cache.
When someone in the plug-in configuration UI, (where today only the API key is) presses the (new) clear cache button, this token would be canceled and a new token for new entries created.

.Compact() tries too free up cache in general. But I understand

Maybe we want an option to reset the cache

As an option to resetting our cached data without the need to restart the whole application.

Also I would like to have the cache time (e.g. min. Or hours only) configurable in the plug-in configuration ui, and maybe also disabled by setting the value to 0.

@scampower3
Copy link
Member Author

scampower3 commented Mar 4, 2024

I would have preferred a simple button in the settings to purge all TVdB cached data only. E.g. by adding a cancelationtoken to each entry when adding to cache. When some in config presses the clear cache button, this token would be canceled and a new token for new entries created.

.Compact() tries too free up cache in general. But I understand

Maybe we want an option to reset the cache

As an option to resetting our cached data without the need to restart the whole application.

Also I would like to have the cache time configurable, and maybe also disabled by setting to 0.

I do have another branch that allows for time configuration for cache. Will create the PR for that once this get merged.

@crobibero crobibero merged commit 947fbe5 into jellyfin:master Mar 8, 2024
4 checks passed
@scampower3 scampower3 deleted the cache branch March 8, 2024 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants