diff --git a/pytorrent/routes/api.py b/pytorrent/routes/api.py index 9b26421..535c850 100644 --- a/pytorrent/routes/api.py +++ b/pytorrent/routes/api.py @@ -508,7 +508,7 @@ def tracker_favicon(domain: str): enabled = bool(prefs and prefs.get("tracker_favicons_enabled")) static_url = tracker_cache.favicon_public_url(domain, enabled=enabled, create=True) if static_url: - # Note: The API only discovers/cache-warms the icon; the browser receives the file from /static/data/tracker_favicons/. + # Note: The API only discovers/cache-warms the icon; the browser receives the file from /static/tracker_favicons/. return redirect(static_url, code=302) abort(404) diff --git a/pytorrent/services/tracker_cache.py b/pytorrent/services/tracker_cache.py index 68099cb..c919461 100644 --- a/pytorrent/services/tracker_cache.py +++ b/pytorrent/services/tracker_cache.py @@ -17,7 +17,7 @@ TRACKER_CACHE_TTL_SECONDS = 7 * 24 * 60 * 60 FAVICON_CACHE_TTL_SECONDS = 7 * 24 * 60 * 60 TRACKER_SCAN_LIMIT = 80 FAVICON_DIR = BASE_DIR / "data" / "tracker_favicons" -PUBLIC_FAVICON_BASE = "/static/data/tracker_favicons" +PUBLIC_FAVICON_BASE = "/static/tracker_favicons" class _IconParser(HTMLParser): @@ -161,7 +161,7 @@ def summary(profile: dict, hashes: list[str], loader, scan_limit: int = TRACKER_ def favicon_public_url(domain: str, enabled: bool = True, create: bool = False) -> str: """Return the static URL for a cached tracker favicon, optionally creating it first.""" - # Note: Favicon files are stored under data/tracker_favicons and can be served by the static/data symlink. + # Note: Favicon files stay in data/tracker_favicons, but the browser loads them via the static/tracker_favicons symlink. clean = tracker_domain(domain) if not enabled or not clean: return "" diff --git a/pytorrent/static/app.js b/pytorrent/static/app.js index c8a5b9e..66733bf 100644 --- a/pytorrent/static/app.js +++ b/pytorrent/static/app.js @@ -239,7 +239,7 @@ function trackerFavicon(tracker){ const domain=typeof tracker==='string'?tracker:(tracker?.domain||''); if(!trackerFaviconsEnabled || !domain) return ''; - // Note: Cached favicons are served from the static/data symlink; the API path is only a one-time cache warmer fallback. + // Note: Cached favicons are served from the static/tracker_favicons symlink; the API path is only a one-time cache warmer fallback. const src=(typeof tracker==='object' && tracker?.favicon_url) ? tracker.favicon_url : `/api/trackers/favicon/${encodeURIComponent(domain)}`; return ``; } diff --git a/pytorrent/static/tracker_favicons b/pytorrent/static/tracker_favicons deleted file mode 120000 index d4b544b..0000000 --- a/pytorrent/static/tracker_favicons +++ /dev/null @@ -1 +0,0 @@ -../../data/tracker_favicons \ No newline at end of file diff --git a/pytorrent/static/tracker_favicons b/pytorrent/static/tracker_favicons new file mode 100755 index 0000000..d4b544b --- /dev/null +++ b/pytorrent/static/tracker_favicons @@ -0,0 +1 @@ +../../data/tracker_favicons \ No newline at end of file