X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bmy-library%2Fmy-videos%2Fmy-videos.component.ts;h=57b8bdf7de26518bb0671d08456dfff7e513ada6;hb=HEAD;hp=bcfc66099bcf32271c27cc70987adaeb60142817;hpb=77239b425a8e00822a53c9907415832a473c3eb6;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+my-library/my-videos/my-videos.component.ts b/client/src/app/+my-library/my-videos/my-videos.component.ts index bcfc66099..57b8bdf7d 100644 --- a/client/src/app/+my-library/my-videos/my-videos.component.ts +++ b/client/src/app/+my-library/my-videos/my-videos.component.ts @@ -105,12 +105,14 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook { this.user = this.authService.getUser() this.userChannels = this.user.videoChannels - const channelFilters = this.userChannels.map(c => { - return { - value: 'channel:' + c.name, - label: c.name - } - }) + const channelFilters = [ ...this.userChannels ] + .sort((a, b) => a.displayName.localeCompare(b.displayName)) + .map(c => { + return { + value: 'channel:' + c.name, + label: c.displayName + } + }) this.inputFilters = [ { @@ -171,15 +173,15 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook { .subscribe(result => { this.videosContainedInPlaylists = Object.keys(result).reduce((acc, videoId) => ({ ...acc, - [videoId]: uniqBy(result[videoId], (p: VideoExistInPlaylist) => p.playlistId) + [videoId]: uniqBy(result[+videoId], (p: VideoExistInPlaylist) => p.playlistId) }), this.videosContainedInPlaylists) }) } async deleteSelectedVideos () { - const toDeleteVideosIds = Object.keys(this.selection) - .filter(k => this.selection[k] === true) - .map(k => parseInt(k, 10)) + const toDeleteVideosIds = Object.entries(this.selection) + .filter(([ _k, v ]) => v === true) + .map(([ k, _v ]) => parseInt(k, 10)) const res = await this.confirmService.confirm( prepareIcu($localize`Do you really want to delete {length, plural, =1 {this video} other {{length} videos}}?`)(