mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-12 20:16: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 {
|
export class HomeComponent {
|
||||||
/** Added playlists */
|
/** Added playlists */
|
||||||
playlists: Pick<Playlist, 'count' | 'title' | '_id'>[] = [];
|
playlists: Pick<
|
||||||
|
Playlist,
|
||||||
|
'count' | 'title' | 'filename' | '_id' | 'url' | 'importDate'
|
||||||
|
>[] = [];
|
||||||
/** Loading spinner state */
|
/** Loading spinner state */
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
/** IPC Renderer commands list with callbacks */
|
/** IPC Renderer commands list with callbacks */
|
||||||
@@ -25,7 +28,10 @@ export class HomeComponent {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'playlist-all-result',
|
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',
|
id: 'playlist-remove-by-id-result',
|
||||||
|
|||||||
Reference in new issue
Block a user