Resolved linting issues

This commit is contained in:
2022-09-25 13:32:49 +02:00
parent 9e77fe8801
commit 2ad66d455c
2 changed files with 13 additions and 10 deletions

View File

@@ -12,7 +12,7 @@ const redisMockClient = {
return Promise.resolve(callback(null, "OK"));
},
expire(key, TTL) {
// console.log(`redis-dummy expire: ${key} with TTL ${TTL}`); // eslint-disable-line no-console
console.log(`redis-dummy expire: ${key} with TTL ${TTL}`); // eslint-disable-line no-console
}
};

View File

@@ -116,7 +116,7 @@ class Plex {
headers: { Accept: "application/json" }
};
return new Promise((resolve, reject) =>
return new Promise((resolve, reject) => {
this.cache
.get(cacheKey)
.then(machineInfo => resolve(machineInfo?.machineIdentifier))
@@ -132,8 +132,8 @@ class Plex {
}
reject(new PlexUnexpectedError());
})
);
});
});
}
async existsInPlex(tmdb) {
@@ -185,16 +185,19 @@ class Plex {
const url = `http://${this.plexIP}:${
this.plexPort
}/hubs/search?query=${fixedEncodeURIComponent(query)}`;
}/hubs/search?query=${fixedEncodeURIComponent(query)}&X-Plex-Token=${
this.token
}`;
const options = {
timeout: 20000,
headers: { Accept: "application/json" }
};
return new Promise((resolve, reject) =>
return new Promise((resolve, reject) => {
this.cache
.get(cacheKey)
.catch(error => {
.catch(() => {
// else fetch fresh data
return fetch(url, options)
.then(successfullResponse)
@@ -208,8 +211,8 @@ class Plex {
}
reject(new PlexUnexpectedError());
})
);
});
});
}
// this is not guarenteed to work, but if we see a movie or
@@ -224,7 +227,7 @@ class Plex {
// TODO improve cache key matching by lowercasing it on the backend.
// what do we actually need to check for if the key was deleted or not
// it might be an error or another response code.
console.log("Unable to delete, key might not exists");
console.log("Unable to delete, key might not exists"); // eslint-disable-line no-console
return response === 1;
});
}