Преглед изворни кода

fix: small misc type/error handling fixes

Kristian Vos пре 4 дана
родитељ
комит
f0d8ac0ebc

+ 1 - 1
backend/logic/musicbrainz.js

@@ -173,7 +173,7 @@ class _MusicBrainzModule extends CoreClass {
 					resolve(responseData);
 				})
 				.catch(err => {
-					if (err.response.status === 404) {
+					if (err?.response?.status === 404) {
 						resolve(err.response.data);
 					} else reject(err);
 				});

+ 3 - 1
frontend/src/classes/SocketHandler.class.ts

@@ -189,7 +189,9 @@ export default class SocketHandler {
 		return this.socket.send(JSON.stringify([...args]));
 	}
 
-	dispatchAsync(...args: [string, ...any]) {
+	dispatchAsync(
+		...args: [string, ...any]
+	): Promise<{ res: any; extraRes: any[] }> {
 		return new Promise(resolve => {
 			this.dispatch(...args, (res, ...extraRes) => {
 				resolve({

+ 3 - 0
frontend/src/types/artist.ts

@@ -10,6 +10,7 @@ export interface YoutubeVideoTemp {
 	duration: number;
 	rawData: {
 		snippet: {
+			title: string;
 			categoryId: string;
 			channelId: string;
 			channelTitle: string;
@@ -110,6 +111,8 @@ export interface RecordingTemp {
 			"type-id": string;
 		};
 	}[];
+	// custom
+	hide2?: boolean;
 }
 
 export interface TrackTemp {