Names quak builds from server data fit in 255 bytes (closes #205)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
The default names of `quak get`, `quak get-thumb`, `downloadFile` and `downloadThumbnail`, and the album folders of `backup-metadata`, could be over 255 bytes, which a file system refuses. `shortenKeepingExtension` in `src/filename.ts` cuts a name short, keeping its extension when it fits, and can put text right before the extension; the backup's `withID` now calls it instead of doing the same itself. The `get` defaults use it with `thumb_` counted. A `backup-metadata` folder keeps its `<id>-` and has the name after it cut short. `safeExtension` gives `.bin` for an extension of more than 16 letters and digits, so a save path's name always fits. Model: opus-5-5
This commit is contained in:
@@ -675,6 +675,12 @@ before any request with one line, `Invalid file ID: <arg>` or
|
||||
`Invalid collection ID: <arg>`, and exit status 1. One bad `--file` ID refuses
|
||||
the whole command, so nothing is fixed.
|
||||
|
||||
Without `--out`, `get` writes the file to the working directory under its title,
|
||||
and `get-thumb` writes the thumbnail there under `thumb_` followed by the title,
|
||||
each with unsafe characters replaced. A name over 255 bytes, which most file
|
||||
systems refuse, is cut short between two characters before its extension, so the
|
||||
extension is kept whenever it fits.
|
||||
|
||||
`get` and `get-thumb` resolve the file by ID directly, so `--collection` is
|
||||
accepted for backward compatibility but ignored. For a live photo, `get` writes
|
||||
its image and its video, each named after the title with its own extension, as
|
||||
@@ -696,6 +702,12 @@ and `helper fix-missing-thumbnails` take `--json` for machine-readable output.
|
||||
any that do not match the content hash Ente records; one it cannot replace stays
|
||||
as it was and goes into `failures.json` (see "Backup layout").
|
||||
|
||||
`backup-metadata <dir>` writes `account.json` and, for each collection, a
|
||||
directory `collections/<id>-<name>/` holding `_collection.json` and a
|
||||
`<fileID>.json` for each of its files. The collection's name has unsafe
|
||||
characters replaced and is cut short between two characters so that the
|
||||
directory's name fits in 255 bytes; the ID keeps the directories apart.
|
||||
|
||||
`backup-metadata` fetches ML data in requests of up to 200 files. When a request
|
||||
fails, the error is logged, each of its files is written with the reason in an
|
||||
`mlDataError` field instead of `mlData`, and the dump goes on. A file whose ML
|
||||
@@ -748,9 +760,10 @@ Each original is saved at its save path, the same path `photo.savePath` gives
|
||||
and `photo.download()` writes (see Read surface below). The date is the photo's
|
||||
`takenAt` (the date set in Ente if it was edited, else its creation time) in the
|
||||
time zone of the machine running quak. The extension is the one in the file's
|
||||
name as uploaded, case kept, or `.bin` when it has none or it holds anything but
|
||||
letters and digits. When the date or the time zone changes, the next run saves
|
||||
the original at its new path and leaves the old copy where it is.
|
||||
name as uploaded, case kept, or `.bin` when it has none, it holds anything but
|
||||
letters and digits, or it is more than 16 of them long. When the date or the
|
||||
time zone changes, the next run saves the original at its new path and leaves
|
||||
the old copy where it is.
|
||||
|
||||
`account.json` holds the account's `email` and `userID`, as `backup-metadata`
|
||||
writes it. A collection's JSON holds its `id`, `name`, `type`, `ownerID`,
|
||||
|
||||
Reference in New Issue
Block a user