mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-10 16:08:39 -05:00
Add MusicBrainz API integration for metadata enrichment
- Added MusicBrainzSettings model with username/password authentication - Created MusicBrainzService with ISRC lookup and recording search - Implements proper rate limiting (1 req/sec) per MusicBrainz rules - Added meaningful User-Agent header as required - Registered service in Program.cs with configuration - Added MusicBrainz section to appsettings.json - Credentials stored in .env (MUSICBRAINZ_USERNAME/PASSWORD) Next: Add to admin UI and implement import/export for .env
This commit is contained in:
21
allstarr/Models/Settings/MusicBrainzSettings.cs
Normal file
21
allstarr/Models/Settings/MusicBrainzSettings.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace allstarr.Models.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// Settings for MusicBrainz API integration.
|
||||
/// </summary>
|
||||
public class MusicBrainzSettings
|
||||
{
|
||||
public bool Enabled { get; set; } = true;
|
||||
public string? Username { get; set; }
|
||||
public string? Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Base URL for MusicBrainz API.
|
||||
/// </summary>
|
||||
public string BaseUrl { get; set; } = "https://musicbrainz.org/ws/2";
|
||||
|
||||
/// <summary>
|
||||
/// Rate limit: 1 request per second for unauthenticated, 1 per second for authenticated.
|
||||
/// </summary>
|
||||
public int RateLimitMs { get; set; } = 1000;
|
||||
}
|
||||
Reference in New Issue
Block a user