]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/actor/actor-image.ts
Move typescript utils in its own directory
[github/Chocobozzz/PeerTube.git] / server / models / actor / actor-image.ts
index a35f9edb0c76b0ef52ab712fef2db99e1f894921..8edff5ab4178135bee07930429f8bbc55b21072d 100644 (file)
@@ -2,7 +2,7 @@ import { remove } from 'fs-extra'
 import { join } from 'path'
 import { AfterDestroy, AllowNull, Column, CreatedAt, Default, Is, Model, Table, UpdatedAt } from 'sequelize-typescript'
 import { MActorImageFormattable } from '@server/types/models'
-import { AttributesOnly } from '@shared/core-utils'
+import { AttributesOnly } from '@shared/typescript-utils'
 import { ActorImageType } from '@shared/models'
 import { ActorImage } from '../../../shared/models/actors/actor-image.model'
 import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc'
@@ -98,4 +98,8 @@ export class ActorImageModel extends Model<Partial<AttributesOnly<ActorImageMode
     const imagePath = join(CONFIG.STORAGE.ACTOR_IMAGES, this.filename)
     return remove(imagePath)
   }
+
+  isOwned () {
+    return !this.fileUrl
+  }
 }