mirror of https://github.com/bastienwirtz/homer
Feat: add multi-type support for emby library stats
parent
308deb95e0
commit
1dfd781c93
|
@ -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/"
|
url: "http://192.168.0.151/"
|
||||||
type: "Emby"
|
type: "Emby"
|
||||||
apikey: "<---insert-api-key-here--->"
|
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
|
## FreshRSS
|
||||||
|
|
|
@ -38,13 +38,22 @@ export default {
|
||||||
}),
|
}),
|
||||||
computed: {
|
computed: {
|
||||||
embyCount: function () {
|
embyCount: function () {
|
||||||
if (this.item.libraryType === "music")
|
const types = this.item.libraryType.split('|');
|
||||||
return `${this.songCount} songs, ${this.albumCount} albums`;
|
const results = [];
|
||||||
else if (this.item.libraryType === "movies")
|
|
||||||
return `${this.movieCount} movies`;
|
for (const type of types) {
|
||||||
else if (this.item.libraryType === "series")
|
if (type === "music") {
|
||||||
return `${this.episodeCount} eps, ${this.seriesCount} series`;
|
results.push(`${this.songCount} songs, ${this.albumCount} albums`);
|
||||||
else return `wrong library type 💀`;
|
} 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() {
|
created() {
|
||||||
|
|
Loading…
Reference in New Issue