Change the classes for gallery cards information to be XxxGalleryInfo

ScanInfo -> ScanGalleryInfo
CaptureInfo -> CaptureGalleryInfo - note there were two classes
called CaptureInfo, only one has been changed to deduplicate the names
This commit is contained in:
Julian Stirling 2026-07-02 16:38:18 +01:00
parent d7421ccea5
commit 90f106c87d
5 changed files with 23 additions and 23 deletions

View file

@ -206,7 +206,7 @@ class CaptureMode(BaseModel):
"""The resolution to save the image. Use None to save as captured."""
class CaptureInfo(BaseModel):
class CaptureGalleryInfo(BaseModel):
"""Summary information for the UI about an image."""
name: str
@ -296,9 +296,9 @@ class BaseCamera(OFMThing, ABC):
_show_data_in_gallery = True
@property
def gallery_data_schema(self) -> type[CaptureInfo]:
def gallery_data_schema(self) -> type[CaptureGalleryInfo]:
"""The schema (BaseModel) for passing data to the gallery."""
return CaptureInfo
return CaptureGalleryInfo
def _all_captures(self) -> list[str]:
"""Return the full path for all captures on disk."""
@ -310,10 +310,10 @@ class BaseCamera(OFMThing, ABC):
captures.append(full_path)
return captures
def get_data_for_gallery(self) -> list[CaptureInfo]:
def get_data_for_gallery(self) -> list[CaptureGalleryInfo]:
"""Return all the information about the saved captures."""
return [
CaptureInfo(
CaptureGalleryInfo(
name=os.path.basename(capture),
created=os.path.getctime(capture),
modified=os.path.getmtime(capture),

View file

@ -172,11 +172,11 @@ class SmartScanThing(OFMThing):
_show_data_in_gallery = True
@property
def gallery_data_schema(self) -> type[scan_directories.ScanInfo]:
def gallery_data_schema(self) -> type[scan_directories.ScanGalleryInfo]:
"""The schema (BaseModel) for passing data to the gallery."""
return scan_directories.ScanInfo
return scan_directories.ScanGalleryInfo
def get_data_for_gallery(self) -> list[scan_directories.ScanInfo]:
def get_data_for_gallery(self) -> list[scan_directories.ScanGalleryInfo]:
"""Return all the information from the scan directories.
It is preferable to use the method rather than calling