diff --git a/src/models/streams.py b/src/models/streams.py index 22fb585..069743b 100644 --- a/src/models/streams.py +++ b/src/models/streams.py @@ -2,6 +2,7 @@ from pydantic import BaseModel, Field from typing import Optional from datetime import datetime from pathlib import Path +from functools import cached_property from lib.fs import sanitize_filename @@ -25,7 +26,7 @@ class VideoStream(BaseModel): disposition: Disposition tags: Tags - @property + @cached_property def fps(self) -> float: frame_numbers = [int(x) for x in self.avg_frame_rate.split("/")] return frame_numbers[0] / frame_numbers[1]