diff --git a/api/ovdashboard_api/dav_file.py b/api/ovdashboard_api/dav_file.py index 5a07fe7..c774a15 100644 --- a/api/ovdashboard_api/dav_file.py +++ b/api/ovdashboard_api/dav_file.py @@ -1,5 +1,6 @@ import logging import time +from dataclasses import dataclass from io import BytesIO from typing import Any, Optional @@ -38,14 +39,14 @@ async def _get_buffer( return await buffer_inner(resource) +@dataclass(frozen=True) class DavFile: - def __init__(self, remote_path: Any) -> None: - self.__remote_path = remote_path + remote_path: str @property async def __buffer(self) -> BytesIO: return await _get_buffer( - remote_path=self.__remote_path, + remote_path=self.remote_path, ttl_hash=_get_ttl_hash(20), )