caching for "files" and images + moved search result types

This commit is contained in:
partisan 2024-05-24 14:07:16 +02:00
parent 5a66f61a4c
commit 7668ee5eca
7 changed files with 253 additions and 124 deletions

View file

@ -32,18 +32,6 @@ var (
mu sync.Mutex
)
// VideoResult reflects the structured data for a video result
type VideoResult struct {
Href string
Title string
Date string
Views string
Creator string
Publisher string
Image string
Duration string
}
// VideoAPIResponse matches the structure of the JSON response from the Piped API
type VideoAPIResponse struct {
Items []struct {
@ -99,11 +87,8 @@ func checkDisabledInstancesPeriodically() {
ticker := time.NewTicker(retryDuration)
defer ticker.Stop()
for {
select {
case <-ticker.C:
checkAndReactivateInstances()
}
for range ticker.C {
checkAndReactivateInstances()
}
}