From 1415b9fe45cd2b1192137e3ce04a6b5420000935 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 30 Dec 2015 04:59:22 -0500 Subject: [PATCH] Fix ZFS purgeDeletedStorageFiles() --- chrome/content/zotero/xpcom/storage/zfs.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js index c373690915..2c0de910fa 100644 --- a/chrome/content/zotero/xpcom/storage/zfs.js +++ b/chrome/content/zotero/xpcom/storage/zfs.js @@ -256,7 +256,9 @@ Zotero.Sync.Storage.Mode.ZFS.prototype = { /** * Remove all synced files from the server */ - purgeDeletedStorageFiles: Zotero.Promise.coroutine(function* () { + purgeDeletedStorageFiles: Zotero.Promise.coroutine(function* (libraryID) { + if (libraryID != Zotero.Libraries.userLibraryID) return; + var sql = "SELECT value FROM settings WHERE setting=? AND key=?"; var values = yield Zotero.DB.columnQueryAsync(sql, ['storage', 'zfsPurge']); if (!values) { @@ -265,8 +267,8 @@ Zotero.Sync.Storage.Mode.ZFS.prototype = { Zotero.debug("Unlinking synced files on ZFS"); - var uri = this.userURI; - uri.spec += "removestoragefiles"; + var params = this._getRequestParams(libraryID, "removestoragefiles"); + var uri = this.apiClient.buildRequestURI(params); yield Zotero.HTTP.request("POST", uri, "");