feat(cli): sync folders with remote paths
Build and Push Docker Container / build-and-push (push) Successful in 1m36s

- Store synced folder locations in file_path instead of embedding them in file names.
- Add ignore rules from .nanoshareignore and repeatable sync --ignore flags.
- Adopt existing remote files only after SHA-256 verification.
- Move adopted remotes with metadata updates instead of uploading duplicates.
- Bump NanoShare to 1.23.0 and the standalone CLI to 0.2.0.
This commit is contained in:
2026-07-27 20:53:00 +02:00
parent 77c76b16c4
commit 993337be9f
13 changed files with 369 additions and 41 deletions
+5 -3
View File
@@ -30,15 +30,16 @@ class ConvexDB(ConvexDbBase):
return [ {
"file_id": x['file_id'],
"file_name": x['file_name'],
"file_path": x.get('file_path', ''),
"file_size": x['file_size'],
"note": x['note'],
"expires_at": int(x['expires_at']) if x.get('expires_at', None) else '',
"uploaded_at": int(x['uploaded_at']),
} for x in data ]
async def add_file(self, file_name:str, file_size:str, note:str, content_type:str, expires_at:datetime|None, storage_id:str, user_id:str):
async def add_file(self, file_name:str, file_size:str, note:str, content_type:str, expires_at:datetime|None, storage_id:str, user_id:str, file_path:str=''):
args = {
'file_name': file_name, 'file_size': file_size, 'content_type': content_type,
'file_name': file_name, 'file_path': file_path, 'file_size': file_size, 'content_type': content_type,
'note': note,
'file_storage_id': storage_id, 'user_id': user_id
}
@@ -51,10 +52,11 @@ class ConvexDB(ConvexDbBase):
)
return data
async def update_file(self, file_id:str, file_name:str, note:str, expires_at:datetime|None, user_id:str):
async def update_file(self, file_id:str, file_name:str, note:str, expires_at:datetime|None, user_id:str, file_path:str=''):
args = {
'file_id': file_id,
'file_name': file_name,
'file_path': file_path,
'note': note,
'user_id': user_id
}