Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/customservices.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ The `libraryType` configuration let you choose which stats to show.
logo: "assets/tools/sample.png"
url: https://my-service.url
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
Expand Down
23 changes: 16 additions & 7 deletions src/components/services/Emby.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down