Fix resource URLs for files in folders
This commit is contained in:
1 parent
0015d844a8
commit
2e8d104864
2 files changed
+7
-3
No files matched your search
@@ -490,9 +490,13 @@ class LocalFileStorage(StorageInterface):
|
||||
def list_files(self, path=None, filter=None, recursive=True):
|
||||
if path:
|
||||
path = self.sanitize_path(path)
|
||||
base = self.path_in_storage(path)
|
||||
if base:
|
||||
base += "/"
|
||||
else:
|
||||
path = self.basefolder
|
||||
return self._list_folder(path, filter=filter, recursive=recursive)
|
||||
base = ""
|
||||
return self._list_folder(path, base=base, filter=filter, recursive=recursive)
|
||||
|
||||
def add_folder(self, path, ignore_existing=True):
|
||||
path, name = self.sanitize(path)
|
||||
|
||||
@@ -138,8 +138,8 @@ def _getFileList(origin, path=None, filter=None, recursive=False):
|
||||
|
||||
file_or_folder.update({
|
||||
"refs": {
|
||||
"resource": url_for(".readGcodeFile", target=FileDestinations.LOCAL, filename=path + file_or_folder["name"], _external=True),
|
||||
"download": url_for("index", _external=True) + "downloads/files/" + FileDestinations.LOCAL + "/" + path + file_or_folder["name"]
|
||||
"resource": url_for(".readGcodeFile", target=FileDestinations.LOCAL, filename=file_or_folder["path"], _external=True),
|
||||
"download": url_for("index", _external=True) + "downloads/files/" + FileDestinations.LOCAL + "/" + file_or_folder["path"]
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user