mirror of https://github.com/Chocobozzz/PeerTube
Fix embed video id parsing
parent
030177d246
commit
6385c0cb7f
|
@ -256,9 +256,8 @@ class PeerTubeEmbed {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async initCore () {
|
private async initCore () {
|
||||||
const urlParts = window.location.href.split('/')
|
const urlParts = window.location.pathname.split('/')
|
||||||
const lastPart = urlParts[ urlParts.length - 1 ]
|
const videoId = urlParts[ urlParts.length - 1 ]
|
||||||
const videoId = lastPart.indexOf('?') === -1 ? lastPart : lastPart.split('?')[ 0 ]
|
|
||||||
|
|
||||||
const [ , serverTranslations, videoResponse, captionsResponse ] = await Promise.all([
|
const [ , serverTranslations, videoResponse, captionsResponse ] = await Promise.all([
|
||||||
loadLocaleInVideoJS(window.location.origin, vjs, navigator.language),
|
loadLocaleInVideoJS(window.location.origin, vjs, navigator.language),
|
||||||
|
|
|
@ -39,7 +39,7 @@ async function processVideosViews () {
|
||||||
})
|
})
|
||||||
|
|
||||||
const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoId)
|
const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoId)
|
||||||
await federateVideoIfNeeded(video, false)
|
if (video.isOwned()) await federateVideoIfNeeded(video, false)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.debug('Cannot create video views for video %d in hour %d. Maybe the video does not exist anymore?', videoId, hour)
|
logger.debug('Cannot create video views for video %d in hour %d. Maybe the video does not exist anymore?', videoId, hour)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue