Files
romm/backend/handler/filesystem/retroarch_sync_handler.py
Georges-Antoine Assi 49e8d380e9 refactor(sync): rename the RetroArch blob handler to retroarch_sync
FSRetroArchSyncBlobHandler becomes FSRetroArchSyncHandler, and
SYNC_RETROARCH_BLOB_BASE_PATH becomes SYNC_RETROARCH_BASE_PATH, stored
under /romm/retroarch_sync.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 14:20:06 -04:00

25 lines
760 B
Python

"""Opaque per-user storage for the Cloud Sync categories no ROM owns: config/,
thumbnails/ and system/."""
from config import SYNC_RETROARCH_BASE_PATH
from .base_handler import FSHandler
class FSRetroArchSyncHandler(FSHandler):
def __init__(self) -> None:
super().__init__(base_path=SYNC_RETROARCH_BASE_PATH)
async def list_blob_paths(self, prefix: str) -> list[str]:
"""Posix paths of every file under `prefix` (relative to the blob root),
relative to `prefix` itself."""
try:
root = self.validate_path(prefix)
except ValueError:
return []
if not root.is_dir():
return []
return [p.relative_to(root).as_posix() for p in root.rglob("*") if p.is_file()]