feat: modernize dashboard widgets
This commit is contained in:
1 parent
f3048f4804
commit
a2763d1f6f
261 files changed
+9392
-2697
No files matched your search
@@ -54,6 +54,7 @@ export class AudiobookshelfIntegration extends Integration {
|
||||
|
||||
const statsByLibrary = await Promise.all(
|
||||
libraries.map(async (library) => ({
|
||||
library,
|
||||
mediaType: library.mediaType,
|
||||
stats: await this.getLibraryStatsAsync(library.id),
|
||||
})),
|
||||
@@ -75,6 +76,14 @@ export class AudiobookshelfIntegration extends Integration {
|
||||
totalPodcasts: counts.totalPodcasts,
|
||||
totalListeningTimeSeconds: listeningStats.totalTime,
|
||||
activeSessions,
|
||||
libraries: statsByLibrary.map(({ library, stats }) => ({
|
||||
id: library.id,
|
||||
name: library.name,
|
||||
mediaType: library.mediaType,
|
||||
totalItems: stats.totalItems,
|
||||
totalDurationSeconds: stats.totalDuration ?? null,
|
||||
totalSizeBytes: stats.totalSize ?? null,
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,14 @@ export interface AudiobookshelfDashboardData {
|
||||
totalPodcasts: number;
|
||||
totalListeningTimeSeconds: number;
|
||||
activeSessions: number;
|
||||
libraries?: {
|
||||
id: string;
|
||||
name: string;
|
||||
mediaType: "book" | "podcast";
|
||||
totalItems: number;
|
||||
totalDurationSeconds: number | null;
|
||||
totalSizeBytes: number | null;
|
||||
}[];
|
||||
}
|
||||
|
||||
export type AudiobookshelfLibrary = z.infer<typeof audiobookshelfLibrarySchema>;
|
||||
|
||||
Reference in new issue
Block a user