mirror of
https://github.com/rommapp/romm.git
synced 2026-11-30 18:42:34 +01:00
cache top level files
This commit is contained in:
@@ -308,16 +308,17 @@ class Rom(BaseModel):
|
||||
def has_simple_single_file(self) -> bool:
|
||||
return len(self.files) == 1 and not self.files[0].is_nested
|
||||
|
||||
@cached_property
|
||||
def _top_level_files(self) -> list[RomFile]:
|
||||
return [f for f in self.files if f.is_top_level]
|
||||
|
||||
@cached_property
|
||||
def has_nested_single_file(self) -> bool:
|
||||
return (
|
||||
not self.has_simple_single_file
|
||||
and len([f for f in self.files if f.is_top_level]) == 1
|
||||
)
|
||||
return not self.has_simple_single_file and len(self._top_level_files) == 1
|
||||
|
||||
@cached_property
|
||||
def has_multiple_files(self) -> bool:
|
||||
return len([f for f in self.files if f.is_top_level]) > 1
|
||||
return len(self._top_level_files) > 1
|
||||
|
||||
@property
|
||||
def fs_resources_path(self) -> str:
|
||||
|
||||
Reference in New Issue
Block a user