commit 1415b9fe45cd2b1192137e3ce04a6b5420000935
parent 2177a000eaa8fe85b25bf0d99df2d8f9002c539a
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 30 Dec 2015 04:59:22 -0500
Fix ZFS purgeDeletedStorageFiles()
Diffstat:
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
@@ -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, "");