From f7f4ebdf667db848509f93d470cd46c648bb2439 Mon Sep 17 00:00:00 2001
From: Duy NGUYEN <duynguyen@deevotech.com>
Date: Tue, 1 Feb 2022 18:32:25 +0100
Subject: Parse new V3 api response

---
 src/components/services/Radarr.vue | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

(limited to 'src/components/services/Radarr.vue')

diff --git a/src/components/services/Radarr.vue b/src/components/services/Radarr.vue
index 13f6d68..55896f5 100644
--- a/src/components/services/Radarr.vue
+++ b/src/components/services/Radarr.vue
@@ -75,9 +75,18 @@ export default {
       this.fetch(`${this.apiPath}/queue?apikey=${this.item.apikey}`)
         .then((queue) => {
           this.activity = 0;
-          for (var i = 0; i < queue.length; i++) {
-            if (queue[i].movie) {
-              this.activity++;
+
+          if (this.item.legacyApi) {
+            for (var i = 0; i < queue.length; i++) {
+              if (queue[i].series) {
+                this.activity++;
+              }
+            }
+          } else {
+            for (const record of queue.records) {
+              if (record.movieId) {
+                this.activity++;
+              }
             }
           }
         })
-- 
cgit v1.2.3

