diff --git a/internal/handlers/anime_collection.go b/internal/handlers/anime_collection.go index 4556ba1a..686dc163 100644 --- a/internal/handlers/anime_collection.go +++ b/internal/handlers/anime_collection.go @@ -3,12 +3,10 @@ package handlers import ( "errors" "github.com/seanime-app/seanime/internal/library/anime" - "github.com/seanime-app/seanime/internal/util" "github.com/seanime-app/seanime/internal/util/limiter" - "github.com/seanime-app/seanime/internal/util/result" ) -var libraryCollectionMap = result.NewResultMap[string, *anime.LibraryCollection]() +//var libraryCollectionMap = result.NewResultMap[string, *anime.LibraryCollection]() // HandleGetLibraryCollection // @@ -28,11 +26,12 @@ func HandleGetLibraryCollection(c *RouteCtx) error { return c.RespondWithError(err) } - ret, ok := libraryCollectionMap.Get(util.GetMemAddrStr(anilistCollection)) - if ok { - c.App.Logger.Debug().Msg("api: Library collection cache HIT") - return c.RespondWithData(ret) - } + // DEVNOTE: Bad + //ret, ok := libraryCollectionMap.Get(util.GetMemAddrStr(anilistCollection)) + //if ok { + // c.App.Logger.Debug().Msg("api: Library collection cache HIT") + // return c.RespondWithData(ret) + //} lfs, _, err := c.App.Database.GetLocalFiles() if err != nil { @@ -50,12 +49,12 @@ func HandleGetLibraryCollection(c *RouteCtx) error { return c.RespondWithError(err) } - go func() { - if libraryCollection != nil { - libraryCollectionMap.Clear() - libraryCollectionMap.Set(util.GetMemAddrStr(anilistCollection), libraryCollection) - } - }() + //go func() { + // if libraryCollection != nil { + // libraryCollectionMap.Clear() + // libraryCollectionMap.Set(util.GetMemAddrStr(anilistCollection), libraryCollection) + // } + //}() return c.RespondWithData(libraryCollection) } diff --git a/internal/handlers/anime_entries.go b/internal/handlers/anime_entries.go index 7cf3ebd2..f5b53924 100644 --- a/internal/handlers/anime_entries.go +++ b/internal/handlers/anime_entries.go @@ -14,7 +14,6 @@ import ( "github.com/seanime-app/seanime/internal/library/anime" "github.com/seanime-app/seanime/internal/library/scanner" "github.com/seanime-app/seanime/internal/library/summary" - "github.com/seanime-app/seanime/internal/util" "github.com/seanime-app/seanime/internal/util/limiter" "github.com/seanime-app/seanime/internal/util/result" "github.com/sourcegraph/conc/pool" @@ -452,7 +451,7 @@ func HandleAnimeEntryManualMatch(c *RouteCtx) error { //---------------------------------------------------------------------------------------------------------------------- -var missingEpisodesMap = result.NewResultMap[string, *anime.MissingEpisodes]() +//var missingEpisodesMap = result.NewResultMap[string, *anime.MissingEpisodes]() // HandleGetMissingEpisodes // @@ -471,11 +470,12 @@ func HandleGetMissingEpisodes(c *RouteCtx) error { return c.RespondWithError(err) } - ret, ok := missingEpisodesMap.Get(util.GetMemAddrStr(anilistCollection)) - if ok { - c.App.Logger.Info().Msg("api: Library collection cache HIT") - return c.RespondWithData(ret) - } + // DEVNOTE: Bad + //ret, ok := missingEpisodesMap.Get(util.GetMemAddrStr(anilistCollection)) + //if ok { + // c.App.Logger.Info().Msg("api: Library collection cache HIT") + // return c.RespondWithData(ret) + //} lfs, _, err := c.App.Database.GetLocalFiles() if err != nil { @@ -493,12 +493,12 @@ func HandleGetMissingEpisodes(c *RouteCtx) error { MetadataProvider: c.App.MetadataProvider, }) - go func() { - if missingEps != nil { - missingEpisodesMap.Clear() - missingEpisodesMap.Set(util.GetMemAddrStr(anilistCollection), missingEps) - } - }() + //go func() { + // if missingEps != nil { + // missingEpisodesMap.Clear() + // missingEpisodesMap.Set(util.GetMemAddrStr(anilistCollection), missingEps) + // } + //}() return c.RespondWithData(missingEps)