aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/overview
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin/overview')
-rw-r--r--client/src/app/+admin/overview/comments/video-comment-list.component.ts2
-rw-r--r--client/src/app/+admin/overview/users/user-list/user-list.component.ts4
-rw-r--r--client/src/app/+admin/overview/videos/video-list.component.ts34
3 files changed, 18 insertions, 22 deletions
diff --git a/client/src/app/+admin/overview/comments/video-comment-list.component.ts b/client/src/app/+admin/overview/comments/video-comment-list.component.ts
index cfa68ed9d..28efdc076 100644
--- a/client/src/app/+admin/overview/comments/video-comment-list.component.ts
+++ b/client/src/app/+admin/overview/comments/video-comment-list.component.ts
@@ -117,7 +117,7 @@ export class VideoCommentListComponent extends RestTable <VideoCommentAdmin> imp
117 return this.markdownRenderer.textMarkdownToHTML({ markdown: text, withHtml: true, withEmoji: true }) 117 return this.markdownRenderer.textMarkdownToHTML({ markdown: text, withHtml: true, withEmoji: true })
118 } 118 }
119 119
120 reloadData () { 120 protected reloadDataInternal () {
121 this.videoCommentService.getAdminVideoComments({ 121 this.videoCommentService.getAdminVideoComments({
122 pagination: this.pagination, 122 pagination: this.pagination,
123 sort: this.sort, 123 sort: this.sort,
diff --git a/client/src/app/+admin/overview/users/user-list/user-list.component.ts b/client/src/app/+admin/overview/users/user-list/user-list.component.ts
index 7d62302f8..19420b748 100644
--- a/client/src/app/+admin/overview/users/user-list/user-list.component.ts
+++ b/client/src/app/+admin/overview/users/user-list/user-list.component.ts
@@ -283,9 +283,7 @@ export class UserListComponent extends RestTable <User> implements OnInit {
283 }) 283 })
284 } 284 }
285 285
286 protected reloadData () { 286 protected reloadDataInternal () {
287 this.selectedRows = []
288
289 this.userAdminService.getUsers({ 287 this.userAdminService.getUsers({
290 pagination: this.pagination, 288 pagination: this.pagination,
291 sort: this.sort, 289 sort: this.sort,
diff --git a/client/src/app/+admin/overview/videos/video-list.component.ts b/client/src/app/+admin/overview/videos/video-list.component.ts
index cd5d2eb34..1ea295499 100644
--- a/client/src/app/+admin/overview/videos/video-list.component.ts
+++ b/client/src/app/+admin/overview/videos/video-list.component.ts
@@ -183,9 +183,23 @@ export class VideoListComponent extends RestTable <Video> implements OnInit {
183 return files.reduce((p, f) => p += f.size, 0) 183 return files.reduce((p, f) => p += f.size, 0)
184 } 184 }
185 185
186 reloadData () { 186 async removeVideoFile (video: Video, file: VideoFile, type: 'hls' | 'webtorrent') {
187 this.selectedRows = [] 187 const message = $localize`Are you sure you want to delete this ${file.resolution.label} file?`
188 const res = await this.confirmService.confirm(message, $localize`Delete file`)
189 if (res === false) return
190
191 this.videoService.removeFile(video.uuid, file.id, type)
192 .subscribe({
193 next: () => {
194 this.notifier.success($localize`File removed.`)
195 this.reloadData()
196 },
197
198 error: err => this.notifier.error(err.message)
199 })
200 }
188 201
202 protected reloadDataInternal () {
189 this.loading = true 203 this.loading = true
190 204
191 this.videoAdminService.getAdminVideos({ 205 this.videoAdminService.getAdminVideos({
@@ -203,22 +217,6 @@ export class VideoListComponent extends RestTable <Video> implements OnInit {
203 }) 217 })
204 } 218 }
205 219
206 async removeVideoFile (video: Video, file: VideoFile, type: 'hls' | 'webtorrent') {
207 const message = $localize`Are you sure you want to delete this ${file.resolution.label} file?`
208 const res = await this.confirmService.confirm(message, $localize`Delete file`)
209 if (res === false) return
210
211 this.videoService.removeFile(video.uuid, file.id, type)
212 .subscribe({
213 next: () => {
214 this.notifier.success($localize`File removed.`)
215 this.reloadData()
216 },
217
218 error: err => this.notifier.error(err.message)
219 })
220 }
221
222 private async removeVideos (videos: Video[]) { 220 private async removeVideos (videos: Video[]) {
223 const message = prepareIcu($localize`Are you sure you want to delete {count, plural, =1 {this video} other {these {count} videos}}?`)( 221 const message = prepareIcu($localize`Are you sure you want to delete {count, plural, =1 {this video} other {these {count} videos}}?`)(
224 { count: videos.length }, 222 { count: videos.length },