From 64629742f7aec7b34e8fc9e6b83282e496c2fb74 Mon Sep 17 00:00:00 2001 From: royto Date: Fri, 18 Aug 2023 21:24:55 +0200 Subject: [PATCH] feat: add missing notif for lidarr --- docs/customservices.md | 3 +-- src/components/services/Lidarr.vue | 27 +++++++++++++++++++-------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/docs/customservices.md b/docs/customservices.md index 56023edc1..fb038d169 100644 --- a/docs/customservices.md +++ b/docs/customservices.md @@ -103,8 +103,7 @@ The Medusa API key can be found in General configuration > Interface. It is need ## Lidarr, Prowlarr, Sonarr, Readarr and Radarr -This service displays Activity (blue), Warning (orange) or Error (red) notifications bubbles from the Lidarr, Readarr, Radarr or Sonarr application. -Readarr, Radarr and Sonarr display also a Missing (purple) notification bubbles. +This service displays Activity (blue), Missing(purple) Warning (orange) or Error (red) notifications bubbles from the Lidarr, Readarr, Radarr or Sonarr application. Two lines are needed in the config.yml : ```yaml diff --git a/src/components/services/Lidarr.vue b/src/components/services/Lidarr.vue index cbe551621..f7f25c740 100644 --- a/src/components/services/Lidarr.vue +++ b/src/components/services/Lidarr.vue @@ -5,6 +5,9 @@ {{ activity }} + + {{ missing }} + {{ warnings }} @@ -38,6 +41,7 @@ export default { data: () => { return { activity: null, + missing: null, warnings: null, errors: null, serverError: false, @@ -48,6 +52,10 @@ export default { }, methods: { fetchConfig: function () { + const handleError = (e) => { + console.error(e); + this.serverError = true; + }; this.fetch(`/api/v1/health?apikey=${this.item.apikey}`) .then((health) => { this.warnings = 0; @@ -60,18 +68,17 @@ export default { } } }) - .catch((e) => { - console.error(e); - this.serverError = true; - }); + .catch(handleError); this.fetch(`/api/v1/queue/status?apikey=${this.item.apikey}`) .then((queue) => { this.activity = queue.totalCount; }) - .catch((e) => { - console.error(e); - this.serverError = true; - }); + .catch(handleError); + this.fetch(`/api/v1/wanted/missing?apikey=${this.item.apikey}`) + .then((queue) => { + this.missing = queue.totalRecords; + }) + .catch(handleError); }, }, }; @@ -98,6 +105,10 @@ export default { background-color: #4fb5d6; } + &.missing { + background-color: #9d00ff; + } + &.warnings { background-color: #d08d2e; }