return VideoRedundancyModel.scope([ ScopeNames.WITH_VIDEO ]).findOne(query)
}
- static async listLocalExpired () {
+ static async listLocalExpired (): Promise<MVideoRedundancyVideo[]> {
const actor = await getServerActor()
const query = {
const query = {
where: {
- actorId: actor.id
+ [Op.and]: [
+ {
+ actorId: actor.id
+ },
+ {
+ [Op.or]: [
+ {
+ '$VideoStreamingPlaylist.id$': {
+ [Op.ne]: null
+ }
+ },
+ {
+ '$VideoFile.id$': {
+ [Op.ne]: null
+ }
+ }
+ ]
+ }
+ ]
},
include: [
{
- model: VideoFileModel,
+ model: VideoFileModel.unscoped(),
required: false,
include: [ buildVideoInclude() ]
},
{
- model: VideoStreamingPlaylistModel,
+ model: VideoStreamingPlaylistModel.unscoped(),
required: false,
include: [ buildVideoInclude() ]
}
return undefined
}
+ getVideoUUID () {
+ const video = this.getVideo()
+ if (!video) return undefined
+
+ return video.uuid
+ }
+
isOwned () {
return !!this.strategy
}