fix rename when file in subdir
This commit is contained in:
parent
b9281ff02f
commit
f35f2cc6d5
@ -4,6 +4,7 @@ const audioExtensions =['mp3', 'ogg', 'wav', 'flac'];
|
||||
|
||||
const invalidFileNameCharsRe =/[\\/\|:\*\?"<>]/; // dont allow \/|:*?<>
|
||||
const invalidFileNameChars = "\\/|:*?<>";
|
||||
const splitFilePathRe = /(.*\/)?([^/]*?)(\.[^/.]+)?$/;
|
||||
|
||||
const mappings = new Map(JSON.parse(localStorage.getItem('mappings')) || []);
|
||||
let statusLine = document.getElementById('status');
|
||||
@ -194,6 +195,7 @@ function setCurrentFile() {
|
||||
}
|
||||
// else if (currentFileIdx < fileList.length) {
|
||||
// }
|
||||
// st:
|
||||
else if (currentFileIdx >= fileList.length) {
|
||||
currentFileIdx = fileList.length - 1;
|
||||
}
|
||||
@ -208,7 +210,7 @@ function setCurrentFile() {
|
||||
}
|
||||
|
||||
// set filename in input field
|
||||
const fileNameNoExt = currentFile.replace(/\.[^/.]+$/, "");
|
||||
const fileNameNoExt = currentFile.replace(splitFilePathRe, "$2");
|
||||
document.getElementById('filename').value = fileNameNoExt;
|
||||
|
||||
renderCurrentFile();
|
||||
|
Loading…
Reference in New Issue
Block a user