A live photo's default names fit, and no cut name starts with a dot
check / check (push) Waiting to run

`defaultFileName` in `src/filename.ts` now gives the name a file is saved
under when the caller gives no path, and `originalName`, `thumbnailName`,
`downloadFile` and `downloadThumbnail` all call it. For a live photo's image
and video it puts the part's own extension in before cutting the name short,
so those names fit too; a path from `--out` or `outPath` is kept as given.
`shortenKeepingExtension` keeps the first character before the extension,
cutting a long extension short to leave room for it, so a cut name no longer
starts with a dot. The backup's links for such a title change to match.
TODO.md names the open bug and describes what the code does.

Model: opus-5-5
This commit is contained in:
2026-10-18 17:05:49 +00:00
parent fd40714a6d
commit e03e99b486
11 changed files with 284 additions and 107 deletions
+16 -10
View File
@@ -17,9 +17,11 @@ pre-1.0
# Next Step
No bug is open. The check of quak against a live Ente account,
https://git.eeqj.de/sneak/quak/issues/187, needs an account only sneak has, so
it waits on him.
No bug is open. Two changes sneak asked for are open:
https://git.eeqj.de/sneak/quak/issues/211 and
https://git.eeqj.de/sneak/quak/issues/212. The check of quak against a live Ente
account, https://git.eeqj.de/sneak/quak/issues/187, needs an account only sneak
has, so it waits on him.
Tagging and releases are decided by sneak alone, and happen only when he
declares one.
@@ -27,13 +29,17 @@ declares one.
# Completed Steps
- 2026-10-18: Names quak builds from an album name or a title fit in a file name
(issue 205). `shortenKeepingExtension` in `src/filename.ts` cuts a name short
to a number of bytes, keeping its extension when it fits, and can put text
right before the extension; the backup's `withID` uses it for an ID. The
default names of `quak get`, `quak get-thumb`, `downloadFile` and
`downloadThumbnail` are cut short with it to 255 bytes, `thumb_` included.
`backup-metadata` cuts an album's name short so that its folder,
`<id>-<name>`, fits in 255 bytes. `safeExtension` gives `.bin` for an
(https://git.eeqj.de/sneak/quak/issues/205). `shortenKeepingExtension` in
`src/filename.ts` cuts a name short to a number of bytes, keeping its
extension when it fits and always its first character, and can put text right
before the extension; the backup's `withID` uses it for an ID.
`defaultFileName` there gives the name a file is saved under when the caller
gives no path: a prefix such as `thumb_` and the title with unsafe characters
replaced, cut short with it to 255 bytes, and, for a live photo's image or
video, with that part's own extension before the cut. `quak get`,
`quak get-thumb`, `downloadFile` and `downloadThumbnail` use it without
`--out` or `outPath`. `backup-metadata` cuts an album's name short so that its
folder, `<id>-<name>`, fits in 255 bytes. `safeExtension` gives `.bin` for an
extension of more than 16 letters and digits, so a save path's name always
fits.