]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
Parse new V3 api response
authorDuy NGUYEN <duynguyen@deevotech.com>
Tue, 1 Feb 2022 17:32:25 +0000 (18:32 +0100)
committerDuy NGUYEN <duynguyen@deevotech.com>
Tue, 1 Feb 2022 17:32:25 +0000 (18:32 +0100)
docs/customservices.md
src/components/services/Radarr.vue
src/components/services/Sonarr.vue

index 91c4051e9d83154eee52ce406a49403bd1a9285b..93179076bae6b9112fe17b7ecef3bca682e26b53 100644 (file)
@@ -84,9 +84,9 @@ If you are using an older version of Radarr or Sonarr which don't support the ne
 ```yaml
 - name: "Radarr"
   type: "Radarr"
-  url: "http://localhost:8989/"
+  url: "http://localhost:7878/"
   apikey: "MY-SUPER-SECRET-API-KEY"
-  target: "_blank" # optional html tag target attribute
+  target: "_blank"
   legacyApi: true
 ```
 
index 13f6d68840e0c7813ccf018abb56d9a85f81577c..55896f573c1f68fbe6798d8e9188a2b4fcf018a5 100644 (file)
@@ -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++;
+              }
             }
           }
         })
index 3e5c49fb938459e15e60deddcacbfc760bda3777..55df43748ae73512055b3663f328717c0664fc54 100644 (file)
@@ -76,9 +76,17 @@ 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].series) {
-              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.seriesId) {
+                this.activity++;
+              }
             }
           }
         })