mirror of https://github.com/Chocobozzz/PeerTube
Support is:blacklisted as video-abuse-list filter
parent
7f979fd8aa
commit
9b1fa49b60
|
@ -24,7 +24,7 @@
|
||||||
<a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'state:pending' }" class="dropdown-item" i18n>Unsolved reports</a>
|
<a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'state:pending' }" class="dropdown-item" i18n>Unsolved reports</a>
|
||||||
<a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'state:accepted' }" class="dropdown-item" i18n>Accepted reports</a>
|
<a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'state:accepted' }" class="dropdown-item" i18n>Accepted reports</a>
|
||||||
<a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'state:rejected' }" class="dropdown-item" i18n>Refused reports</a>
|
<a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'state:rejected' }" class="dropdown-item" i18n>Refused reports</a>
|
||||||
<a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'is:blocked' }" class="dropdown-item" i18n>Reports with blocked videos</a>
|
<a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'is:blacklisted' }" class="dropdown-item" i18n>Reports with blacklisted videos</a>
|
||||||
<a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'is:deleted' }" class="dropdown-item" i18n>Reports with deleted videos</a>
|
<a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'is:deleted' }" class="dropdown-item" i18n>Reports with deleted videos</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -90,10 +90,13 @@ export enum ScopeNames {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.is) {
|
let onlyBlacklisted = false
|
||||||
|
if (options.is === "deleted") {
|
||||||
where = Object.assign(where, {
|
where = Object.assign(where, {
|
||||||
...options.is
|
deletedVideo: { [Op.not]: null }
|
||||||
})
|
})
|
||||||
|
} else if (options.is === "blacklisted") {
|
||||||
|
onlyBlacklisted = true
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -184,7 +187,7 @@ export enum ScopeNames {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
model: VideoModel,
|
model: VideoModel,
|
||||||
required: false,
|
required: onlyBlacklisted,
|
||||||
where: searchAttribute(options.searchVideo, 'name'),
|
where: searchAttribute(options.searchVideo, 'name'),
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
|
@ -202,7 +205,8 @@ export enum ScopeNames {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
attributes: [ 'id', 'reason', 'unfederated' ],
|
attributes: [ 'id', 'reason', 'unfederated' ],
|
||||||
model: VideoBlacklistModel
|
model: VideoBlacklistModel,
|
||||||
|
required: onlyBlacklisted
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -328,7 +332,8 @@ export class VideoAbuseModel extends Model<VideoAbuseModel> {
|
||||||
is: {
|
is: {
|
||||||
prefix: 'is:',
|
prefix: 'is:',
|
||||||
handler: v => {
|
handler: v => {
|
||||||
if (v === "deleted") return { deletedVideo: { [Op.not]: null } }
|
if (v === "deleted") return v
|
||||||
|
if (v === "blacklisted") return v
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue