Simplify, ensure we have a defined result for unknown types
This commit is contained in:
parent
7bcc03acf6
commit
bce5d25000
1 changed files with 3 additions and 2 deletions
|
@ -41,6 +41,8 @@ class FileType(Enum):
|
||||||
return FileType.application
|
return FileType.application
|
||||||
elif category == "image":
|
elif category == "image":
|
||||||
return FileType.image
|
return FileType.image
|
||||||
|
else:
|
||||||
|
return FileType.unknown
|
||||||
|
|
||||||
def destination_dir(self) -> Path:
|
def destination_dir(self) -> Path:
|
||||||
|
|
||||||
|
@ -78,9 +80,8 @@ def main():
|
||||||
client = transmissionrpc.Client("localhost", port=9091,
|
client = transmissionrpc.Client("localhost", port=9091,
|
||||||
username="transmission", password=rpc_pass)
|
username="transmission", password=rpc_pass)
|
||||||
|
|
||||||
filelist = client.get_files(torrent_id)
|
|
||||||
filelist = {filelist[item]["name"]: filelist[item]["size"] for item in
|
filelist = {filelist[item]["name"]: filelist[item]["size"] for item in
|
||||||
filelist}
|
client.get_files(torrent_id)}
|
||||||
|
|
||||||
filetype = FileType.detect(filelist)
|
filetype = FileType.detect(filelist)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue