FIX: Windows build crash 'app\static does not exist' (datas absolute + APP_DIR freeze-aware) + VU meter ARM/MIDI keyboard
This commit is contained in:
+4
-1
@@ -58,7 +58,10 @@ app.add_middleware(
|
||||
# Mount storage directory (must come before general /static mount)
|
||||
app.mount("/static/audio", StaticFiles(directory=settings.STORAGE_DIR), name="audio")
|
||||
# Mount app static files (js, css)
|
||||
STATIC_DIR = os.path.join(os.path.dirname(__file__), "static")
|
||||
# Dùng settings.APP_DIR (freeze-aware) thay vì os.path.dirname(__file__):
|
||||
# khi PyInstaller onefile, __file__ trỏ vào thư mục giải nén tạm _MEI...
|
||||
# nhưng static/templates nằm trong sys._MEIPASS/app (config.py đã xử lý).
|
||||
STATIC_DIR = os.path.join(settings.APP_DIR, "static")
|
||||
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
|
||||
|
||||
# Include routers
|
||||
|
||||
+11
-1
@@ -25744,8 +25744,18 @@ STRICT CONSTRAINTS:
|
||||
try {
|
||||
// Khi STOP (không play, không recording): vẽ VU RỖNG — không đọc analyser/
|
||||
// activity → hết animation dính + master không full sau khi dừng play.
|
||||
// ⚠️ NGOẠI LỆ: nếu có MIDI activity live (bật ARM track + bấm phím MIDI
|
||||
// keyboard — KHÔNG play/record) thì KHÔNG early-return — track VU phải
|
||||
// nhảy theo midiVuActivityRef + decay (user bug: ARM + phím MIDI → VU
|
||||
// đứng yên vì block này vẽ rỗng và return trước khi đọc activity).
|
||||
const isRecActive = activeAudioRecordersRef.current && Object.keys(activeAudioRecordersRef.current).length > 0;
|
||||
if (!isPlaying && !isRecActive) {
|
||||
let liveMidiVu = false;
|
||||
try {
|
||||
for (const _k in midiVuActivityRef.current) {
|
||||
if (midiVuActivityRef.current[_k] > 0.001) { liveMidiVu = true; break; }
|
||||
}
|
||||
} catch (e) { }
|
||||
if (!isPlaying && !isRecActive && !liveMidiVu) {
|
||||
setMasterVU(0);
|
||||
setMasterMeterPeak(0);
|
||||
Object.keys(trackVuRefs.current).forEach(k => {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -24,7 +24,7 @@
|
||||
<script src="/static/js/services/midiExtractor.js?v=202607281052"></script>
|
||||
<script src="/static/js/services/promptTemplateManager.js?v=202607281039"></script>
|
||||
<script src="/static/js/services/undoRedoEngine.js?v=202607290941"></script>
|
||||
<script src="/static/js/app.precompiled.js?v=202608070950" defer></script>
|
||||
<script src="/static/js/app.precompiled.js?v=202608081200" defer></script>
|
||||
<link rel="stylesheet" href="/static/css/styles.css?v=202607271016">
|
||||
<style>
|
||||
:root {
|
||||
|
||||
Reference in New Issue
Block a user