Mendeley import: shorten tmp file path

This commit is contained in:
Tom Najdek 2021-05-20 11:18:23 +02:00
parent 5497598c63
commit faf094f0aa
No known key found for this signature in database
GPG key ID: EEC61A7B4C667D77

View file

@ -707,7 +707,7 @@ Zotero_Import_Mendeley.prototype._getDocumentFilesAPI = async function (document
const files = [];
for (let file of (doc.files || [])) {
const fileName = file.file_name || 'file';
const tmpFile = OS.Path.join(Zotero.getTempDirectory().path, `mendeley-online-import-${this.timestamp}-${file.id}`, fileName);
const tmpFile = OS.Path.join(Zotero.getTempDirectory().path, `m-api-${this.timestamp}-${file.id}`, fileName);
this._tmpFilesToDelete.push(tmpFile);
caller.add(this._fetchFile.bind(this, file.id, tmpFile));
files.push({
@ -1468,7 +1468,7 @@ Zotero_Import_Mendeley.prototype._isDownloadedFile = function (path) {
Zotero_Import_Mendeley.prototype._isTempDownloadedFile = function (path) {
var parentDir = OS.Path.dirname(path);
return parentDir.startsWith(OS.Path.join(Zotero.getTempDirectory().path, 'mendeley-online-import'));
return parentDir.startsWith(OS.Path.join(Zotero.getTempDirectory().path, 'm-api'));
};
/**