Skip to content

Project Service

app.application.services.project_service

View source code

Captures and restores project state through the application and project store.

See Also

Layer: Application. Context: Implements use cases by coordinating domain and infrastructure operations at this architectural boundary.

ProjectLoadReport dataclass

Summarize which project sessions were restored successfully.

Layer: Application. Context: Returned to callers after project restoration; missing or unopenable source videos are reported rather than aborting other sessions.

ATTRIBUTE DESCRIPTION
restored_sessions

Number of sessions opened and restored.

TYPE: int

skipped_session_paths

Video paths that could not be restored.

TYPE: list[str]

restored_sessions: int instance-attribute

skipped_session_paths: list[str] instance-attribute

__init__(restored_sessions: int, skipped_session_paths: list[str]) -> None

ProjectService

Coordinate project persistence with application session management.

Layer: Application. Context: Captures serializable session state through the application, delegates file encoding to ProjectStore, and restores sessions while reporting per-video failures.

PARAMETER DESCRIPTION
app

Application facade whose session manager and video operations are used to capture and restore project sessions.

TYPE: Application

current_project_path: str property

Return the path of the currently loaded or most recently saved project.

RETURNS DESCRIPTION
str

The project file path, or an empty string when no project is active.

directories: ProjectDirectories property

Return the mutable project-specific import/export directory settings.

RETURNS DESCRIPTION
ProjectDirectories

The current ProjectDirectories value object.

__init__(app: Application) -> None

clear_project() -> None

Close all managed sessions and reset the active project state.

load_project(file_path: str) -> ProjectLoadReport

Load a project and restore every session whose video is available.

PARAMETER DESCRIPTION
file_path

Path to the project document to read.

TYPE: str

RETURNS DESCRIPTION
ProjectLoadReport

Counts and paths describing restored and skipped sessions.

save_project(file_path: str) -> ProjectDocument

Capture current sessions and persist them to a project file.

PARAMETER DESCRIPTION
file_path

Destination path for the serialized project document.

TYPE: str

RETURNS DESCRIPTION
ProjectDocument

The in-memory document that was written.

update_directories(*, last_import_directory: str | None = None, last_export_directory: str | None = None, export_prefix: str | None = None, export_suffix: str | None = None) -> None

Update only the supplied project directory or export-name settings.

PARAMETER DESCRIPTION
last_import_directory

Optional most recently used import directory.

TYPE: str | None DEFAULT: None

last_export_directory

Optional most recently used export directory.

TYPE: str | None DEFAULT: None

export_prefix

Optional prefix for exported filenames.

TYPE: str | None DEFAULT: None

export_suffix

Optional suffix for exported filenames.

TYPE: str | None DEFAULT: None