forked from extern/homer
Radarr and Sonarr V3 api support optional
This commit is contained in:
parent
cb154a6818
commit
8ede30411e
@ -79,6 +79,16 @@ Two lines are needed in the config.yml :
|
|||||||
|
|
||||||
The url must be the root url of Lidarr, Radarr or Sonarr application.
|
The url must be the root url of Lidarr, Radarr or Sonarr application.
|
||||||
The Lidarr, Radarr or Sonarr API key can be found in Settings > General. It is needed to access the API.
|
The Lidarr, 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:8989/"
|
||||||
|
apikey: "MY-SUPER-SECRET-API-KEY"
|
||||||
|
target: "_blank" # optional html tag target attribute
|
||||||
|
legacyApi: true
|
||||||
|
```
|
||||||
|
|
||||||
## PaperlessNG
|
## PaperlessNG
|
||||||
|
|
||||||
|
@ -26,6 +26,9 @@
|
|||||||
import service from "@/mixins/service.js";
|
import service from "@/mixins/service.js";
|
||||||
import Generic from "./Generic.vue";
|
import Generic from "./Generic.vue";
|
||||||
|
|
||||||
|
const V3_API = "/api/v3";
|
||||||
|
const LEGACY_API = "/api";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Radarr",
|
name: "Radarr",
|
||||||
mixins: [service],
|
mixins: [service],
|
||||||
@ -46,9 +49,14 @@ export default {
|
|||||||
created: function () {
|
created: function () {
|
||||||
this.fetchConfig();
|
this.fetchConfig();
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
apiPath() {
|
||||||
|
return this.item.legacyApi ? LEGACY_API : V3_API;
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchConfig: function () {
|
fetchConfig: function () {
|
||||||
this.fetch(`/api/v3/health?apikey=${this.item.apikey}`)
|
this.fetch(`${this.apiPath}/health?apikey=${this.item.apikey}`)
|
||||||
.then((health) => {
|
.then((health) => {
|
||||||
this.warnings = 0;
|
this.warnings = 0;
|
||||||
this.errors = 0;
|
this.errors = 0;
|
||||||
@ -64,7 +72,7 @@ export default {
|
|||||||
console.error(e);
|
console.error(e);
|
||||||
this.serverError = true;
|
this.serverError = true;
|
||||||
});
|
});
|
||||||
this.fetch(`/api/v3/queue?apikey=${this.item.apikey}`)
|
this.fetch(`${this.apiPath}/queue?apikey=${this.item.apikey}`)
|
||||||
.then((queue) => {
|
.then((queue) => {
|
||||||
this.activity = 0;
|
this.activity = 0;
|
||||||
for (var i = 0; i < queue.length; i++) {
|
for (var i = 0; i < queue.length; i++) {
|
||||||
|
@ -27,6 +27,9 @@
|
|||||||
import service from "@/mixins/service.js";
|
import service from "@/mixins/service.js";
|
||||||
import Generic from "./Generic.vue";
|
import Generic from "./Generic.vue";
|
||||||
|
|
||||||
|
const V3_API = "/api/v3";
|
||||||
|
const LEGACY_API = "/api";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Sonarr",
|
name: "Sonarr",
|
||||||
mixins: [service],
|
mixins: [service],
|
||||||
@ -36,6 +39,11 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
Generic,
|
Generic,
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
apiPath() {
|
||||||
|
return this.item.legacyApi ? LEGACY_API : V3_API;
|
||||||
|
},
|
||||||
|
},
|
||||||
data: () => {
|
data: () => {
|
||||||
return {
|
return {
|
||||||
activity: null,
|
activity: null,
|
||||||
@ -49,7 +57,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchConfig: function () {
|
fetchConfig: function () {
|
||||||
this.fetch(`/api/v3/health?apikey=${this.item.apikey}`)
|
this.fetch(`${this.apiPath}/health?apikey=${this.item.apikey}`)
|
||||||
.then((health) => {
|
.then((health) => {
|
||||||
this.warnings = 0;
|
this.warnings = 0;
|
||||||
this.errors = 0;
|
this.errors = 0;
|
||||||
@ -65,7 +73,7 @@ export default {
|
|||||||
console.error(e);
|
console.error(e);
|
||||||
this.serverError = true;
|
this.serverError = true;
|
||||||
});
|
});
|
||||||
this.fetch(`/api/v3/queue?apikey=${this.item.apikey}`)
|
this.fetch(`${this.apiPath}/queue?apikey=${this.item.apikey}`)
|
||||||
.then((queue) => {
|
.then((queue) => {
|
||||||
this.activity = 0;
|
this.activity = 0;
|
||||||
for (var i = 0; i < queue.length; i++) {
|
for (var i = 0; i < queue.length; i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user