diff options
author | Chocobozzz <me@florianbigard.com> | 2018-11-15 16:57:59 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-11-15 16:57:59 +0100 |
commit | 6385c0cb7f773f5212a96807468988e17dba1d6d (patch) | |
tree | aa4bd970d2bf39ca643792c2f430019813ed6538 | |
parent | 030177d246834fdba89be9bbaeac497589b47102 (diff) | |
download | PeerTube-6385c0cb7f773f5212a96807468988e17dba1d6d.tar.gz PeerTube-6385c0cb7f773f5212a96807468988e17dba1d6d.tar.zst PeerTube-6385c0cb7f773f5212a96807468988e17dba1d6d.zip |
Fix embed video id parsing
-rw-r--r-- | client/src/standalone/videos/embed.ts | 5 | ||||
-rw-r--r-- | server/lib/job-queue/handlers/video-views.ts | 2 |
2 files changed, 3 insertions, 4 deletions
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 { | |||
256 | } | 256 | } |
257 | 257 | ||
258 | private async initCore () { | 258 | private async initCore () { |
259 | const urlParts = window.location.href.split('/') | 259 | const urlParts = window.location.pathname.split('/') |
260 | const lastPart = urlParts[ urlParts.length - 1 ] | 260 | const videoId = urlParts[ urlParts.length - 1 ] |
261 | const videoId = lastPart.indexOf('?') === -1 ? lastPart : lastPart.split('?')[ 0 ] | ||
262 | 261 | ||
263 | const [ , serverTranslations, videoResponse, captionsResponse ] = await Promise.all([ | 262 | const [ , serverTranslations, videoResponse, captionsResponse ] = await Promise.all([ |
264 | loadLocaleInVideoJS(window.location.origin, vjs, navigator.language), | 263 | 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 () { | |||
39 | }) | 39 | }) |
40 | 40 | ||
41 | const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoId) | 41 | const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoId) |
42 | await federateVideoIfNeeded(video, false) | 42 | if (video.isOwned()) await federateVideoIfNeeded(video, false) |
43 | } catch (err) { | 43 | } catch (err) { |
44 | logger.debug('Cannot create video views for video %d in hour %d. Maybe the video does not exist anymore?', videoId, hour) | 44 | logger.debug('Cannot create video views for video %d in hour %d. Maybe the video does not exist anymore?', videoId, hour) |
45 | } | 45 | } |