Skip to content

Commit c1d1da1

Browse files
committed
Update streamer.js
1 parent 686ce6a commit c1d1da1

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

www/nodejs-project/modules/streamer/streamer.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,19 @@ class StreamerTools extends Events {
6565
await this.pingSource(entry.source).catch(console.error)
6666
let type = false
6767
const now = global.time()
68+
const isMAG = url.indexOf('#mag-') != -1 // MAG URLs should be revalidated
6869
const cachingKey = this.infoCacheKey(url), skipSample = entry.skipSample || entry.allowBlindTrust || (entry.skipSample !== false && this.streamInfo.mi.isVideo(url))
69-
if(cachingKey && this.streamInfoCaching[cachingKey] && now < this.streamInfoCaching[cachingKey].until) {
70+
if(cachingKey && !isMAG && this.streamInfoCaching[cachingKey] && now < this.streamInfoCaching[cachingKey].until) {
7071
if(skipSample || (this.streamInfoCaching[cachingKey].sample && this.streamInfoCaching[cachingKey].sample.length)) {
71-
this.streamInfoCaching[cachingKey].url = url // avoid reopening same URL
72-
return this.streamInfoCaching[cachingKey]
72+
const result = Object.assign({}, this.streamInfoCaching[cachingKey])
73+
if(result.url != url) { // avoid opening cached URL from other stream
74+
result.url = url
75+
result.directURL = url
76+
}
77+
return result
7378
}
7479
}
75-
if(url.indexOf('#mag-') != -1) {
80+
if(isMAG) {
7681
if(!entry.source) {
7782
throw 'Source URL required'
7883
}

0 commit comments

Comments
 (0)