Add share, webhook, and conflict management features
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user