Skip to content

Commit

Permalink
Merge branch 'master' into support-spotify-playlist-shorthand-url
Browse files Browse the repository at this point in the history
  • Loading branch information
taahamahdi authored Nov 6, 2023
2 parents 83ee78a + 0bd45a8 commit bf979a3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kmq",
"version": "7.3.0",
"version": "7.3.1",
"main": "src/kmq.js",
"scripts": {
"seed": ". ./.env && ts-node --swc src/seed/seed_db",
Expand Down
17 changes: 10 additions & 7 deletions src/helpers/discord_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1611,13 +1611,16 @@ export async function sendBookmarkedSongs(
inline: boolean;
}> = [...songs].map((bookmarkedSong) => ({
name: `${bold(
`"${getLocalizedSongName(
bookmarkedSong[1].song,
locale,
)}" - ${getLocalizedArtistName(
bookmarkedSong[1].song,
locale,
)}`,
truncatedString(
`"${getLocalizedSongName(
bookmarkedSong[1].song,
locale,
)}" - ${getLocalizedArtistName(
bookmarkedSong[1].song,
locale,
)}`,
256,
),
)} (${standardDateFormat(bookmarkedSong[1].song.publishDate)})`,
value: `[${friendlyFormattedNumber(
bookmarkedSong[1].song.views,
Expand Down
5 changes: 5 additions & 0 deletions src/scripts/download-new-songs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ const downloadSong = (db: DatabaseContext, id: string): Promise<void> => {

cacheStream.once("finish", async () => {
try {
if ((await fs.promises.stat(tempLocation)).size === 0) {
reject(new Error(`Song file is empty. id = ${id}`));
return;
}

await fs.promises.rename(tempLocation, cachedSongLocation);
const duration =
await getAudioDurationInSeconds(cachedSongLocation);
Expand Down

0 comments on commit bf979a3

Please sign in to comment.