Remove default path prefixes for local mirroring

- Removed hardcoded defaults for ZXDB_FILE_PREFIX and WOS_FILE_PREFIX in
  resolveLocalLink.
- Updated docs/ZXDB.md and example.env to remove mentions of defaults.
- Default behavior is now no prefix stripping if variables are omitted.

Signed-off-by: Junie@lucy.xalior.com
This commit is contained in:
2026-02-17 12:35:46 +00:00
parent ab7872b610
commit 2e47b598c1
3 changed files with 2 additions and 4 deletions

View File

@@ -53,7 +53,6 @@ ZXDB_LOCAL_FILEPATH=/path/to/your/zxdb/mirror
WOS_LOCAL_FILEPATH=/path/to/your/wos/mirror WOS_LOCAL_FILEPATH=/path/to/your/wos/mirror
# Optional: Remote path prefixes to strip from database links before prepending local paths # Optional: Remote path prefixes to strip from database links before prepending local paths
# Defaults shown below if omitted:
ZXDB_FILE_PREFIX=/zxdb/sinclair/ ZXDB_FILE_PREFIX=/zxdb/sinclair/
WOS_FILE_PREFIX=/pub/sinclair/ WOS_FILE_PREFIX=/pub/sinclair/
``` ```

View File

@@ -29,7 +29,6 @@ CDN_CACHE=/mnt/files/zxfiles
# WOS_LOCAL_FILEPATH=/path/to/local/wos/mirror # WOS_LOCAL_FILEPATH=/path/to/local/wos/mirror
# Optional: Path prefixes to strip from database links before local matching. # Optional: Path prefixes to strip from database links before local matching.
# Defaults to "/zxdb/sinclair/" and "/pub/sinclair/" if omitted.
# ZXDB_FILE_PREFIX=/zxdb/sinclair/ # ZXDB_FILE_PREFIX=/zxdb/sinclair/
# WOS_FILE_PREFIX=/pub/sinclair/ # WOS_FILE_PREFIX=/pub/sinclair/

View File

@@ -117,8 +117,8 @@ export interface EntryFacets {
function resolveLocalLink(fileLink: string): string | null { function resolveLocalLink(fileLink: string): string | null {
let localPath: string | null = null; let localPath: string | null = null;
const zxdbPrefix = env.ZXDB_FILE_PREFIX || "/zxdb/sinclair/"; const zxdbPrefix = env.ZXDB_FILE_PREFIX || "";
const wosPrefix = env.WOS_FILE_PREFIX || "/pub/sinclair/"; const wosPrefix = env.WOS_FILE_PREFIX || "";
if (fileLink.startsWith(zxdbPrefix) && env.ZXDB_LOCAL_FILEPATH) { if (fileLink.startsWith(zxdbPrefix) && env.ZXDB_LOCAL_FILEPATH) {
const sub = fileLink.slice(zxdbPrefix.replace(/\/$/, "").length); const sub = fileLink.slice(zxdbPrefix.replace(/\/$/, "").length);