aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/thumbnail.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video/thumbnail.ts')
-rw-r--r--server/models/video/thumbnail.ts12
1 files changed, 10 insertions, 2 deletions
diff --git a/server/models/video/thumbnail.ts b/server/models/video/thumbnail.ts
index a4ac581e5..1722acdb4 100644
--- a/server/models/video/thumbnail.ts
+++ b/server/models/video/thumbnail.ts
@@ -21,7 +21,7 @@ import { AttributesOnly } from '@shared/typescript-utils'
21import { ThumbnailType } from '../../../shared/models/videos/thumbnail.type' 21import { ThumbnailType } from '../../../shared/models/videos/thumbnail.type'
22import { logger } from '../../helpers/logger' 22import { logger } from '../../helpers/logger'
23import { CONFIG } from '../../initializers/config' 23import { CONFIG } from '../../initializers/config'
24import { CONSTRAINTS_FIELDS, LAZY_STATIC_PATHS, STATIC_PATHS, WEBSERVER } from '../../initializers/constants' 24import { CONSTRAINTS_FIELDS, LAZY_STATIC_PATHS, WEBSERVER } from '../../initializers/constants'
25import { VideoModel } from './video' 25import { VideoModel } from './video'
26import { VideoPlaylistModel } from './video-playlist' 26import { VideoPlaylistModel } from './video-playlist'
27 27
@@ -69,6 +69,10 @@ export class ThumbnailModel extends Model<Partial<AttributesOnly<ThumbnailModel>
69 @Column 69 @Column
70 automaticallyGenerated: boolean 70 automaticallyGenerated: boolean
71 71
72 @AllowNull(false)
73 @Column
74 onDisk: boolean
75
72 @ForeignKey(() => VideoModel) 76 @ForeignKey(() => VideoModel)
73 @Column 77 @Column
74 videoId: number 78 videoId: number
@@ -106,7 +110,7 @@ export class ThumbnailModel extends Model<Partial<AttributesOnly<ThumbnailModel>
106 [ThumbnailType.MINIATURE]: { 110 [ThumbnailType.MINIATURE]: {
107 label: 'miniature', 111 label: 'miniature',
108 directory: CONFIG.STORAGE.THUMBNAILS_DIR, 112 directory: CONFIG.STORAGE.THUMBNAILS_DIR,
109 staticPath: STATIC_PATHS.THUMBNAILS 113 staticPath: LAZY_STATIC_PATHS.THUMBNAILS
110 }, 114 },
111 [ThumbnailType.PREVIEW]: { 115 [ThumbnailType.PREVIEW]: {
112 label: 'preview', 116 label: 'preview',
@@ -197,4 +201,8 @@ export class ThumbnailModel extends Model<Partial<AttributesOnly<ThumbnailModel>
197 201
198 this.previousThumbnailFilename = undefined 202 this.previousThumbnailFilename = undefined
199 } 203 }
204
205 isOwned () {
206 return !this.fileUrl
207 }
200} 208}