Fix currentUpload() return value

This commit is contained in:
Kumi 2021-11-26 07:52:16 +01:00
parent 25844a1f59
commit e62af0f71f

View file

@ -107,16 +107,19 @@ class Vessel:
db = Database() db = Database()
return db.getCompletionForVessel(self) return db.getCompletionForVessel(self)
def currentUpload(self) -> File: def currentUpload(self) -> Optional[File]:
"""Get the File that is currently being uploaded to this Vessel """Get the File that is currently being uploaded to this Vessel
Returns: Returns:
classes.file.File: File object representing the file currently classes.file.File: File object representing the file currently
being uploaded being uploaded, if any
""" """
db = Database() db = Database()
directory, name, _ = db.getFileByUUID( output = db.getFileByUUID(
fileuuid := self.connection.getCurrentUploadUUID()) fileuuid := self.connection.getCurrentUploadUUID())
if output:
directory, name, _ = output
return File(name, directory, fileuuid) return File(name, directory, fileuuid)
def clearTempDir(self) -> None: def clearTempDir(self) -> None: