feat: add standalone Last.fm integration and settings management

- Implemented standalone Last.fm integration in the settings page.
- Added functionality to manage Last.fm credentials, including API key and secret.
- Introduced sidebar settings for toggling between expanded and collapsed views.
- Enhanced the Navidrome API with new methods for fetching starred items and album songs.
- Created a new Favorites page to display starred albums, songs, and artists with play and toggle favorite options.
- Added a Badge component for UI consistency across the application.
This commit is contained in:
2025-07-01 15:19:17 +00:00
committed by GitHub
parent 591faca2d3
commit f721213c4a
10 changed files with 1078 additions and 47 deletions

View File

@@ -482,6 +482,27 @@ class NavidromeAPI {
});
return response.albumInfo2 as AlbumInfo;
}
async getStarred2(): Promise<{ starred2: { song?: Song[]; album?: Album[]; artist?: Artist[] } }> {
try {
const response = await this.makeRequest('getStarred2');
return response as { starred2: { song?: Song[]; album?: Album[]; artist?: Artist[] } };
} catch (error) {
console.error('Failed to get starred items:', error);
return { starred2: {} };
}
}
async getAlbumSongs(albumId: string): Promise<Song[]> {
try {
const response = await this.makeRequest('getAlbum', { id: albumId });
const albumData = response.album as { song?: Song[] };
return albumData?.song || [];
} catch (error) {
console.error('Failed to get album songs:', error);
return [];
}
}
}
// Singleton instance management