handle missing directory

This commit is contained in:
zuckerberg 2021-09-24 16:37:27 -04:00
parent 72995c0d3a
commit 658c84d5df

View File

@ -99,13 +99,15 @@ def mountTorrent(magnet):
o.communicate() # wait for it to finish
def umountTorrent():
o = subprocess.Popen([
"fusermount",
"-u", fuseTorrentLocation
])
o.communicate() # wait for it to finish
os.rmdir(fuseTorrentLocation)
shutil.rmtree(btfsDataLocation)
if os.path.isdir(fuseTorrentLocation):
o = subprocess.Popen([
"fusermount",
"-u", fuseTorrentLocation
])
o.communicate() # wait for it to finish
os.rmdir(fuseTorrentLocation)
if os.path.isdir(btfsDataLocation):
shutil.rmtree(btfsDataLocation)
def getTorrentMedia():
files = glob.glob(fuseTorrentLocation + '/**/*', recursive=True)