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, 8 insertions, 4 deletions
diff --git a/server/models/video/thumbnail.ts b/server/models/video/thumbnail.ts
index 3d885f654..4185ec5f2 100644
--- a/server/models/video/thumbnail.ts
+++ b/server/models/video/thumbnail.ts
@@ -158,6 +158,12 @@ export class ThumbnailModel extends Model {
158 return ThumbnailModel.findOne(query) 158 return ThumbnailModel.findOne(query)
159 } 159 }
160 160
161 static buildPath (type: ThumbnailType, filename: string) {
162 const directory = ThumbnailModel.types[type].directory
163
164 return join(directory, filename)
165 }
166
161 getFileUrl (video: MVideoAccountLight) { 167 getFileUrl (video: MVideoAccountLight) {
162 const staticPath = ThumbnailModel.types[this.type].staticPath + this.filename 168 const staticPath = ThumbnailModel.types[this.type].staticPath + this.filename
163 169
@@ -169,13 +175,11 @@ export class ThumbnailModel extends Model {
169 } 175 }
170 176
171 getPath () { 177 getPath () {
172 const directory = ThumbnailModel.types[this.type].directory 178 return ThumbnailModel.buildPath(this.type, this.filename)
173 return join(directory, this.filename)
174 } 179 }
175 180
176 getPreviousPath () { 181 getPreviousPath () {
177 const directory = ThumbnailModel.types[this.type].directory 182 return ThumbnailModel.buildPath(this.type, this.previousThumbnailFilename)
178 return join(directory, this.previousThumbnailFilename)
179 } 183 }
180 184
181 removeThumbnail () { 185 removeThumbnail () {