From 1febbadfba9115f591dc29b431a21751ede4a417 Mon Sep 17 00:00:00 2001 From: Bothari <18599875+Bothari@users.noreply.github.com> Date: Sat, 2 Nov 2024 07:44:01 -0700 Subject: [PATCH] Improve warning and missing reports for Radarr connections (#809) Improve warning and missing reports for Radarr connections --- src/components/services/Radarr.vue | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/components/services/Radarr.vue b/src/components/services/Radarr.vue index 3352778..0fb93f2 100644 --- a/src/components/services/Radarr.vue +++ b/src/components/services/Radarr.vue @@ -77,6 +77,19 @@ export default { } }) .catch(handleError); + if (!this.item.legacyApi) { + this.fetch(`${this.apiPath}/queue/details?apikey=${this.item.apikey}`) + .then((queue) => { + for (var i = 0; i < queue.length; i++) { + if (queue[i].trackedDownloadStatus == "warning") { + this.warnings++; + } else if (queue[i].trackedDownloadStaus == "error") { + this.errors++; + } + } + }) + .catch(handleError); + } this.fetch(`${this.apiPath}/queue?apikey=${this.item.apikey}`) .then((queue) => { this.activity = 0; @@ -93,11 +106,14 @@ export default { }) .catch(handleError); if (!this.item.legacyApi) { - this.fetch(`${this.apiPath}/movie?apikey=${this.item.apikey}`) - .then((movies) => { - this.missing = movies.filter( - (m) => m.monitored && !m.hasFile - ).length; + this.fetch(`${this.apiPath}/wanted/missing?pageSize=1&apikey=${this.item.apikey}`) + .then((overview) => { + this.fetch(`${this.apiPath}/wanted/missing?pageSize=${overview.totalRecords}&apikey=${this.item.apikey}`) + .then((movies) => { + this.missing = movies.records.filter( + (m) => m.monitored && m.isAvailable && !m.hasFile + ).length; + }) }) .catch(handleError); }