[addon] refactor applyMochs method and include other debrid options

This commit is contained in:
TheBeastLT
2020-05-11 21:54:10 +02:00
parent 8613a6500f
commit a4f28aedc8
3 changed files with 56 additions and 31 deletions

View File

@@ -1,12 +1,12 @@
const DebridOptions = {
key: 'debridoptions',
options: {
cachedLinks: {
key: 'cachedlinks',
onlyCached: {
key: 'onlycached',
description: 'Show only cached debrid links'
},
cachedLinksIfAvailable: {
key: 'cachedlinksifavailable',
onlyCachedIfAvailable: {
key: 'onlycachedifavailable',
description: 'Show only cached debrid links if available'
},
downloadLinks: {
@@ -18,12 +18,12 @@ const DebridOptions = {
function onlyCachedLinks(config) {
return config[DebridOptions.key] && config[DebridOptions.key]
.includes(DebridOptions.options.cachedLinks.key);
.includes(DebridOptions.options.onlyCached.key);
}
function onlyCachedLinksIfAvailable(config) {
return config[DebridOptions.key] && config[DebridOptions.key]
.includes(DebridOptions.options.cachedLinksIfAvailable.key);
.includes(DebridOptions.options.onlyCachedIfAvailable.key);
}
function includeDownloadLinks(config) {