Merge pull request #658 from BlueGreenMagick/media-type

add type hint for media dir
This commit is contained in:
Damien Elmes 2020-06-08 11:31:01 +10:00 committed by GitHub
commit 4570ae3d12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,8 +44,8 @@ class MediaManager:
def __init__(self, col: anki.collection.Collection, server: bool) -> None:
self.col = col.weakref()
self._dir: Optional[str] = None
if server:
self._dir = None
return
# media directory
self._dir = media_paths_from_col_path(self.col.path)[0]
@ -82,7 +82,7 @@ class MediaManager:
# may have been deleted
pass
def dir(self) -> Any:
def dir(self) -> Optional[str]:
return self._dir
def force_resync(self) -> None: