[addon] show filename at the end of moch url for external players

This commit is contained in:
TheBeastLT
2021-06-20 13:37:07 +02:00
parent f11bc8fbc8
commit 3e66db3717
3 changed files with 14 additions and 5 deletions

View File

@@ -8,7 +8,7 @@ const putio = require('./putio');
const StaticResponse = require('./static');
const { cacheWrapResolvedUrl } = require('../lib/cache');
const { timeout } = require('../lib/promises');
const { BadTokenError } = require('./mochHelper');
const { BadTokenError, streamFilename } = require('./mochHelper');
const RESOLVE_TIMEOUT = 10 * 60 * 1000; // 10 minutes
const MIN_API_KEY_SYMBOLS = 15;
@@ -151,7 +151,7 @@ function populateCachedLinks(streams, mochResult) {
return {
name: `[${mochResult.moch.shortName}+] ${stream.name}`,
title: stream.title,
url: `${RESOLVER_HOST}/${mochResult.moch.key}/${cachedEntry.url}`,
url: `${RESOLVER_HOST}/${mochResult.moch.key}/${cachedEntry.url}/${streamFilename(stream)}`,
behaviorHints: stream.behaviorHints
};
}
@@ -169,7 +169,7 @@ function populateDownloadLinks(streams, mochResults) {
streams.push({
name: `[${mochResult.moch.shortName} download] ${stream.name}`,
title: stream.title,
url: `${RESOLVER_HOST}/${mochResult.moch.key}/${cachedEntry.url}`,
url: `${RESOLVER_HOST}/${mochResult.moch.key}/${cachedEntry.url}/${streamFilename(stream)}`,
behaviorHints: stream.behaviorHints
})
}