mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-31 08:21:59 +02:00
YT: fix expire calc for long movies
Do not multiply video length when calculating expiration date. Otherwise for very long movies we might end up with with a past date.
This commit is contained in:
@@ -227,11 +227,10 @@ var YouTubeClient = GObject.registerClass({
|
|||||||
|
|
||||||
if(!isFoundInTemp) {
|
if(!isFoundInTemp) {
|
||||||
const exp = info.streamingData.expiresInSeconds || 0;
|
const exp = info.streamingData.expiresInSeconds || 0;
|
||||||
const len = info.videoDetails.lengthSeconds || 3;
|
const dateSeconds = Math.floor(Date.now() / 1000);
|
||||||
|
|
||||||
/* Estimated safe time for rewatching video */
|
/* Estimated safe time for rewatching video */
|
||||||
info.streamingData.expireDate = Math.floor(Date.now() / 1000)
|
info.streamingData.expireDate = dateSeconds + Number(exp);
|
||||||
+ Number(exp) - (3 * len);
|
|
||||||
|
|
||||||
this._createSubdirFileAsync(
|
this._createSubdirFileAsync(
|
||||||
'tmp', 'yt-info', videoId, JSON.stringify(info)
|
'tmp', 'yt-info', videoId, JSON.stringify(info)
|
||||||
|
Reference in New Issue
Block a user