-
Notifications
You must be signed in to change notification settings - Fork 75
[codex] Add attachment media backup support #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # `attachments` | ||
|
|
||
| Lists attachment metadata and optionally downloads attachment media into the local cache. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| discrawl attachments --channel general --days 7 | ||
| discrawl attachments --filename crash --type image --all | ||
| discrawl attachments --message 1456744319972282449 | ||
| discrawl attachments fetch --channel general --days 7 | ||
| discrawl attachments fetch --missing --max-bytes 104857600 | ||
| discrawl --json attachments --missing --all | ||
| ``` | ||
|
|
||
| ## Flags | ||
|
|
||
| - `--channel <id|name|#name>` - id, exact name, `#name`, or partial name match | ||
| - `--guild <id>` / `--guilds <id,id>` / `--dm` - restrict the guild scope (`--dm` is shorthand for `--guild @me`) | ||
| - `--author <name>` - restrict to one author | ||
| - `--message <id>` - restrict to one message | ||
| - `--filename <text>` - filename substring match | ||
| - `--type <text>` - content-type substring match, such as `image` or `application/pdf` | ||
| - `--hours <n>` - shorthand for "since now minus N hours" | ||
| - `--days <n>` - shorthand for "since now minus N days" | ||
| - `--since <RFC3339>` / `--before <RFC3339>` - explicit time window | ||
| - `--limit <n>` - safety limit (default 200; `--all` removes it) | ||
| - `--all` - removes the safety limit | ||
| - `--missing` - only attachments whose cached media file is absent | ||
|
|
||
| `attachments fetch` also accepts: | ||
|
|
||
| - `--force` - re-download already cached attachments | ||
| - `--max-bytes <n>` - per-attachment download cap (defaults to `[sync].max_attachment_bytes`) | ||
|
|
||
| ## Notes | ||
|
|
||
| - media bytes are stored under `cache_dir/media`, not in SQLite | ||
| - SQLite stores attachment metadata, content hash, cached media path, fetch status, and errors | ||
| - `publish` backs up cached non-DM media files by default; use `publish --no-media` to omit them | ||
| - `@me` DM media is local-only and is not published to Git snapshots | ||
|
|
||
| ## See also | ||
|
|
||
| - [`messages`](messages.html) | ||
| - [`publish`](publish.html) | ||
| - [`sync`](sync.html) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
syncruns in its default latest-only mode (LatestOnlytrue with no--since),fetchSyncMediapasses onlyopts.SinceintoAttachmentListOptions, which is zero in that mode, somedia.Fetchscans all attachments in the targeted guilds instead of the latest delta. Becausemedia.Fetchverifies reusable files by hashing them, enabling--with-media(or[sync].attachment_media=true) can turn routine syncs into full-archive media verification/download passes on every run, causing severe performance regressions and unexpected backlog fetching.Useful? React with 👍 / 👎.