summaryrefslogtreecommitdiff
path: root/player-android
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-19 19:35:02 +0300
committerPaul Buetow <paul@buetow.org>2026-05-19 19:35:02 +0300
commit41bdcb29178fcbcd71fb3663f507736151c018db (patch)
tree2a519f878b1d4db13174522ad43c1a0b5c8b2065 /player-android
parent965b36f3e09a0d4cdbb69cb3f423ab01fecf2419 (diff)
Extract thumbnail path helpers into internal/thumb
The scanner (thumbnailForVideo, thumbnailForImage), the service importer (generateThumbnail), and writeService.RegenerateThumbnail all reinvented the same ".thumbnails/<base>.jpg" layout inline. Centralise the convention in internal/thumb/path.go (ThumbnailDir, ThumbnailNameFor, ThumbnailPathFor + DirName) so changing the on-disk layout is a one-line change and the three callers cannot drift apart. Pure path math, no I/O — callers retain their existing MkdirAll mechanism (scanner FS, os.MkdirAll in service) for testability. Covered by table-driven unit tests for trailing slashes, missing extensions, dotfiles, and multi-dot filenames.
Diffstat (limited to 'player-android')
0 files changed, 0 insertions, 0 deletions