Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix downloader metadata if not currently playing #252

Merged
merged 11 commits into from
May 7, 2021
Prev Previous commit
Next Next commit
fix error thrown when downloading playlist
  • Loading branch information
Araxeus committed May 5, 2021
commit d96fefbc24217399ff8ebfb825613b388ba3d6c4
8 changes: 5 additions & 3 deletions plugins/downloader/back.js
Original file line number Diff line number Diff line change
@@ -51,18 +51,20 @@ function handle(win) {
}

try {
const coverBuffer = songMetadata.image.toPNG();
const coverBuffer = songMetadata.image ? songMetadata.image.toPNG() : null;
const writer = new ID3Writer(songBuffer);

// Create the metadata tags
writer
.setFrame("TIT2", songMetadata.title)
.setFrame("TPE1", [songMetadata.artist])
.setFrame("APIC", {
.setFrame("TPE1", [songMetadata.artist]);
if (coverBuffer) {
writer.setFrame("APIC", {
type: 3,
data: coverBuffer,
description: "",
});
}
writer.addTag();
fileBuffer = Buffer.from(writer.arrayBuffer);
} catch (error) {