feat: make hover thumbnails optional (--no-thumbnails)

Thumbnails stay on by default. --no-thumbnails skips building the preview sprite, so the server does no extra work and the rest of the player still works. The frontend already shows no preview when the sprite is unavailable.
This commit is contained in:
Shaku-Med 2026-06-19 00:14:34 -04:00
parent 41f430d46d
commit c230c6b7d7
3 changed files with 21 additions and 0 deletions

View file

@ -78,6 +78,14 @@ class ScrubTests(unittest.TestCase):
finally:
ss.app.state.queue = [_entry(self.video)]
def test_thumbnails_can_be_disabled(self):
ss.app.state.thumbnails = False
try:
body = json.loads(asyncio.run(ss.scrub_meta(0)).body)
self.assertFalse(body["available"])
finally:
ss.app.state.thumbnails = True
def test_sprite_404_before_it_is_built(self):
from fastapi import HTTPException
ss._scrub_cache.clear()