mirror of
https://github.com/bastienwirtz/homer.git
synced 2026-01-23 02:15:09 +00:00
Parse new V3 api response
This commit is contained in:
parent
8ede30411e
commit
f7f4ebdf66
3 changed files with 25 additions and 8 deletions
|
|
@ -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
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue