mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[addon] return cam quality if torrent of file name has it
This commit is contained in:
@@ -6,6 +6,7 @@ const { getAllTrackers } = require('./magnetHelper');
|
|||||||
const ADDON_NAME = 'Torrentio';
|
const ADDON_NAME = 'Torrentio';
|
||||||
const SIZE_DELTA = 0.02;
|
const SIZE_DELTA = 0.02;
|
||||||
const UNKNOWN_SIZE = 300000000;
|
const UNKNOWN_SIZE = 300000000;
|
||||||
|
const CAM_SOURCES = ['CAM', 'TeleSync', 'TeleCine'];
|
||||||
const ANIME_PROVIDERS = [
|
const ANIME_PROVIDERS = [
|
||||||
'HorribleSubs',
|
'HorribleSubs',
|
||||||
'NyaaSi',
|
'NyaaSi',
|
||||||
@@ -58,11 +59,14 @@ function toStreamInfo(record) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getQuality(record, torrentInfo, fileInfo) {
|
function getQuality(record, torrentInfo, fileInfo) {
|
||||||
|
if (CAM_SOURCES.includes(fileInfo.source)) {
|
||||||
|
return fileInfo.source;
|
||||||
|
}
|
||||||
|
if (CAM_SOURCES.includes(torrentInfo.source)) {
|
||||||
|
return torrentInfo.source;
|
||||||
|
}
|
||||||
const resolution = fileInfo.resolution || torrentInfo.resolution || record.torrent.resolution;
|
const resolution = fileInfo.resolution || torrentInfo.resolution || record.torrent.resolution;
|
||||||
const source = fileInfo.source || torrentInfo.source;
|
const source = fileInfo.source || torrentInfo.source;
|
||||||
if (['CAM', 'TeleSync', 'TeleCine'].includes(source)) {
|
|
||||||
return source;
|
|
||||||
}
|
|
||||||
return resolution || source;
|
return resolution || source;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user