github therobbiedavis/Listenarr 0.1.19
Canary 0.1.19

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

This pull request refactors how session authentication is handled based on configuration, simplifying dependency injection and removing nullable checks for the session service. The session service is now always registered, but only provides functionality if authentication is required, improving code clarity and maintainability. The most significant changes are grouped below.

Dependency Injection and Service Registration:

  • Replaced conditional registration of ISessionService in Program.cs with unconditional registration of a new ConditionalSessionService that internally checks configuration to determine if session functionality should be enabled. (listenarr.api/Program.cs, listenarr.api/Program.csL98-R99)
  • Introduced ConditionalSessionService, a wrapper that delegates to SessionService only when authentication is enabled, throwing exceptions or returning defaults otherwise. (listenarr.api/Services/ConditionalSessionService.cs, listenarr.api/Services/ConditionalSessionService.csR1-R89)

Controller and Middleware Refactoring:

  • Removed nullable checks for ISessionService in AccountController and updated constructor and usages to always expect a non-null session service, handling disabled authentication via exceptions. (listenarr.api/Controllers/AccountController.cs, [1] [2] [3] [4]
  • Updated SessionAuthenticationMiddleware to resolve ISessionService via IServiceProvider ins...

Automated canary build

  • Version: 0.1.19
  • Commit: b4e4fc0
  • Original PR: #48

Don't miss a new Listenarr release

NewReleases is sending notifications on new releases.