1
0
Fork 0

Simplify, ensure we have a defined result for unknown types

This commit is contained in:
Luca Beltrame 2014-12-24 17:24:31 +01:00
parent 7bcc03acf6
commit bce5d25000

View file

@ -41,6 +41,8 @@ class FileType(Enum):
return FileType.application
elif category == "image":
return FileType.image
else:
return FileType.unknown
def destination_dir(self) -> Path:
@ -78,9 +80,8 @@ def main():
client = transmissionrpc.Client("localhost", port=9091,
username="transmission", password=rpc_pass)
filelist = client.get_files(torrent_id)
filelist = {filelist[item]["name"]: filelist[item]["size"] for item in
filelist}
client.get_files(torrent_id)}
filetype = FileType.detect(filelist)