mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
feat: sort playlists by import date
This commit is contained in:
1 parent
7973b84bfd
commit
d967b12100
1 file changed
+8
-2
@@ -14,7 +14,10 @@ import { ElectronService } from '../services/electron.service';
|
||||
})
|
||||
export class HomeComponent {
|
||||
/** Added playlists */
|
||||
playlists: Pick<Playlist, 'count' | 'title' | '_id'>[] = [];
|
||||
playlists: Pick<
|
||||
Playlist,
|
||||
'count' | 'title' | 'filename' | '_id' | 'url' | 'importDate'
|
||||
>[] = [];
|
||||
/** Loading spinner state */
|
||||
isLoading = false;
|
||||
/** IPC Renderer commands list with callbacks */
|
||||
@@ -25,7 +28,10 @@ export class HomeComponent {
|
||||
},
|
||||
{
|
||||
id: 'playlist-all-result',
|
||||
execute: (response: any) => (this.playlists = response.payload),
|
||||
execute: (response: { payload: Partial<Playlist[]> }) =>
|
||||
(this.playlists = response.payload.sort((a, b) =>
|
||||
b.importDate.localeCompare(a.importDate)
|
||||
)),
|
||||
},
|
||||
{
|
||||
id: 'playlist-remove-by-id-result',
|
||||
|
||||
Reference in new issue
Block a user