From 1dfd781c931a5338bc676e60b62babefd3163806 Mon Sep 17 00:00:00 2001 From: SergeiTarkhanov Date: Sat, 6 Sep 2025 22:13:10 +0300 Subject: [PATCH] Feat: add multi-type support for emby library stats --- docs/customservices.md | 2 +- src/components/services/Emby.vue | 23 ++++++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/docs/customservices.md b/docs/customservices.md index c1f0812..158d7ff 100644 --- a/docs/customservices.md +++ b/docs/customservices.md @@ -139,7 +139,7 @@ You need to set the type to Emby, provide an api key and choose which stats to s url: "http://192.168.0.151/" type: "Emby" apikey: "<---insert-api-key-here--->" - libraryType: "music" #Choose which stats to show. Can be one of: music, series or movies. + libraryType: "music" # Choose which stats to show. Can be: music, movies, series, or multiple types separated by | (e.g., "music|movies") ``` ## FreshRSS diff --git a/src/components/services/Emby.vue b/src/components/services/Emby.vue index 5aa5f0d..27771b7 100644 --- a/src/components/services/Emby.vue +++ b/src/components/services/Emby.vue @@ -38,13 +38,22 @@ export default { }), computed: { embyCount: function () { - if (this.item.libraryType === "music") - return `${this.songCount} songs, ${this.albumCount} albums`; - else if (this.item.libraryType === "movies") - return `${this.movieCount} movies`; - else if (this.item.libraryType === "series") - return `${this.episodeCount} eps, ${this.seriesCount} series`; - else return `wrong library type 💀`; + const types = this.item.libraryType.split('|'); + const results = []; + + for (const type of types) { + if (type === "music") { + results.push(`${this.songCount} songs, ${this.albumCount} albums`); + } else if (type === "movies") { + results.push(`${this.movieCount} movies`); + } else if (type === "series") { + results.push(`${this.episodeCount} eps, ${this.seriesCount} series`); + } else { + results.push(`wrong library type 💀`); + } + } + + return results.join(', '); }, }, created() {