fix: remove_recent() — nettoie les fichiers récents après suppression
This commit is contained in:
@@ -70,6 +70,14 @@ def get_recent_opened(username: str, vault_filter: Optional[str] = None, limit:
|
||||
|
||||
return history[:limit]
|
||||
|
||||
def remove_recent(username: str, vault: str, path: str):
|
||||
"""Remove a file from the recent history (e.g., after deletion)."""
|
||||
if not username:
|
||||
return
|
||||
history = _read_data(_get_history_file(username))
|
||||
history = [item for item in history if not (item["vault"] == vault and item["path"] == path)]
|
||||
_write_data(_get_history_file(username), history)
|
||||
|
||||
def toggle_bookmark(username: str, vault: str, path: str, title: str = ""):
|
||||
"""Toggle a file as bookmark for a user. Returns True if bookmarked, False if removed."""
|
||||
if not username:
|
||||
|
||||
Reference in New Issue
Block a user