mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
refactor: resolve eslint issues
This commit is contained in:
3 files changed
+9
-28
No files matched your search
@@ -293,7 +293,7 @@ export class Api {
|
||||
*/
|
||||
createPlaylistObject(
|
||||
name: string,
|
||||
playlist: any,
|
||||
playlist: ParsedPlaylist,
|
||||
urlOrPath?: string,
|
||||
uploadType?: 'URL' | 'FILE'
|
||||
): Playlist {
|
||||
@@ -319,26 +319,6 @@ export class Api {
|
||||
};
|
||||
}
|
||||
|
||||
saveUpdatedPlaylist(
|
||||
id: string,
|
||||
playlist: any
|
||||
): Promise<{
|
||||
numAffected: number;
|
||||
upsert: boolean;
|
||||
}> {
|
||||
return db.update(
|
||||
{ _id: id },
|
||||
{
|
||||
$set: {
|
||||
playlist,
|
||||
count: playlist.items.length,
|
||||
updateDate: Date.now(),
|
||||
updateState: PlaylistUpdateState.UPDATED,
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the provided playlist in the database
|
||||
* @param id id of the playlist
|
||||
@@ -368,7 +348,7 @@ export class Api {
|
||||
*/
|
||||
async handlePlaylistRefresh(
|
||||
id: string,
|
||||
playlistString: any,
|
||||
playlistString: string,
|
||||
event?: Electron.IpcMainEvent
|
||||
): Promise<void> {
|
||||
const playlist: ParsedPlaylist =
|
||||
@@ -449,6 +429,7 @@ export class Api {
|
||||
/**
|
||||
* Sends an error message to the renderer process
|
||||
* @param error
|
||||
* @param id
|
||||
* @param event
|
||||
*/
|
||||
handleFileNotFoundError(
|
||||
@@ -460,7 +441,7 @@ export class Api {
|
||||
},
|
||||
id: string,
|
||||
event?: Electron.IpcMainEvent
|
||||
) {
|
||||
): void {
|
||||
console.error(error);
|
||||
this.updatePlaylistById(id, {
|
||||
updateState: PlaylistUpdateState.NOT_UPDATED,
|
||||
@@ -475,7 +456,7 @@ export class Api {
|
||||
}
|
||||
}
|
||||
|
||||
convertFileStringToPlaylist(m3uString: string): any {
|
||||
convertFileStringToPlaylist(m3uString: string): ParsedPlaylist {
|
||||
return this.parsePlaylist(m3uString.split('\n'));
|
||||
}
|
||||
|
||||
@@ -483,7 +464,7 @@ export class Api {
|
||||
* Parses string based array to playlist object
|
||||
* @param m3uArray m3u playlist as array with strings
|
||||
*/
|
||||
parsePlaylist(m3uArray: any[]): any {
|
||||
parsePlaylist(m3uArray: string[]): ParsedPlaylist {
|
||||
const playlistAsString = m3uArray.join('\n');
|
||||
return parse(playlistAsString);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ export class HomeComponent {
|
||||
commandsList = [
|
||||
{
|
||||
id: PLAYLIST_PARSE_RESPONSE,
|
||||
execute: (response: { payload: Playlist }) =>
|
||||
execute: (response: { payload: Playlist }): void =>
|
||||
this.setPlaylist(response.payload),
|
||||
},
|
||||
{
|
||||
@@ -71,7 +71,7 @@ export class HomeComponent {
|
||||
},
|
||||
{
|
||||
id: PLAYLIST_UPDATE_RESPONSE,
|
||||
execute: (response: { message: string }) =>
|
||||
execute: (response: { message: string }): void =>
|
||||
this.showNotification(response.message),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -27,7 +27,7 @@ class MatSnackBarStub {
|
||||
}
|
||||
|
||||
export class MockRouter {
|
||||
navigateByUrl(url: string) {
|
||||
navigateByUrl(url: string): string {
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user