Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements multi selector for library type for Emby/Jellyfin. Allows… #786

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
4 changes: 3 additions & 1 deletion docs/customservices.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ 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: #Choose which stats to show. Can be of value: "music", "series" or "movies".
- "music"
- "movies"
```

## Uptime Kuma
Expand Down
35 changes: 27 additions & 8 deletions src/components/services/Emby.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,34 @@
seriesCount: 0,
episodeCount: 0,
}),
computed: {
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 libraryType = this.item.libraryType;
const counts = [];

libraryType.forEach((type, index) => {

Check failure on line 48 in src/components/services/Emby.vue

View workflow job for this annotation

GitHub Actions / build (20.x)

'index' is defined but never used
if (type === "music") {
counts.push(`${this.songCount} songs`);
counts.push(`${this.albumCount} albums`);
} else if (type === "movies") {
counts.push(`${this.movieCount} movies`);
} else if (type === "series") {
counts.push(`${this.episodeCount} episodes`);
counts.push(`${this.seriesCount} series`);
} else {
return `wrong library type 💀`;
}
});

const allowedParams = this.item.embyCountParams || "";
const params = allowedParams.split(",").map((param) => param.trim());

const filteredCounts = counts.filter((count, index) => {

Check failure on line 65 in src/components/services/Emby.vue

View workflow job for this annotation

GitHub Actions / build (20.x)

'index' is defined but never used
const countType = count.split(" ")[1];
return params.some((param) => countType.includes(param));
});

return filteredCounts.join(", ");
},
},
created() {
Expand Down
Loading