Mendeley import: Only limit paths to 260 characters on Windows
This commit is contained in:
parent
7582147dd5
commit
b511e452a8
1 changed files with 2 additions and 1 deletions
|
@ -708,7 +708,8 @@ Zotero_Import_Mendeley.prototype._getDocumentFilesAPI = async function (document
|
|||
for (let file of (doc.files || [])) {
|
||||
var fileName = Zotero.File.truncateFileName(Zotero.File.getValidFileName(file.file_name || 'file'), 255); // most filesystems limit filename to 255 characters
|
||||
var tmpFile = OS.Path.join(Zotero.getTempDirectory().path, `m-api-${this.timestamp}-${file.id}`, fileName);
|
||||
if (tmpFile.length >= 260) {
|
||||
// Limit path length on Windows
|
||||
if (Zotero.isWin && tmpFile.length >= 260) {
|
||||
const surplus = tmpFile.length - 260;
|
||||
if (surplus >= fileName.length) {
|
||||
Zotero.logError(`File ${fileName} will be skipped due to path exceeding filesystem limits: ${tmpFile}`);
|
||||
|
|
Loading…
Reference in a new issue