Skip to content

Commit

Permalink
remove p2p debrid option
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBeastLT committed Nov 26, 2024
1 parent d74d62e commit 4b57ca4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
3 changes: 1 addition & 2 deletions addon/moch/moch.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,13 @@ function processMochResults(streams, config, results) {
return errorResults;
}

const includeTorrentLinks = options.includeTorrentLinks(config);
const excludeDownloadLinks = options.excludeDownloadLinks(config);
const mochResults = results.filter(result => result?.mochStreams);

const cachedStreams = mochResults
.reduce((resultStreams, mochResult) => populateCachedLinks(resultStreams, mochResult, config), streams);
const resultStreams = excludeDownloadLinks ? cachedStreams : populateDownloadLinks(cachedStreams, mochResults, config);
return includeTorrentLinks ? resultStreams : resultStreams.filter(stream => stream.url);
return resultStreams.filter(stream => stream.url);
}

function populateCachedLinks(streams, mochResult, config) {
Expand Down
8 changes: 0 additions & 8 deletions addon/moch/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,13 @@ export const DebridOptions = {
key: 'nocatalog',
description: 'Don\'t show debrid catalog'
},
torrentLinks: {
key: 'torrentlinks',
description: 'Show P2P torrent links for uncached'
}
}
}

export function excludeDownloadLinks(config) {
return config[DebridOptions.key]?.includes(DebridOptions.options.noDownloadLinks.key);
}

export function includeTorrentLinks(config) {
return config[DebridOptions.key]?.includes(DebridOptions.options.torrentLinks.key);
}

export function showDebridCatalog(config) {
return !config[DebridOptions.key]?.includes(DebridOptions.options.noCatalog.key);
}

0 comments on commit 4b57ca4

Please sign in to comment.