diff options
author | Chocobozzz <me@florianbigard.com> | 2021-02-12 16:23:19 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-02-16 10:36:44 +0100 |
commit | a8b1b40485145ac1eae513a661d7dd6e0986ce96 (patch) | |
tree | 79436a042f1ed350278dd69e365f37ee623aa539 /server/models/video/video.ts | |
parent | 0472d474fdadd05211fb4f90ce275801db515d08 (diff) | |
download | PeerTube-a8b1b40485145ac1eae513a661d7dd6e0986ce96.tar.gz PeerTube-a8b1b40485145ac1eae513a661d7dd6e0986ce96.tar.zst PeerTube-a8b1b40485145ac1eae513a661d7dd6e0986ce96.zip |
Generate a name for thumbnails
Allows aggressive caching
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r-- | server/models/video/video.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 14e80a3ba..3321deed3 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -130,6 +130,7 @@ import { VideoShareModel } from './video-share' | |||
130 | import { VideoStreamingPlaylistModel } from './video-streaming-playlist' | 130 | import { VideoStreamingPlaylistModel } from './video-streaming-playlist' |
131 | import { VideoTagModel } from './video-tag' | 131 | import { VideoTagModel } from './video-tag' |
132 | import { VideoViewModel } from './video-view' | 132 | import { VideoViewModel } from './video-view' |
133 | import { v4 as uuidv4 } from 'uuid' | ||
133 | 134 | ||
134 | export enum ScopeNames { | 135 | export enum ScopeNames { |
135 | AVAILABLE_FOR_LIST_IDS = 'AVAILABLE_FOR_LIST_IDS', | 136 | AVAILABLE_FOR_LIST_IDS = 'AVAILABLE_FOR_LIST_IDS', |
@@ -1827,7 +1828,7 @@ export class VideoModel extends Model { | |||
1827 | } | 1828 | } |
1828 | 1829 | ||
1829 | generateThumbnailName () { | 1830 | generateThumbnailName () { |
1830 | return this.uuid + '.jpg' | 1831 | return uuidv4() + '.jpg' |
1831 | } | 1832 | } |
1832 | 1833 | ||
1833 | getMiniature () { | 1834 | getMiniature () { |
@@ -1837,7 +1838,7 @@ export class VideoModel extends Model { | |||
1837 | } | 1838 | } |
1838 | 1839 | ||
1839 | generatePreviewName () { | 1840 | generatePreviewName () { |
1840 | return this.uuid + '.jpg' | 1841 | return uuidv4() + '.jpg' |
1841 | } | 1842 | } |
1842 | 1843 | ||
1843 | hasPreview () { | 1844 | hasPreview () { |