feat: add server-side configuration with default theme (#90)

* docs: add example for usage of the main listenbrainz instance (#71)

* docs: add example for usage of the main listenbrainz instance

* Update scrobbler.md

---------

Co-authored-by: Gabe Farrell <90876006+gabehf@users.noreply.github.com>

* feat: add server-side cfg and default theme

* fix: repair custom theme

---------

Co-authored-by: m0d3rnX <jesper@posteo.de>
This commit is contained in:
Gabe Farrell 2025-11-18 18:37:05 -05:00 committed by Gabe Farrell
parent 621ca63b6b
commit 68d922ce55
4 changed files with 254 additions and 206 deletions

View file

@ -157,6 +157,10 @@ function submitListen(id: string, ts: Date): Promise<Response> {
});
}
function getCfg(): Promise<Config> {
return fetch(`/apis/web/v1/config`).then(r => r.json() as Promise<Config>)
}
function getApiKeys(): Promise<ApiKey[]> {
return fetch(`/apis/web/v1/user/apikeys`).then(
(r) => r.json() as Promise<ApiKey[]>
@ -277,6 +281,7 @@ function getNowPlaying(): Promise<NowPlaying> {
}
export {
<<<<<<< HEAD
getLastListens,
getTopTracks,
getTopAlbums,
@ -308,6 +313,37 @@ export {
submitListen,
getNowPlaying,
};
=======
getLastListens,
getTopTracks,
getTopAlbums,
getTopArtists,
getActivity,
getStats,
search,
replaceImage,
mergeTracks,
mergeAlbums,
mergeArtists,
imageUrl,
login,
logout,
getCfg,
deleteItem,
updateUser,
getAliases,
createAlias,
deleteAlias,
setPrimaryAlias,
getApiKeys,
createApiKey,
deleteApiKey,
updateApiKeyLabel,
deleteListen,
getAlbum,
getExport,
}
>>>>>>> 5d0491a (feat: add server-side configuration with default theme (#90))
type Track = {
id: number;
title: string;
@ -390,6 +426,7 @@ type ApiKey = {
created_at: Date;
};
type ApiError = {
<<<<<<< HEAD
error: string;
};
type Config = {
@ -417,3 +454,27 @@ export type {
Config,
NowPlaying,
};
=======
error: string
}
type Config = {
default_theme: string
}
export type {
getItemsArgs,
getActivityArgs,
Track,
Artist,
Album,
Listen,
SearchResponse,
PaginatedResponse,
ListenActivityItem,
User,
Alias,
ApiKey,
ApiError,
Config
}
>>>>>>> 5d0491a (feat: add server-side configuration with default theme (#90))