Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ include mk/install.mk
include mk/test-inventory-exceptions.mk
include mk/local-test-groups.mk
include mk/object-cache.mk
include mk/recordings2.mk



Expand Down
10 changes: 9 additions & 1 deletion core/http/src/TestHttpServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include "ApiRouter.h"

#include <cstdlib>
#include <cctype>
#include <cstdlib>
#include <fstream>
#include <sstream>
#include <string>
Expand Down Expand Up @@ -422,6 +422,7 @@ bool isFrontendPath(
path == "/frontend/channel-logos.js" ||
path == "/frontend/channel-day-program.js" ||
path == "/frontend/channel-day-program-compat.js" ||
path == "/frontend/recordings2.js" ||
path == "/frontend/recording-trash-ux.js" ||
path == "/frontend/epg-searchtimer-actions.js" ||
path == "/frontend/channel-browser.js" ||
Expand Down Expand Up @@ -529,6 +530,13 @@ HttpServerResponse serveFrontendPath(
"application/javascript; charset=utf-8");
}

if (path == "/frontend/recordings2.js")
{
return makeFrontendAssetResponse(
"recordings2.js",
"application/javascript; charset=utf-8");
}

if (path == "/frontend/recording-trash-ux.js")
{
return makeFrontendAssetResponse(
Expand Down
18 changes: 18 additions & 0 deletions mk/recordings2.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.PHONY: install-recordings2-runtime test-recordings2-runtime test-recordings2-install-staging

install-runtime: install-recordings2-runtime

install-recordings2-runtime:
$(INSTALL) -d $(DESTDIR)$(DATADIR)/web/frontend
$(INSTALL) -m 0644 web/frontend/recordings2.js $(DESTDIR)$(DATADIR)/web/frontend/recordings2.js

test-frontend-i18n: test-recordings2-runtime

test-recordings2-runtime:
node --check web/frontend/recordings2.js
node web/frontend/tests/test_recordings2_runtime.js
python3 tools/check_recordings2_runtime_wiring.py

test-recordings2-install-staging: test-install-staging
test -f /tmp/vdr-suite-pkgroot/usr/share/vdr-suite/web/frontend/recordings2.js
node --check /tmp/vdr-suite-pkgroot/usr/share/vdr-suite/web/frontend/recordings2.js
47 changes: 47 additions & 0 deletions tools/check_recordings2_runtime_wiring.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env python3
from pathlib import Path

ROOT = Path(__file__).resolve().parents[1]

recordings2 = (ROOT / 'web/frontend/recordings2.js').read_text(encoding='utf-8')
loader = (ROOT / 'web/frontend/platform/deferred-runtime-loader.js').read_text(encoding='utf-8')
server = (ROOT / 'core/http/src/TestHttpServer.cpp').read_text(encoding='utf-8')
makefile = (ROOT / 'Makefile').read_text(encoding='utf-8')
module_makefile = (ROOT / 'mk/recordings2.mk').read_text(encoding='utf-8')

required_module_tokens = (
'global.VdrSuiteRecordings2 = moduleApi;',
'fetchClientRecordingFolder',
'recordingFolder !== true',
'data-module="recordings2"',
'Aufnahmeordner konnte nicht geladen werden',
'recordingPosterUrl',
'renderDetail',
)
for token in required_module_tokens:
if token not in recordings2:
raise SystemExit(f'missing Recordings 2 module contract: {token}')

for forbidden in ('VdrSuiteRecordingBrowser', 'configureRecordingBrowser', 'renderRecordingsThroughModule'):
if forbidden in recordings2:
raise SystemExit(f'Recordings 2 depends on legacy recording browser: {forbidden}')

required_loader_tokens = (
"'/frontend/recordings2.js'",
'window.VdrSuiteRecordings2',
"'vdr-suite-recordings2-runtime'",
)
for token in required_loader_tokens:
if token not in loader:
raise SystemExit(f'missing deferred runtime wiring: {token}')

if 'path == "/frontend/recordings2.js"' not in server:
raise SystemExit('HTTP server does not allow /frontend/recordings2.js')
if '"recordings2.js"' not in server:
raise SystemExit('HTTP server does not serve recordings2.js')
if 'include mk/recordings2.mk' not in makefile:
raise SystemExit('root Makefile does not include mk/recordings2.mk')
if 'web/frontend/recordings2.js' not in module_makefile:
raise SystemExit('Recordings 2 install rule is missing')

print('recordings2 runtime wiring ok')
8 changes: 8 additions & 0 deletions web/frontend/platform/deferred-runtime-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ function startVdrSuiteDeferredFrontendRuntimes() {
).catch(error => {
console.error('VDR-Suite deferred frontend runtime failed', error);
});

loadVdrSuiteDeferredRuntime(
'vdr-suite-recordings2-runtime',
'/frontend/recordings2.js',
() => Boolean(window.VdrSuiteRecordings2)
).catch(error => {
console.error('VDR-Suite Recordings 2 runtime failed', error);
});
}

if (typeof window !== 'undefined') {
Expand Down
Loading
Loading