@@ -32,6 +32,7 @@ import {
32
32
} from "./localdb" ;
33
33
import {
34
34
isHiddenPath ,
35
+ isMetaPath ,
35
36
isVaildText ,
36
37
mkdirpInVault ,
37
38
getFolderLevels ,
@@ -276,8 +277,8 @@ export const parseRemoteItems = async (
276
277
changeRemoteMtimeUsingMapping : false ,
277
278
} ;
278
279
}
279
- if ( r . key === DEFAULT_FILE_NAME_FOR_METADATAONREMOTE ) {
280
- metadataFile = Object . assign ( { } , r ) ;
280
+ if ( isMetaPath ( r . key ) ) {
281
+ metadataFile = Object . assign ( { } , r ) ;
281
282
}
282
283
if ( r . key === DEFAULT_FILE_NAME_FOR_METADATAONREMOTE2 ) {
283
284
throw Error (
@@ -380,7 +381,7 @@ const isSkipItem = (
380
381
return (
381
382
isHiddenPath ( key , true , false ) ||
382
383
( ! syncUnderscoreItems && isHiddenPath ( key , false , true ) ) ||
383
- key === DEFAULT_FILE_NAME_FOR_METADATAONREMOTE ||
384
+ isMetaPath ( key ) ||
384
385
key === DEFAULT_FILE_NAME_FOR_METADATAONREMOTE2
385
386
) ;
386
387
} ;
@@ -1152,6 +1153,7 @@ export const getSyncPlan = async (
1152
1153
} ;
1153
1154
1154
1155
const uploadExtraMeta = async (
1156
+ slug : string ,
1155
1157
client : RemoteClient ,
1156
1158
metadataFile : FileOrFolderMixedState | undefined ,
1157
1159
origMetadata : MetadataOnRemote | undefined ,
@@ -1192,7 +1194,7 @@ const uploadExtraMeta = async (
1192
1194
const resultText = serializeMetadataOnRemote ( newMetadata ) ;
1193
1195
1194
1196
await client . uploadToRemote (
1195
- key ,
1197
+ metadataFile ?. key || ` ${ slug } / ${ key } ` ,
1196
1198
RemoteSrcPrefix ,
1197
1199
undefined ,
1198
1200
false ,
@@ -1466,6 +1468,7 @@ export const doActualSync = async (
1466
1468
vault : Vault ,
1467
1469
syncPlan : SyncPlanType ,
1468
1470
sortedKeys : string [ ] ,
1471
+ slug : string , // For targeting dir
1469
1472
metadataFile : FileOrFolderMixedState ,
1470
1473
origMetadata : MetadataOnRemote ,
1471
1474
sizesGoWrong : FileOrFolderMixedState [ ] ,
@@ -1489,6 +1492,7 @@ export const doActualSync = async (
1489
1492
1490
1493
log . debug ( `start syncing extra data firstly` ) ;
1491
1494
await uploadExtraMeta (
1495
+ slug ,
1492
1496
client ,
1493
1497
metadataFile ,
1494
1498
origMetadata ,
0 commit comments