Refactor UI components for improved spacing; add UserProfile component for user info display

This commit is contained in:
2025-07-25 17:35:07 +00:00
committed by GitHub
parent 74b9648eef
commit 25e9bd6912
11 changed files with 309 additions and 87 deletions

View File

@@ -110,6 +110,26 @@ export interface ArtistInfo {
similarArtist?: Artist[];
}
export interface User {
username: string;
email?: string;
scrobblingEnabled: boolean;
maxBitRate?: number;
adminRole: boolean;
settingsRole: boolean;
downloadRole: boolean;
uploadRole: boolean;
playlistRole: boolean;
coverArtRole: boolean;
commentRole: boolean;
podcastRole: boolean;
streamRole: boolean;
jukeboxRole: boolean;
shareRole: boolean;
videoConversionRole: boolean;
avatarLastChanged?: string;
}
class NavidromeAPI {
private config: NavidromeConfig;
private clientName = 'miceclient';
@@ -171,6 +191,12 @@ class NavidromeAPI {
}
}
async getUserInfo(): Promise<User> {
const response = await this.makeRequest('getUser', { username: this.config.username });
const userData = response.user as User;
return userData;
}
async getArtists(): Promise<Artist[]> {
const response = await this.makeRequest('getArtists');
const artists: Artist[] = [];