@livedesk/hub 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -111,6 +111,7 @@ export class HubSharedFolders {
|
|
|
111
111
|
if (this.syncing.has(folder.id)) throw new Error('sync-already-running');
|
|
112
112
|
const source = await this.filesystem.registerPersistedFolder(folder.sourcePath, folder.displayPath);
|
|
113
113
|
if (!source) throw new Error('sync-source-unavailable');
|
|
114
|
+
folder.remoteDirectory = String(remoteDirectory || folder.remoteDirectory || 'Desktop/LiveDeskFiles').replace(/[\0\r\n\t]/g, ' ').trim().slice(0, 600);
|
|
114
115
|
const scan = await this.filesystem.scan([source.id]);
|
|
115
116
|
folder.fileCount = scan.files.length;
|
|
116
117
|
folder.totalBytes = scan.totalBytes;
|
|
@@ -128,7 +129,7 @@ export class HubSharedFolders {
|
|
|
128
129
|
jobs.push(this.transferJobs.create({
|
|
129
130
|
files: changedFiles,
|
|
130
131
|
deviceIds: [deviceId],
|
|
131
|
-
remoteDirectory,
|
|
132
|
+
remoteDirectory: folder.remoteDirectory,
|
|
132
133
|
onComplete: async ({ completed }) => {
|
|
133
134
|
if (!completed) return;
|
|
134
135
|
folder.manifests = folder.manifests || {};
|
|
@@ -161,7 +162,7 @@ export class HubSharedFolders {
|
|
|
161
162
|
for (const folder of this.folders.values()) {
|
|
162
163
|
if (!folder.autoSync || this.syncing.has(folder.id)) continue;
|
|
163
164
|
try {
|
|
164
|
-
await this.sync(folder.id, deviceIds, getRemoteDirectory());
|
|
165
|
+
await this.sync(folder.id, deviceIds, folder.remoteDirectory || getRemoteDirectory());
|
|
165
166
|
} catch (error) {
|
|
166
167
|
folder.message = error instanceof Error ? error.message : String(error);
|
|
167
168
|
await this.persist().catch(() => undefined);
|