Skip to content

Commit b79f044

Browse files
committed
Create ZIM alias instead of redirects for tiles
1 parent 5db6452 commit b79f044

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323
- Move from --assets to --dl CLI param for code clarity (#68)
2424
- Fix bad favicon paths (#68)
2525
- Replace axios with fetch API and move config.json to a relative URL (#75)
26+
- Create ZIM alias instead of redirects for tiles (#53)
2627

2728
## [0.1.1] - 2026-03-10
2829

scraper/src/maps2zim/processor.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from typing import Any
1515
from urllib.parse import urlparse
1616

17+
from libzim.writer import Hint
1718
from pydantic import BaseModel
1819
from schedule import every, run_pending
1920
from zimscraperlib.download import save_large_file
@@ -983,9 +984,10 @@ def _write_tiles_to_zim(
983984
should_compress=True,
984985
)
985986

986-
# Create redirect from tile to dedupl
987-
creator.add_redirect(tile_path, dedupl_path)
988-
987+
# Create alias from tile to dedupl
988+
creator.add_alias(
989+
tile_path, "", dedupl_path, hints={Hint.FRONT_ARTICLE: False}
990+
)
989991
written_tiles += 1
990992

991993
# Log progress every LOG_EVERY_SECONDS

0 commit comments

Comments
 (0)