mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[addon] adds debrid download link option an logic
This commit is contained in:
34
addon/moch/options.js
Normal file
34
addon/moch/options.js
Normal file
@@ -0,0 +1,34 @@
|
||||
const DebridOptions = {
|
||||
key: 'debridoptions',
|
||||
options: {
|
||||
cachedlinks: {
|
||||
key: 'cachedlinks',
|
||||
description: 'Show only cached debrid links'
|
||||
},
|
||||
cachedlinksifavailable: {
|
||||
key: 'cachedlinksifavailable',
|
||||
description: 'Show only cached debrid links if available'
|
||||
},
|
||||
downloadlinks: {
|
||||
key: 'downloadlinks',
|
||||
description: 'Show download to debrid links for uncached'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onlyCachedLinks(config) {
|
||||
return config[DebridOptions.key] && config[DebridOptions.key]
|
||||
.includes(DebridOptions.options.cachedlinks.key);
|
||||
}
|
||||
|
||||
function onlyCachedLinksIfAvailable(config) {
|
||||
return config[DebridOptions.key] && config[DebridOptions.key]
|
||||
.includes(DebridOptions.options.cachedlinksifavailable.key);
|
||||
}
|
||||
|
||||
function includeDownloadLinks(config) {
|
||||
return config[DebridOptions.key] && config[DebridOptions.key]
|
||||
.includes(DebridOptions.options.downloadlinks.key);
|
||||
}
|
||||
|
||||
module.exports = { DebridOptions, onlyCachedLinks, onlyCachedLinksIfAvailable, includeDownloadLinks }
|
||||
Reference in New Issue
Block a user