feat: Implement Auto-Tagging Settings and MusicBrainz integration

- Added AutoTaggingSettings component for configuring auto-tagging preferences.
- Integrated localStorage for saving user preferences and options.
- Developed useAutoTagging hook for fetching and applying metadata from MusicBrainz.
- Created MusicBrainz API client for searching and retrieving music metadata.
- Enhanced metadata structure with additional fields for tracks and albums.
- Implemented rate-limiting for MusicBrainz API requests.
- Added UI components for user interaction and feedback during the tagging process.
This commit is contained in:
2025-08-10 15:02:49 +00:00
committed by GitHub
parent cfd4f88b5e
commit ba91d3ee28
10 changed files with 1904 additions and 37 deletions

View File

@@ -215,12 +215,21 @@ class NavidromeAPI {
}
async getArtist(artistId: string): Promise<{ artist: Artist; albums: Album[] }> {
const response = await this.makeRequest('getArtist', { id: artistId });
const artistData = response.artist as Artist & { album?: Album[] };
return {
artist: artistData,
albums: artistData.album || []
};
try {
const response = await this.makeRequest('getArtist', { id: artistId });
// Check if artist data exists
if (!response.artist) {
throw new Error('Artist not found in response');
}
const artistData = response.artist as Artist & { album?: Album[] };
return {
artist: artistData,
albums: artistData.album || []
};
} catch (error) {
console.error('Navidrome API request failed:', error);
throw new Error('Artist not found');
}
}
async getAlbums(type?: 'newest' | 'recent' | 'frequent' | 'random' | 'alphabeticalByName' | 'alphabeticalByArtist' | 'starred' | 'highest', size: number = 500, offset: number = 0): Promise<Album[]> {