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

feat : invalidate link cache after 20 mins #875

Merged
merged 1 commit into from Jan 17, 2024
Merged

feat : invalidate link cache after 20 mins #875

merged 1 commit into from Jan 17, 2024

Conversation

ghost
Copy link

@ghost ghost commented Jan 13, 2024

  • additionaly clear cache if there is player errors or no links found

@fire-light42
Copy link
Collaborator

No this changes the MainAPI fucking over all extentions, all the logic should be in the repolinkgenerator cache

@ghost
Copy link
Author

ghost commented Jan 13, 2024

No this changes the MainAPI fucking over all extentions, all the logic should be in the repolinkgenerator cache

which logic are you referring?

ee910dc#diff-ba49ab6ae34dc2f098fe94921fee4510f8af94c8a96610fe82865151625ff010R94

@ghost
Copy link
Author

ghost commented Jan 13, 2024

@fire-light42 I think I got you what you meant. pls check now.

@@ -19,6 +20,7 @@ class RepoLinkGenerator(
const val TAG = "RepoLink"
val cache: HashMap<Pair<String, Int>, Pair<MutableSet<ExtractorLink>, MutableSet<SubtitleData>>> =
hashMapOf()
var lastCachedTimestamp = unixTime
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be in the cache instead, so Pair<MutableSet<ExtractorLink>, MutableSet<SubtitleData>> becomes a triple or a dataclass with the timestamp on it. it makes no sense to not clear the links because you watch another episode inbetween

Copy link
Author

Choose a reason for hiding this comment

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

done. should clear cache run in loop?

- additionaly clear cache if there is player errors or no links found
@fire-light42 fire-light42 merged commit ebb72d6 into recloudstream:master Jan 17, 2024
2 checks passed
@ghost ghost deleted the invalidate-link-cache branch January 18, 2024 01:54
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.

None yet

1 participant