4 <p class="title is-4">{{ item.name }}</p>
5 <p class="subtitle is-6">
6 <template v-if="item.subtitle">
15 <div v-if="status" class="status" :class="status">
23 import service from "@/mixins/service.js";
24 import Generic from "./Generic.vue";
44 embyCount: function () {
45 if (this.item.libraryType === "music")
46 return `${this.songCount} songs, ${this.albumCount} albums`;
47 else if (this.item.libraryType === "movies")
48 return `${this.movieCount} movies`;
49 else if (this.item.libraryType === "series")
50 return `${this.episodeCount} eps, ${this.seriesCount} series`;
51 else return `wrong library type 💀`;
55 this.fetchServerStatus();
57 if (!this.item.subtitle && this.status !== "dead")
58 this.fetchServerMediaStats();
61 fetchServerStatus: async function () {
63 "X-Emby-Token": this.item.apikey,
66 await this.fetch("/System/info/public", { headers })
68 if (response.Id) this.status = "running";
69 else this.status = "dead";
76 fetchServerMediaStats: async function () {
78 "X-Emby-Token": this.item.apikey,
81 var data = await this.fetch("/items/counts", { headers }).catch((e) => {
85 this.albumCount = data.AlbumCount;
86 this.songCount = data.SongCount;
87 this.movieCount = data.MovieCount;
88 this.seriesCount = data.SeriesCount;
89 this.episodeCount = data.EpisodeCount;
95 <style scoped lang="scss">
98 color: var(--text-title);
101 background-color: #94e185;
102 border-color: #78d965;
103 box-shadow: 0 0 5px 1px #94e185;
107 background-color: #c9404d;
108 border-color: #c42c3b;
109 box-shadow: 0 0 5px 1px #c9404d;
114 display: inline-block;
118 border: 1px solid #000;