The url must be the root url of Lidarr, Prowlarr, Radarr or Sonarr application.
The Lidarr, Prowlarr, Radarr or Sonarr API key can be found in Settings > General. It is needed to access the API.
+If you are using an older version of Radarr or Sonarr which don't support the new V3 api endpoints, add the following line to your service config "legacyApi: true", example:
+
+```yaml
+- name: "Radarr"
+ type: "Radarr"
+ url: "http://localhost:7878/"
+ apikey: "MY-SUPER-SECRET-API-KEY"
+ target: "_blank"
+ legacyApi: true
+```
## PaperlessNG
import service from "@/mixins/service.js";
import Generic from "./Generic.vue";
+const V3_API = "/api/v3";
+const LEGACY_API = "/api";
+
export default {
name: "Radarr",
mixins: [service],
created: function () {
this.fetchConfig();
},
+ computed: {
+ apiPath() {
+ return this.item.legacyApi ? LEGACY_API : V3_API;
+ },
+ },
methods: {
fetchConfig: function () {
- this.fetch(`/api/health?apikey=${this.item.apikey}`)
+ this.fetch(`${this.apiPath}/health?apikey=${this.item.apikey}`)
.then((health) => {
this.warnings = 0;
this.errors = 0;
console.error(e);
this.serverError = true;
});
- this.fetch(`/api/queue?apikey=${this.item.apikey}`)
+ 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].movie) {
+ this.activity++;
+ }
+ }
+ } else {
+ for (const record of queue.records) {
+ if (record.movieId) {
+ this.activity++;
+ }
}
}
})
import service from "@/mixins/service.js";
import Generic from "./Generic.vue";
+const V3_API = "/api/v3";
+const LEGACY_API = "/api";
+
export default {
name: "Sonarr",
mixins: [service],
components: {
Generic,
},
+ computed: {
+ apiPath() {
+ return this.item.legacyApi ? LEGACY_API : V3_API;
+ },
+ },
data: () => {
return {
activity: null,
},
methods: {
fetchConfig: function () {
- this.fetch(`/api/health?apikey=${this.item.apikey}`)
+ this.fetch(`${this.apiPath}/health?apikey=${this.item.apikey}`)
.then((health) => {
this.warnings = 0;
this.errors = 0;
console.error(e);
this.serverError = true;
});
- this.fetch(`/api/queue?apikey=${this.item.apikey}`)
+ 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++;
+ }
}
}
})