clean up old logs

This commit is contained in:
jeffvli
2026-01-16 11:05:33 -08:00
parent dc5414284a
commit 431ff76e19
6 changed files with 10 additions and 16 deletions
+3 -5
View File
@@ -100,7 +100,7 @@ export async function getLyricsBySongId(url: string): Promise<null | string> {
try {
result = await axios.get<string>(url, { responseType: 'text' });
} catch (e) {
console.error('Genius lyrics request got an error!', e);
console.error('Genius lyrics request got an error!', (e as Error)?.message);
return null;
}
@@ -138,7 +138,7 @@ export async function getSearchResults(
},
});
} catch (e) {
console.error('Genius search request got an error!', e);
console.error('Genius search request got an error!', (e as Error)?.message);
return null;
}
@@ -163,13 +163,11 @@ export async function query(
): Promise<InternetProviderLyricResponse | null> {
const response = await getSongId(params);
if (!response) {
console.error('Could not find the song on Genius!');
return null;
}
const lyrics = await getLyricsBySongId(response.id);
if (!lyrics) {
console.error('Could not get lyrics on Genius!');
return null;
}
@@ -194,7 +192,7 @@ async function getSongId(
},
});
} catch (e) {
console.error('Genius search request got an error!', e);
console.error('Genius search request got an error!', (e as Error)?.message);
return null;
}
+3 -4
View File
@@ -42,7 +42,7 @@ export async function getLyricsBySongId(songId: string): Promise<null | string>
try {
result = await axios.get<LrcLibTrackResponse>(`${FETCH_URL}/${songId}`);
} catch (e) {
console.error('LrcLib lyrics request got an error!', e);
console.error('LrcLib lyrics request got an error!', (e as Error)?.message);
return null;
}
@@ -65,7 +65,7 @@ export async function getSearchResults(
},
});
} catch (e) {
console.error('LrcLib search request got an error!', e);
console.error('LrcLib search request got an error!', (e as Error)?.message);
return null;
}
@@ -102,14 +102,13 @@ export async function query(
timeout: TIMEOUT_MS,
});
} catch (e) {
console.error('LrcLib search request got an error!', e);
console.error('LrcLib search request got an error!', (e as Error).message);
return null;
}
const lyrics = result.data.syncedLyrics || result.data.plainLyrics || null;
if (!lyrics) {
console.error(`Could not get lyrics on LrcLib!`);
return null;
}
-2
View File
@@ -141,13 +141,11 @@ export async function query(
): Promise<InternetProviderLyricResponse | null> {
const lyricsMatch = await getMatchedLyrics(params);
if (!lyricsMatch) {
console.error('Could not find the song on NetEase!');
return null;
}
const lyrics = await getLyricsBySongId(lyricsMatch.id);
if (!lyrics) {
console.error('Could not get lyrics on NetEase!');
return null;
}