start laying out downloads

This commit is contained in:
Hellow2
2023-03-30 14:39:28 +02:00
parent 1a9ec937f6
commit b2e67fbd45
4 changed files with 42 additions and 5 deletions

View File

@@ -148,3 +148,7 @@ class Collection:
returns a shallow copy of the data list
"""
return self._data.copy()
@property
def empty(self) -> bool:
return len(self._data) == 0

View File

@@ -25,16 +25,18 @@ class Target(DatabaseObject):
self,
file: str = None,
path: str = None,
_id: str = None,
dynamic: bool = False,
relative_to_music_dir: bool = False
) -> None:
super().__init__(_id=_id, dynamic=dynamic)
super().__init__(dynamic=dynamic)
self._file: Path = Path(file)
self._path: Path = Path(path) if relative_to_music_dir else Path(path)
self._path: Path = Path(shared.MUSIC_DIR, path) if relative_to_music_dir else Path(path)
self.is_relative_to_music_dir: bool = relative_to_music_dir
def __repr__(self) -> str:
return str(self.file_path)
@property
def file_path(self) -> Path:
return Path(self._path, self._file)