forked from extern/homer
Parse new V3 api response
This commit is contained in:
parent
8ede30411e
commit
f7f4ebdf66
@ -84,9 +84,9 @@ If you are using an older version of Radarr or Sonarr which don't support the ne
|
|||||||
```yaml
|
```yaml
|
||||||
- name: "Radarr"
|
- name: "Radarr"
|
||||||
type: "Radarr"
|
type: "Radarr"
|
||||||
url: "http://localhost:8989/"
|
url: "http://localhost:7878/"
|
||||||
apikey: "MY-SUPER-SECRET-API-KEY"
|
apikey: "MY-SUPER-SECRET-API-KEY"
|
||||||
target: "_blank" # optional html tag target attribute
|
target: "_blank"
|
||||||
legacyApi: true
|
legacyApi: true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -75,11 +75,20 @@ export default {
|
|||||||
this.fetch(`${this.apiPath}/queue?apikey=${this.item.apikey}`)
|
this.fetch(`${this.apiPath}/queue?apikey=${this.item.apikey}`)
|
||||||
.then((queue) => {
|
.then((queue) => {
|
||||||
this.activity = 0;
|
this.activity = 0;
|
||||||
|
|
||||||
|
if (this.item.legacyApi) {
|
||||||
for (var i = 0; i < queue.length; i++) {
|
for (var i = 0; i < queue.length; i++) {
|
||||||
if (queue[i].movie) {
|
if (queue[i].series) {
|
||||||
this.activity++;
|
this.activity++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
for (const record of queue.records) {
|
||||||
|
if (record.movieId) {
|
||||||
|
this.activity++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
@ -76,11 +76,19 @@ export default {
|
|||||||
this.fetch(`${this.apiPath}/queue?apikey=${this.item.apikey}`)
|
this.fetch(`${this.apiPath}/queue?apikey=${this.item.apikey}`)
|
||||||
.then((queue) => {
|
.then((queue) => {
|
||||||
this.activity = 0;
|
this.activity = 0;
|
||||||
|
if (this.item.legacyApi) {
|
||||||
for (var i = 0; i < queue.length; i++) {
|
for (var i = 0; i < queue.length; i++) {
|
||||||
if (queue[i].series) {
|
if (queue[i].series) {
|
||||||
this.activity++;
|
this.activity++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
for (const record of queue.records) {
|
||||||
|
if (record.seriesId) {
|
||||||
|
this.activity++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
Loading…
Reference in New Issue
Block a user