aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/components/services/Readarr.vue17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/components/services/Readarr.vue b/src/components/services/Readarr.vue
index d921c29..6ac6be2 100644
--- a/src/components/services/Readarr.vue
+++ b/src/components/services/Readarr.vue
@@ -52,29 +52,24 @@ export default {
52 created: function () { 52 created: function () {
53 this.fetchConfig(); 53 this.fetchConfig();
54 }, 54 },
55 computed: {
56 apiPath() {
57 return API;
58 },
59 },
60 methods: { 55 methods: {
61 fetchConfig: function () { 56 fetchConfig: function () {
62 const handleError = (e) => { 57 const handleError = (e) => {
63 console.error(e); 58 console.error(e);
64 this.serverError = true; 59 this.serverError = true;
65 } 60 };
66 this.fetch(`${this.apiPath}/health?apikey=${this.item.apikey}`) 61 this.fetch(`${API}/health?apikey=${this.item.apikey}`)
67 .then((health) => { 62 .then((health) => {
68 this.warnings = health.filter(h => h.type === 'warning').length; 63 this.warnings = health.filter((h) => h.type === "warning").length;
69 this.errors = health.filter(h => h.type === 'errors').length; 64 this.errors = health.filter((h) => h.type === "errors").length;
70 }) 65 })
71 .catch(handleError); 66 .catch(handleError);
72 this.fetch(`${this.apiPath}/queue?apikey=${this.item.apikey}`) 67 this.fetch(`${API}/queue?apikey=${this.item.apikey}`)
73 .then((queue) => { 68 .then((queue) => {
74 this.activity = queue.totalRecords; 69 this.activity = queue.totalRecords;
75 }) 70 })
76 .catch(handleError); 71 .catch(handleError);
77 this.fetch(`${this.apiPath}/wanted/missing?apikey=${this.item.apikey}`) 72 this.fetch(`${API}/wanted/missing?apikey=${this.item.apikey}`)
78 .then((missing) => { 73 .then((missing) => {
79 this.missing = missing.totalRecords; 74 this.missing = missing.totalRecords;
80 }) 75 })