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:
parent
d7421ccea5
commit
90f106c87d
5 changed files with 23 additions and 23 deletions
|
|
@ -45,7 +45,7 @@ class NotEnoughFreeSpaceError(InvocationError):
|
|||
"""An exception raised if there is not enough free space on disk to scan."""
|
||||
|
||||
|
||||
class ScanInfo(BaseModel):
|
||||
class ScanGalleryInfo(BaseModel):
|
||||
"""Summary information for the UI about a scan folder."""
|
||||
|
||||
name: str
|
||||
|
|
@ -71,8 +71,8 @@ class BaseScanData(BaseModel):
|
|||
Separating historic and active data allows workflows to use any BaseModel for its
|
||||
settings, but for the data to be reloaded even if that model has updated or is not
|
||||
available. Historic scan data loaded from disk is used for stitching and for
|
||||
creating a ScanInfo object for communicating with the UI. These uses are clearly
|
||||
typed by this model.
|
||||
creating a ScanGalleryInfo object for communicating with the UI. These uses are
|
||||
clearly typed by this model.
|
||||
|
||||
This serialises into a human readable format where possible with
|
||||
|
||||
|
|
@ -339,16 +339,16 @@ class ScanDirectoryManager:
|
|||
@requires_lock
|
||||
def all_scans_info(
|
||||
self, *, ongoing: Optional[str] = None, include_ongoing: bool = True
|
||||
) -> list[ScanInfo]:
|
||||
"""Return a lists of ScanInfo objects for each scan.
|
||||
) -> list[ScanGalleryInfo]:
|
||||
"""Return a lists of ScanGalleryInfo objects for each scan.
|
||||
|
||||
:param ongoing: The name of the ongoing scan (or None if no scan is ongoing).
|
||||
:param include_ongoing: True (dfault) to include the scan info of the ongoing
|
||||
scan in the return. False to exclude it.
|
||||
|
||||
:return: A list of ScanInfo objects for each scan.
|
||||
:return: A list of ScanGalleryInfo objects for each scan.
|
||||
"""
|
||||
all_info: list[ScanInfo] = []
|
||||
all_info: list[ScanGalleryInfo] = []
|
||||
for scan_name in self.all_scans:
|
||||
scan_is_ongoing = scan_name == ongoing
|
||||
if scan_is_ongoing and not include_ongoing:
|
||||
|
|
@ -591,7 +591,7 @@ class ScanDirectory:
|
|||
LOGGER.warning(f"Could not validate scan data for {self.name}.")
|
||||
return None
|
||||
|
||||
def scan_info(self, skip_json: bool = False) -> ScanInfo:
|
||||
def scan_info(self, skip_json: bool = False) -> ScanGalleryInfo:
|
||||
"""Return the information to be used in the UI for the scan."""
|
||||
scan_files = self.get_scan_files()
|
||||
scan_images = self._extract_scan_images(scan_files)
|
||||
|
|
@ -608,7 +608,7 @@ class ScanDirectory:
|
|||
else scan_data.duration.total_seconds()
|
||||
)
|
||||
|
||||
return ScanInfo(
|
||||
return ScanGalleryInfo(
|
||||
name=self.name,
|
||||
created=self.created_time,
|
||||
modified=self.get_modified_time(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue