diff --git a/addon/lib/streamInfo.js b/addon/lib/streamInfo.js index 1b3c385..656b6a9 100644 --- a/addon/lib/streamInfo.js +++ b/addon/lib/streamInfo.js @@ -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);