refactor: resolve eslint issues

This commit is contained in:
4gray committed 2021-05-21 11:12:02 +02:00
1 parent 0099191b2c
commit cf6b5b691a
3 files changed
+9 -28

No files matched your search

+6 -25
View File
@@ -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);
}
+2 -2
View File
@@ -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),
},
];
+1 -1
View File
@@ -27,7 +27,7 @@ class MatSnackBarStub {
}
export class MockRouter {
navigateByUrl(url: string) {
navigateByUrl(url: string): string {
return url;
}
}