Rename cover image file if not jpg extension

This commit is contained in:
Evan Fiordeliso 2025-07-18 20:52:42 -04:00
parent d42aabc5f2
commit 080074511a
1 changed files with 7 additions and 0 deletions

View File

@ -149,6 +149,13 @@ export default class BookTrackerPlugin extends Plugin {
maintainAspectRatio: true,
});
if (file.extension !== "jpg") {
await this.app.fileManager.renameFile(
file,
file.path.replace(/\.[^.]+$/, ".jpg")
);
}
return file;
}