mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[addon] excludes resolution from cam/ts sources
This commit is contained in:
@@ -21,13 +21,7 @@ function toStreamInfo(record) {
|
||||
const name = joinDetailParts(
|
||||
[
|
||||
joinDetailParts([ADDON_NAME]),
|
||||
joinDetailParts([
|
||||
fileInfo.resolution ||
|
||||
torrentInfo.resolution ||
|
||||
record.torrent.resolution ||
|
||||
fileInfo.source ||
|
||||
torrentInfo.source
|
||||
])
|
||||
joinDetailParts([getQuality(record, fileInfo, torrentInfo)])
|
||||
],
|
||||
'',
|
||||
'\n'
|
||||
@@ -41,6 +35,15 @@ function toStreamInfo(record) {
|
||||
};
|
||||
}
|
||||
|
||||
function getQuality(record, fileInfo, torrentInfo) {
|
||||
const resolution = fileInfo.resolution || torrentInfo.resolution || record.torrent.resolution;
|
||||
const source = fileInfo.source || torrentInfo.source;
|
||||
if (['CAM', 'TeleSync'].includes(source)) {
|
||||
return source;
|
||||
}
|
||||
return resolution || source;
|
||||
}
|
||||
|
||||
function joinDetailParts(parts, prefix = '', delimiter = ' ') {
|
||||
const filtered = parts.filter((part) => part !== undefined && part !== null).join(delimiter);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user