feat(sync): Remove redundant file renaming logic after upload when hash matches
This commit is contained in:
@@ -107,14 +107,6 @@ class XAIUploadUtils:
|
|||||||
# File content unchanged (hash match) → kein Re-Upload nötig
|
# File content unchanged (hash match) → kein Re-Upload nötig
|
||||||
if ai_status == 'synced' and ai_sync_hash and blake3_hash and ai_sync_hash == blake3_hash:
|
if ai_status == 'synced' and ai_sync_hash and blake3_hash and ai_sync_hash == blake3_hash:
|
||||||
if ai_file_id:
|
if ai_file_id:
|
||||||
# Custom metadata (fields) können nach dem Upload nicht mehr geändert werden.
|
|
||||||
# Nur Dateiname ist über PUT /v1/files/{id} änderbar.
|
|
||||||
current_name = doc.get('dokumentName') or doc.get('name', '')
|
|
||||||
if current_name and ai_file_id:
|
|
||||||
try:
|
|
||||||
await xai.rename_file(ai_file_id, current_name)
|
|
||||||
except Exception as e:
|
|
||||||
self._log.warn(f" ⚠️ Rename fehlgeschlagen (non-fatal): {e}")
|
|
||||||
self._log.info(f" ✅ Unverändert – kein Re-Upload (hash match)")
|
self._log.info(f" ✅ Unverändert – kein Re-Upload (hash match)")
|
||||||
else:
|
else:
|
||||||
self._log.info(f" ⏭️ Skipped (hash match, kein aiFileId)")
|
self._log.info(f" ⏭️ Skipped (hash match, kein aiFileId)")
|
||||||
|
|||||||
Reference in New Issue
Block a user