[addon] excludes resolution from cam/ts sources

This commit is contained in:
TheBeastLT
2020-04-15 12:32:21 +02:00
parent fd7057f3dc
commit 3bc8da509d

View File

@@ -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);