Files
rex-catalog/Dockerfile
T
Patryk GenschandClaude Opus 5 6feb2254b2 Index audio, dialogue tables and script→asset references
Turns the catalogue from a file listing into something you can read: a script
line like SNDQUESTION:FILENAME=KRET_E511.WAV now shows how long the recording
is, who speaks it and at which event, and plays it straight from the disc image.

Four sources feed that:

- Audio headers. RIFF/WAVE and Ogg Vorbis parsed in-process from the image
  stream, no temp files. WAV needs only the first 4 kB, so 3.3 GB of samples
  never reaches the CPU. Not routed through :core — SoundLoader wants a
  FileHandle and a live Gdx.audio, and its contribution is a standard RIFF
  header. 13 884 recordings, 20.2 h.

- wavs/wav.snd. Reksio i Kapitan Nemo packs its whole voice cast into one
  79 MB container that :core does not read, so its speech was invisible here.
  Flat length-prefixed entries holding Ogg Vorbis (oggenc.exe ships on the
  disc). The parser walks the file to its exact last byte: 3274 entries.
  Payloads stay in place — offset and length are enough to serve them, and
  seeking 82 MB into the ISO costs 45 ms.

- dialogi.dta. Pipe-separated CP1250 giving every line a speaker and the event
  that triggers it, so "what is in this file" is answerable without any speech
  recognition. Scene-definition tables share the format, so a row only counts
  as dialogue when column 0 is an identifier rather than a path. 3819 lines,
  98% resolving to real audio.

- Script references. OBJECT:FIELD=VALUE is uniform even inside CODE={...},
  which the decoder folds onto one line, so one pass catches declarations and
  names woven into behaviour code alike. 19 735 references; 97% resolve.
  Names built by concatenation (+"_DEF.DTA") are excluded, but a real leading
  underscore (_WZIECIE_JABLKA.WAV) is kept.

Languages now come from install.ini's [Language] section, with LCIDs translated
through :core's LangCodeConverter rather than a second table here — that is what
settles wavs/slo/ as Slovak. Promote copies them into edition_language, only
ever adding, so curated entries survive.

Transcription is wired to whisper.cpp but never runs on its own: a button with a
progress bar, a stop that keeps what is already computed, and a transcribe
command. Results are generated, not read off the disc, so they live in their own
table with the model and tool named, and the UI labels them as machine guesses.
The pipeline was verified with a stub binary — ffmpeg hands whisper exactly
16 kHz mono, progress and cancellation work, and per-language selection follows
wavs/<code>/. No real transcripts were stored.

Also fixes a pre-existing bug: .cols set display:grid, which beat the browser's
[hidden] rule, so the Skrypty section never actually hid.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 13:50:12 +02:00

44 lines
1.8 KiB
Docker

# Build wymaga submodułu vendor/Rex-EMoolator — composite build kompiluje :core
# ze źródeł. Jeśli katalog jest pusty, settings.gradle przerwie z komunikatem.
FROM eclipse-temurin:21-jdk AS build
WORKDIR /src
# najpierw sam opis buildu: zmiana w kodzie nie unieważnia pobranych zależności
COPY gradlew settings.gradle build.gradle gradle.properties ./
COPY gradle ./gradle
COPY vendor ./vendor
RUN ./gradlew --no-daemon dependencies --configuration runtimeClasspath > /dev/null 2>&1 || true
COPY src ./src
# installDist zamiast build: pomija check, a więc i verifyCoreVersion, które
# potrzebowałoby gita w obrazie. Wersję i tak przypina submoduł.
RUN ./gradlew --no-daemon installDist \
&& grep '^coreVersion=' gradle.properties | cut -d= -f2 > /src/core-version
FROM eclipse-temurin:21-jre
WORKDIR /app
# obrazy płyt montowane z zewnątrz, tylko do odczytu; katalog danych to wolumen
VOLUME ["/data"]
# Transkrypcji mowy w obrazie nie ma i nie będzie: whisper.cpp plus model to
# kilka gigabajtów, a katalog jest w pełni użyteczny bez nich — mówcę i kontekst
# kwestii bierzemy z dialogi.dta. Front powie wprost, że narzędzia brakuje.
# Kto chce transkrybować, robi to na hoście: rex-catalog transcribe.
# file.encoding ustawia entrypoint przez JAVA_OPTS; JAVA_TOOL_OPTIONS robiłoby
# to samo, ale JVM wypisuje wtedy "Picked up..." przy każdym uruchomieniu
ENV CATALOG_DATA=/data
COPY --from=build /src/build/install/rex-catalog /app
COPY --from=build /src/core-version /app/core-version
COPY docker-entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh \
&& useradd --uid 10001 --create-home katalog \
&& mkdir -p /data /media \
&& chown katalog:katalog /data
USER katalog
EXPOSE 8765
ENTRYPOINT ["/app/entrypoint.sh"]
# domyślnie wstajemy jako serwer; front i MCP dzielą port
CMD ["serve", "--host", "0.0.0.0"]