return binge group for movies
This commit is contained in:
@@ -42,10 +42,9 @@ function toStreamInfo(record) {
|
||||
'',
|
||||
'\n'
|
||||
);
|
||||
const bingeGroupParts = getBingeGroupParts(record, sameInfo, quality, torrentInfo, fileInfo);
|
||||
const behaviorHints = {
|
||||
bingeGroup: sameInfo
|
||||
? `torrentio|${quality}|${fileInfo.group}`
|
||||
: `torrentio|${record.infoHash}`
|
||||
bingeGroup: joinDetailParts(bingeGroupParts, "torrentio|", "|")
|
||||
};
|
||||
|
||||
return cleanOutputObject({
|
||||
@@ -53,7 +52,7 @@ function toStreamInfo(record) {
|
||||
title: title,
|
||||
infoHash: record.infoHash,
|
||||
fileIdx: record.fileIndex,
|
||||
behaviorHints: record.torrent.type !== Type.MOVIE ? behaviorHints : null,
|
||||
behaviorHints: behaviorHints,
|
||||
sources: getSources(record.torrent.trackers, record.infoHash)
|
||||
});
|
||||
}
|
||||
@@ -133,7 +132,22 @@ function getSources(trackersInput, infoHash) {
|
||||
return null;
|
||||
}
|
||||
const trackers = Array.isArray(trackersInput) ? trackersInput : trackersInput.split(',');
|
||||
return trackers.map(tracker => `tracker:${tracker}`).concat(`dht:${infoHash}`)
|
||||
return trackers.map(tracker => `tracker:${tracker}`).concat(`dht:${infoHash}`);
|
||||
}
|
||||
|
||||
function getBingeGroupParts(record, sameInfo, quality, torrentInfo, fileInfo) {
|
||||
if (record.torrent.type === Type.MOVIE) {
|
||||
const source = torrentInfo.source || fileInfo.source
|
||||
return [
|
||||
quality,
|
||||
source !== quality ? source : undefined,
|
||||
torrentInfo.codec || fileInfo.codec,
|
||||
torrentInfo.bitDepth || fileInfo.bitDepth
|
||||
];
|
||||
} else if (sameInfo) {
|
||||
return [quality, fileInfo.group];
|
||||
}
|
||||
return [record.infoHash];
|
||||
}
|
||||
|
||||
function cleanOutputObject(object) {
|
||||
|
||||
3634
addon/package-lock.json
generated
3634
addon/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -19,7 +19,7 @@
|
||||
"https-proxy-agent": "^5.0.0",
|
||||
"magnet-uri": "^6.2.0",
|
||||
"named-queue": "^2.2.1",
|
||||
"parse-torrent-title": "git://github.com/TheBeastLT/parse-torrent-title.git#8fd87b3bfc7aa04143edcd4f0112868bb77dce0f",
|
||||
"parse-torrent-title": "git://github.com/TheBeastLT/parse-torrent-title.git#eb390fcfc257950e65ec1b0812bd331765a053c9",
|
||||
"pg": "^8.7.1",
|
||||
"pg-hstore": "^2.3.4",
|
||||
"premiumize-api": "^1.0.3",
|
||||
|
||||
Reference in New Issue
Block a user