From: Chocobozzz Date: Thu, 15 Nov 2018 15:57:59 +0000 (+0100) Subject: Fix embed video id parsing X-Git-Tag: v1.1.0-rc.1~37 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6385c0cb7f773f5212a96807468988e17dba1d6d;p=oweals%2Fpeertube.git Fix embed video id parsing --- diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts index c113c67da..7daa03f23 100644 --- a/client/src/standalone/videos/embed.ts +++ b/client/src/standalone/videos/embed.ts @@ -256,9 +256,8 @@ class PeerTubeEmbed { } 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), diff --git a/server/lib/job-queue/handlers/video-views.ts b/server/lib/job-queue/handlers/video-views.ts index 2ceec2342..f44c3c727 100644 --- a/server/lib/job-queue/handlers/video-views.ts +++ b/server/lib/job-queue/handlers/video-views.ts @@ -39,7 +39,7 @@ async function processVideosViews () { }) 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) }