From 202fd6ffa5c900a64b03bf5a861312e2d167ee97 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Mon, 28 Dec 2020 14:52:44 +0100 Subject: [PATCH] Add mapping in redirectWebExport for new jquery file --- qt/aqt/mediasrv.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/qt/aqt/mediasrv.py b/qt/aqt/mediasrv.py index 1345b7105..633888ff3 100644 --- a/qt/aqt/mediasrv.py +++ b/qt/aqt/mediasrv.py @@ -190,10 +190,17 @@ def _redirectWebExports(path): else: addprefix = "js/" - if addprefix: - oldpath = path - path = f"{targetPath}{addprefix}{filename}" - print(f"legacy {oldpath} remapped to {path}") + elif dirname == "_anki/js/vendor": + base, ext = os.path.splitext(filename) + + if base == "jquery": + base = "jquery.min" + addprefix = "js/vendor/" + + if addprefix: + oldpath = path + path = f"{targetPath}{addprefix}{base}{ext}" + print(f"legacy {oldpath} remapped to {path}") return _exportFolder, path[len(targetPath) :]