github therobbiedavis/Listenarr 0.1.27
Canary 0.1.27

latest releases: 0.2.45, 0.2.44, 0.2.40...
pre-release2 months ago

This pull request introduces caching to the RemotePathMappingService to improve performance and reduce database load. The main change is the addition of an in-memory cache for remote path mappings per download client, ensuring that frequent lookups and checks do not repeatedly query the database. The cache is properly invalidated on create, update, and delete operations to maintain consistency.

Caching enhancements:

  • Added IMemoryCache dependency to RemotePathMappingService and initialized it via constructor injection.
  • Implemented caching in GetByClientIdAsync using GetOrCreateAsync, storing mapping lists per client for 60 seconds and ordering mappings by path length for specificity.

Cache invalidation:

  • Evicted cached mapping lists for the affected client after create, update, or delete operations to ensure subsequent lookups are up-to-date. [1] [2] [3]

Refactoring to use cache:

  • Updated TranslatePathAsync and RequiresTranslationAsync to use the cached mappings via GetByClientIdAsync, reducing unnecessary database queries for these operations. [1] [2]

Automated canary build

  • Version: 0.1.27
  • Commit: f7afd92
  • Original PR: #64

Don't miss a new Listenarr release

NewReleases is sending notifications on new releases.