github therobbiedavis/Listenarr 0.2.18
Canary 0.2.18

latest releases: 0.2.45, 0.2.44, 0.2.40...
pre-releaseone month ago

This pull request streamlines the way default metadata API sources are seeded in the application by moving this logic from the application startup code into a dedicated database migration. Additionally, it makes a minor refactor in the SearchService to simplify a method signature and its implementation.

Migration and Database Initialization Changes:

  • Added a new migration AddDefaultMetadataSources that inserts default metadata API sources ("Audimeta" and "Audnexus") directly into the ApiConfigurations table if they do not already exist, and removes them on rollback. This ensures these sources are always present after migrations and prevents duplicate entries.
  • Removed the manual seeding logic for default metadata API sources from the startup code in Program.cs, relying instead on the migration to handle this automatically. This reduces code complexity and centralizes data initialization.

Code Refactoring:

  • Refactored ConvertMetadataToSearchResultAsync in SearchService.cs to be a synchronous method that returns a Task<SearchResult> using Task.FromResult, instead of being marked as async. This simplifies the method since it does not perform any asynchronous operations. [1] [2] [3]Removes runtime seeding of Audimeta and Audnexus metadata API sources from Program.cs and adds their creation to a new EF migration. Also refactors SearchService to make ConvertMetadataToSearchResultAsync synchronous, returning a Task directly.

Automated canary build

Don't miss a new Listenarr release

NewReleases is sending notifications on new releases.