}
private async initCore () {
- const urlParts = window.location.href.split('/')
- const lastPart = urlParts[ urlParts.length - 1 ]
- const videoId = lastPart.indexOf('?') === -1 ? lastPart : lastPart.split('?')[ 0 ]
+ const urlParts = window.location.pathname.split('/')
+ const videoId = urlParts[ urlParts.length - 1 ]
const [ , serverTranslations, videoResponse, captionsResponse ] = await Promise.all([
loadLocaleInVideoJS(window.location.origin, vjs, navigator.language),
})
const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoId)
- await federateVideoIfNeeded(video, false)
+ if (video.isOwned()) await federateVideoIfNeeded(video, false)
} catch (err) {
logger.debug('Cannot create video views for video %d in hour %d. Maybe the video does not exist anymore?', videoId, hour)
}