Skip to content

Commit

Permalink
Improve warning and missing reports for Radarr connections (#809)
Browse files Browse the repository at this point in the history
Improve warning and missing reports for Radarr connections
  • Loading branch information
Bothari authored Nov 2, 2024
1 parent 779deed commit 1febbad
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions src/components/services/Radarr.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down

0 comments on commit 1febbad

Please sign in to comment.