Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Framasoft
PeerTube
PeerTube
Commits
20dcfd74
Verified
Commit
20dcfd74
authored
Aug 26, 2020
by
Chocobozzz
Browse files
Deprecate old static routes
parent
000ca2a8
Changes
6
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
20dcfd74
...
...
@@ -5,6 +5,10 @@
### IMPORTANT NOTES
*
The minimum ffmpeg version required is now 4.1
*
Deprecate static routes that will be removed in 3.0 (you may not have to do anything if you used paths returned by the video REST API):
*
`/static/avatars/`
: use
`/lazy-static/avatars/`
instead
*
`/static/previews/`
: use
`/lazy-static/previews/`
instead
*
`/static/video-captions/`
: use
`/lazy-static/video-captions/`
instead
*
Use
`playlistPosition`
URL parameter for playlists instead of
`videoId`
to set the current playlist position
### Maintenance
...
...
server/initializers/constants.ts
View file @
20dcfd74
...
...
@@ -545,8 +545,8 @@ const STATIC_DOWNLOAD_PATHS = {
}
const
LAZY_STATIC_PATHS
=
{
AVATARS
:
'
/lazy-static/avatars/
'
,
PREVIEWS
:
'
/static/previews/
'
,
VIDEO_CAPTIONS
:
'
/static/video-captions/
'
PREVIEWS
:
'
/
lazy-
static/previews/
'
,
VIDEO_CAPTIONS
:
'
/
lazy-
static/video-captions/
'
}
// Cache control
...
...
server/tests/api/server/services.ts
View file @
20dcfd74
...
...
@@ -70,7 +70,7 @@ describe('Test services', function () {
const
expectedHtml
=
'
<iframe width="560" height="315" sandbox="allow-same-origin allow-scripts"
'
+
`src="http://localhost:
${
server
.
port
}
/videos/embed/
${
server
.
video
.
uuid
}
" `
+
'
frameborder="0" allowfullscreen></iframe>
'
const
expectedThumbnailUrl
=
'
http://localhost:
'
+
server
.
port
+
'
/static/previews/
'
+
server
.
video
.
uuid
+
'
.jpg
'
const
expectedThumbnailUrl
=
'
http://localhost:
'
+
server
.
port
+
'
/
lazy-
static/previews/
'
+
server
.
video
.
uuid
+
'
.jpg
'
expect
(
res
.
body
.
html
).
to
.
equal
(
expectedHtml
)
expect
(
res
.
body
.
title
).
to
.
equal
(
server
.
video
.
name
)
...
...
server/tests/api/videos/video-captions.ts
View file @
20dcfd74
...
...
@@ -83,13 +83,13 @@ describe('Test video captions', function () {
const
caption1
:
VideoCaption
=
res
.
body
.
data
[
0
]
expect
(
caption1
.
language
.
id
).
to
.
equal
(
'
ar
'
)
expect
(
caption1
.
language
.
label
).
to
.
equal
(
'
Arabic
'
)
expect
(
caption1
.
captionPath
).
to
.
equal
(
'
/static/video-captions/
'
+
videoUUID
+
'
-ar.vtt
'
)
expect
(
caption1
.
captionPath
).
to
.
equal
(
'
/
lazy-
static/video-captions/
'
+
videoUUID
+
'
-ar.vtt
'
)
await
testCaptionFile
(
server
.
url
,
caption1
.
captionPath
,
'
Subtitle good 1.
'
)
const
caption2
:
VideoCaption
=
res
.
body
.
data
[
1
]
expect
(
caption2
.
language
.
id
).
to
.
equal
(
'
zh
'
)
expect
(
caption2
.
language
.
label
).
to
.
equal
(
'
Chinese
'
)
expect
(
caption2
.
captionPath
).
to
.
equal
(
'
/static/video-captions/
'
+
videoUUID
+
'
-zh.vtt
'
)
expect
(
caption2
.
captionPath
).
to
.
equal
(
'
/
lazy-
static/video-captions/
'
+
videoUUID
+
'
-zh.vtt
'
)
await
testCaptionFile
(
server
.
url
,
caption2
.
captionPath
,
'
Subtitle good 2.
'
)
}
})
...
...
@@ -117,7 +117,7 @@ describe('Test video captions', function () {
const
caption1
:
VideoCaption
=
res
.
body
.
data
[
0
]
expect
(
caption1
.
language
.
id
).
to
.
equal
(
'
ar
'
)
expect
(
caption1
.
language
.
label
).
to
.
equal
(
'
Arabic
'
)
expect
(
caption1
.
captionPath
).
to
.
equal
(
'
/static/video-captions/
'
+
videoUUID
+
'
-ar.vtt
'
)
expect
(
caption1
.
captionPath
).
to
.
equal
(
'
/
lazy-
static/video-captions/
'
+
videoUUID
+
'
-ar.vtt
'
)
await
testCaptionFile
(
server
.
url
,
caption1
.
captionPath
,
'
Subtitle good 2.
'
)
}
})
...
...
@@ -148,7 +148,7 @@ describe('Test video captions', function () {
const
caption1
:
VideoCaption
=
res
.
body
.
data
[
0
]
expect
(
caption1
.
language
.
id
).
to
.
equal
(
'
ar
'
)
expect
(
caption1
.
language
.
label
).
to
.
equal
(
'
Arabic
'
)
expect
(
caption1
.
captionPath
).
to
.
equal
(
'
/static/video-captions/
'
+
videoUUID
+
'
-ar.vtt
'
)
expect
(
caption1
.
captionPath
).
to
.
equal
(
'
/
lazy-
static/video-captions/
'
+
videoUUID
+
'
-ar.vtt
'
)
const
expected
=
'
WEBVTT FILE
\r\n
'
+
'
\r\n
'
+
...
...
@@ -185,7 +185,7 @@ describe('Test video captions', function () {
expect
(
caption
.
language
.
id
).
to
.
equal
(
'
zh
'
)
expect
(
caption
.
language
.
label
).
to
.
equal
(
'
Chinese
'
)
expect
(
caption
.
captionPath
).
to
.
equal
(
'
/static/video-captions/
'
+
videoUUID
+
'
-zh.vtt
'
)
expect
(
caption
.
captionPath
).
to
.
equal
(
'
/
lazy-
static/video-captions/
'
+
videoUUID
+
'
-zh.vtt
'
)
await
testCaptionFile
(
server
.
url
,
caption
.
captionPath
,
'
Subtitle good 2.
'
)
}
})
...
...
server/tests/api/videos/video-imports.ts
View file @
20dcfd74
...
...
@@ -123,7 +123,7 @@ describe('Test video imports', function () {
const
res
=
await
importVideo
(
servers
[
0
].
url
,
servers
[
0
].
accessToken
,
attributes
)
expect
(
res
.
body
.
video
.
name
).
to
.
equal
(
'
small video - youtube
'
)
expect
(
res
.
body
.
video
.
thumbnailPath
).
to
.
equal
(
`/static/thumbnails/
${
res
.
body
.
video
.
uuid
}
.jpg`
)
expect
(
res
.
body
.
video
.
previewPath
).
to
.
equal
(
`/static/previews/
${
res
.
body
.
video
.
uuid
}
.jpg`
)
expect
(
res
.
body
.
video
.
previewPath
).
to
.
equal
(
`/
lazy-
static/previews/
${
res
.
body
.
video
.
uuid
}
.jpg`
)
await
testImage
(
servers
[
0
].
url
,
'
video_import_thumbnail
'
,
res
.
body
.
video
.
thumbnailPath
)
await
testImage
(
servers
[
0
].
url
,
'
video_import_preview
'
,
res
.
body
.
video
.
previewPath
)
...
...
support/doc/api/openapi.yaml
View file @
20dcfd74
...
...
@@ -3887,7 +3887,7 @@ components:
example
:
/static/thumbnails/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
previewPath
:
type
:
string
example
:
/static/previews/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
example
:
/
lazy-
static/previews/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
embedPath
:
type
:
string
example
:
/videos/embed/a65bc12f-9383-462e-81ae-8207e8b434ee
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment