Fix errors filtering filenames of synced file downloads
This commit is contained in:
parent
a2b7f086d7
commit
ff9e822bd3
|
@ -642,6 +642,7 @@ Zotero.Sync.Storage.Local = {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var dir = OS.Path.dirname(path);
|
||||||
var fileName = OS.Path.basename(path);
|
var fileName = OS.Path.basename(path);
|
||||||
var renamed = false;
|
var renamed = false;
|
||||||
|
|
||||||
|
@ -651,7 +652,7 @@ Zotero.Sync.Storage.Local = {
|
||||||
if (filteredName != fileName) {
|
if (filteredName != fileName) {
|
||||||
Zotero.debug("Filtering filename '" + fileName + "' to '" + filteredName + "'");
|
Zotero.debug("Filtering filename '" + fileName + "' to '" + filteredName + "'");
|
||||||
fileName = filteredName;
|
fileName = filteredName;
|
||||||
path = OS.Path.dirname(path, fileName);
|
path = OS.Path.join(dir, fileName);
|
||||||
renamed = true;
|
renamed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -670,7 +671,7 @@ Zotero.Sync.Storage.Local = {
|
||||||
Zotero.debug("Changed filename '" + fileName + "' to '" + finalFileName + "'");
|
Zotero.debug("Changed filename '" + fileName + "' to '" + finalFileName + "'");
|
||||||
|
|
||||||
fileName = finalFileName;
|
fileName = finalFileName;
|
||||||
path = OS.Path.dirname(path, fileName);
|
path = OS.Path.join(dir, fileName);
|
||||||
|
|
||||||
// Abort if Windows path limitation would cause filenames to be overly truncated
|
// Abort if Windows path limitation would cause filenames to be overly truncated
|
||||||
if (Zotero.isWin && fileName.length < 40) {
|
if (Zotero.isWin && fileName.length < 40) {
|
||||||
|
@ -859,7 +860,7 @@ Zotero.Sync.Storage.Local = {
|
||||||
throw new Error(msg);
|
throw new Error(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
destPath = OS.Path.join(OS.Path.dirname(destPath, shortened));
|
destPath = OS.Path.join(OS.Path.dirname(destPath), shortened);
|
||||||
|
|
||||||
if (primaryFile) {
|
if (primaryFile) {
|
||||||
renamed = true;
|
renamed = true;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user