diff --git a/ui/medashare/btv/__init__.py b/ui/medashare/btv/__init__.py index a92f748..5f878a3 100644 --- a/ui/medashare/btv/__init__.py +++ b/ui/medashare/btv/__init__.py @@ -156,15 +156,17 @@ def validate_file(fname, with_file_hashes=None): finddname = glob_escape(torrent['info']['name'].decode(_encoding)) + missingfname = None for dirname in fname.parent.rglob(finddname): tordir = dirname.parent try: return validate(torrent, tordir, with_file_hashes) except FileNotFoundError as e: + missingfname = e.filename continue else: - raise FileNotFoundError('unable to find directory for %s' % (repr(fname.name))) + raise FileNotFoundError('unable to find directory for %s%s' % (repr(fname.name), (', missing file %s' % repr(missingfname)) if missingfname else '')) def validate(torrent, basedir, with_file_hashes=None): '''Take a decode torrent file, where it was stored in basedir,