mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 23:55:10 -05:00
- 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
22 lines
618 B
C#
22 lines
618 B
C#
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;
|
|
}
|