-import { uniqBy } from 'lodash'
+import { uniqBy } from 'lodash-es'
import { concat, Observable } from 'rxjs'
import { tap, toArray } from 'rxjs/operators'
import { Component, OnInit, ViewChild } from '@angular/core'
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 = [
{
.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}}?`)(