Handling merging multiple pbf files in map importing.

This commit is contained in:
Roland 2022-10-27 20:22:11 -06:00
parent 2b84831205
commit 6854fa3692
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
5 changed files with 201 additions and 101 deletions

View file

@ -40,15 +40,15 @@ async def import_pbfs(_: Request, body: schema.ImportPost):
@bp.get('/files')
@openapi.description('Find any map files, get their import status')
def pbf(_: Request):
def get_files_status(_: Request):
paths = lib.get_import_status()
paths = sorted(paths, key=lambda i: str(i.path))
importing = lib.IMPORTING.get('path')
if importing:
importing = Path(importing).relative_to(get_media_directory())
pending = lib.IMPORTING.get('pending')
if pending:
pending = [Path(i).relative_to(get_media_directory()) for i in pending]
body = dict(
files=paths,
importing=importing,
pending=pending,
import_running=lib.IMPORT_EVENT.is_set(),
dockerized=DOCKERIZED,
)