Add share, webhook, and conflict management features

This commit is contained in:
2026-05-26 11:00:48 -04:00
parent ed2bb4f7fb
commit 0b611a8735
11 changed files with 1595 additions and 366 deletions
+26
View File
@@ -937,3 +937,29 @@ def get_backlinks(vault_name: str, file_path: str) -> List[Dict[str, str]]:
bl = vindex.get(target_key, [])
results.extend(bl)
return results
def get_conflicts() -> list:
"""Scan all vaults for Syncthing/Nextcloud sync-conflict files.
Returns:
List of conflict dicts with vault, conflict_path, original_path,
conflict_date, and conflict_title.
"""
import re
conflicts = []
pattern = re.compile(r'\.sync-conflict-(\d{8}-\d{6})\.')
for vname, vdata in index.items():
for f in vdata.get("files", []):
m = pattern.search(f["path"])
if m:
orig_path = pattern.sub("", f["path"])
conflicts.append({
"vault": vname,
"conflict_path": f["path"],
"original_path": orig_path,
"conflict_date": m.group(1),
"conflict_title": f.get("title", ""),
"conflict_size": f.get("size", 0),
})
return conflicts