aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-video-miniature
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-27 14:37:04 +0200
committerChocobozzz <chocobozzz@cpy.re>2021-10-29 11:48:21 +0200
commit2760b454a761f6af3138b2fb5f34340772ab0d1e (patch)
tree2b3a2d81478f8b432eb54cce4caa5a760c494627 /client/src/app/shared/shared-video-miniature
parente4611b54910d8e7f2b4f8a97ee2d9cc8e1054127 (diff)
downloadPeerTube-2760b454a761f6af3138b2fb5f34340772ab0d1e.tar.gz
PeerTube-2760b454a761f6af3138b2fb5f34340772ab0d1e.tar.zst
PeerTube-2760b454a761f6af3138b2fb5f34340772ab0d1e.zip
Deprecate filter video query
Introduce include and isLocal instead
Diffstat (limited to 'client/src/app/shared/shared-video-miniature')
-rw-r--r--client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts2
-rw-r--r--client/src/app/shared/shared-video-miniature/video-filters.model.ts22
-rw-r--r--client/src/app/shared/shared-video-miniature/video-miniature.component.html2
3 files changed, 14 insertions, 12 deletions
diff --git a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
index 2ba091438..feac79d4e 100644
--- a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
+++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
@@ -188,7 +188,7 @@ export class VideoActionsDropdownComponent implements OnChanges {
188 this.notifier.success($localize`Video ${this.video.name} unblocked.`) 188 this.notifier.success($localize`Video ${this.video.name} unblocked.`)
189 189
190 this.video.blacklisted = false 190 this.video.blacklisted = false
191 this.video.blockedReason = null 191 this.video.blacklistedReason = null
192 192
193 this.videoUnblocked.emit() 193 this.videoUnblocked.emit()
194 }, 194 },
diff --git a/client/src/app/shared/shared-video-miniature/video-filters.model.ts b/client/src/app/shared/shared-video-miniature/video-filters.model.ts
index 920dc826c..5ad7cf3f7 100644
--- a/client/src/app/shared/shared-video-miniature/video-filters.model.ts
+++ b/client/src/app/shared/shared-video-miniature/video-filters.model.ts
@@ -1,6 +1,6 @@
1import { intoArray, toBoolean } from '@app/helpers' 1import { intoArray, toBoolean } from '@app/helpers'
2import { AttributesOnly } from '@shared/core-utils' 2import { AttributesOnly } from '@shared/core-utils'
3import { BooleanBothQuery, NSFWPolicyType, VideoFilter, VideoSortField } from '@shared/models' 3import { BooleanBothQuery, NSFWPolicyType, VideoInclude, VideoSortField } from '@shared/models'
4 4
5type VideoFiltersKeys = { 5type VideoFiltersKeys = {
6 [ id in keyof AttributesOnly<VideoFilters> ]: any 6 [ id in keyof AttributesOnly<VideoFilters> ]: any
@@ -196,14 +196,15 @@ export class VideoFilters {
196 } 196 }
197 197
198 toVideosAPIObject () { 198 toVideosAPIObject () {
199 let filter: VideoFilter 199 let isLocal: boolean
200 200 let include: VideoInclude
201 if (this.scope === 'local' && this.allVideos) { 201
202 filter = 'all-local' 202 if (this.scope === 'local') {
203 } else if (this.scope === 'federated' && this.allVideos) { 203 isLocal = true
204 filter = 'all' 204 }
205 } else if (this.scope === 'local') { 205
206 filter = 'local' 206 if (this.allVideos) {
207 include = VideoInclude.NOT_PUBLISHED_STATE | VideoInclude.HIDDEN_PRIVACY
207 } 208 }
208 209
209 let isLive: boolean 210 let isLive: boolean
@@ -216,7 +217,8 @@ export class VideoFilters {
216 languageOneOf: this.languageOneOf, 217 languageOneOf: this.languageOneOf,
217 categoryOneOf: this.categoryOneOf, 218 categoryOneOf: this.categoryOneOf,
218 search: this.search, 219 search: this.search,
219 filter, 220 isLocal,
221 include,
220 isLive 222 isLive
221 } 223 }
222 } 224 }
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.html b/client/src/app/shared/shared-video-miniature/video-miniature.component.html
index b12495f90..30483831a 100644
--- a/client/src/app/shared/shared-video-miniature/video-miniature.component.html
+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.html
@@ -55,7 +55,7 @@
55 55
56 <div *ngIf="displayOptions.blacklistInfo && video.blacklisted" class="video-info-blocked"> 56 <div *ngIf="displayOptions.blacklistInfo && video.blacklisted" class="video-info-blocked">
57 <span class="blocked-label" i18n>Blocked</span> 57 <span class="blocked-label" i18n>Blocked</span>
58 <span class="blocked-reason" *ngIf="video.blockedReason">{{ video.blockedReason }}</span> 58 <span class="blocked-reason" *ngIf="video.blacklistedReason">{{ video.blacklistedReason }}</span>
59 </div> 59 </div>
60 60
61 <div i18n *ngIf="displayOptions.nsfw && video.nsfw" class="video-info-nsfw"> 61 <div i18n *ngIf="displayOptions.nsfw && video.nsfw" class="video-info-nsfw">