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 () {
62 this.fetch("/System/info/public")
64 if (response.Id) this.status = "running";
65 else throw new Error();
72 fetchServerMediaStats: async function () {
74 "X-Emby-Token": this.item.apikey,
77 var data = await this.fetch("/items/counts", { headers }).catch((e) => {
81 this.albumCount = data.AlbumCount;
82 this.songCount = data.SongCount;
83 this.movieCount = data.MovieCount;
84 this.seriesCount = data.SeriesCount;
85 this.episodeCount = data.EpisodeCount;
91 <style scoped lang="scss">
94 color: var(--text-title);
97 background-color: #94e185;
98 border-color: #78d965;
99 box-shadow: 0 0 5px 1px #94e185;
103 background-color: #c9404d;
104 border-color: #c42c3b;
105 box-shadow: 0 0 5px 1px #c9404d;
110 display: inline-block;
114 border: 1px solid #000;