generated from tpl/obsidian-sample-plugin
Rename cover image file if not jpg extension
This commit is contained in:
parent
d42aabc5f2
commit
080074511a
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue