virtual_sdcard: fix check for case sensitive files
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
8eef1e2146
commit
dc71b64c0a
|
@ -152,10 +152,11 @@ class VirtualSD:
|
||||||
self._load_file(gcmd, filename)
|
self._load_file(gcmd, filename)
|
||||||
def _load_file(self, gcmd, filename, check_subdirs=False):
|
def _load_file(self, gcmd, filename, check_subdirs=False):
|
||||||
files = self.get_file_list(check_subdirs)
|
files = self.get_file_list(check_subdirs)
|
||||||
|
flist = [f[0] for f in files]
|
||||||
files_by_lower = { fname.lower(): fname for fname, fsize in files }
|
files_by_lower = { fname.lower(): fname for fname, fsize in files }
|
||||||
fname = filename
|
fname = filename
|
||||||
try:
|
try:
|
||||||
if fname not in files:
|
if fname not in flist:
|
||||||
fname = files_by_lower[fname.lower()]
|
fname = files_by_lower[fname.lower()]
|
||||||
fname = os.path.join(self.sdcard_dirname, fname)
|
fname = os.path.join(self.sdcard_dirname, fname)
|
||||||
f = open(fname, 'rb')
|
f = open(fname, 'rb')
|
||||||
|
|
Loading…
Reference in New Issue