diff options
author | Chocobozzz <me@florianbigard.com> | 2021-04-08 10:35:49 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-04-08 13:38:04 +0200 |
commit | a0eeb45f14bab539f505861cad8f5d42d9ba30cb (patch) | |
tree | 773eb5aa575c8ab870b9c84f686e6062aa58d9fd /server/models/video/video.ts | |
parent | ca873292899c9a822a236556993916d98da14913 (diff) | |
download | PeerTube-a0eeb45f14bab539f505861cad8f5d42d9ba30cb.tar.gz PeerTube-a0eeb45f14bab539f505861cad8f5d42d9ba30cb.tar.zst PeerTube-a0eeb45f14bab539f505861cad8f5d42d9ba30cb.zip |
Update data in DB when regenerate thumbnails
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r-- | server/models/video/video.ts | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 086269921..b10c6e38e 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -24,7 +24,6 @@ import { | |||
24 | Table, | 24 | Table, |
25 | UpdatedAt | 25 | UpdatedAt |
26 | } from 'sequelize-typescript' | 26 | } from 'sequelize-typescript' |
27 | import { v4 as uuidv4 } from 'uuid' | ||
28 | import { buildNSFWFilter } from '@server/helpers/express-utils' | 27 | import { buildNSFWFilter } from '@server/helpers/express-utils' |
29 | import { getPrivaciesForFederation, isPrivacyForFederation, isStateForFederation } from '@server/helpers/video' | 28 | import { getPrivaciesForFederation, isPrivacyForFederation, isStateForFederation } from '@server/helpers/video' |
30 | import { LiveManager } from '@server/lib/live-manager' | 29 | import { LiveManager } from '@server/lib/live-manager' |
@@ -1871,20 +1870,12 @@ export class VideoModel extends Model { | |||
1871 | this.Thumbnails.push(savedThumbnail) | 1870 | this.Thumbnails.push(savedThumbnail) |
1872 | } | 1871 | } |
1873 | 1872 | ||
1874 | generateThumbnailName () { | ||
1875 | return uuidv4() + '.jpg' | ||
1876 | } | ||
1877 | |||
1878 | getMiniature () { | 1873 | getMiniature () { |
1879 | if (Array.isArray(this.Thumbnails) === false) return undefined | 1874 | if (Array.isArray(this.Thumbnails) === false) return undefined |
1880 | 1875 | ||
1881 | return this.Thumbnails.find(t => t.type === ThumbnailType.MINIATURE) | 1876 | return this.Thumbnails.find(t => t.type === ThumbnailType.MINIATURE) |
1882 | } | 1877 | } |
1883 | 1878 | ||
1884 | generatePreviewName () { | ||
1885 | return uuidv4() + '.jpg' | ||
1886 | } | ||
1887 | |||
1888 | hasPreview () { | 1879 | hasPreview () { |
1889 | return !!this.getPreview() | 1880 | return !!this.getPreview() |
1890 | } | 1881 | } |