Add media granularity to backup attachment download source

This commit is contained in:
trevor-signal 2025-09-10 16:16:46 -04:00 committed by GitHub
commit 11e612f57b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 74 additions and 49 deletions

View file

@ -833,7 +833,9 @@ async function saveAttachmentDownloadJob(
job: AttachmentDownloadJobType
): Promise<void> {
await writableChannel.saveAttachmentDownloadJob(job);
if (job.originalSource === AttachmentDownloadSource.BACKUP_IMPORT) {
if (
job.originalSource === AttachmentDownloadSource.BACKUP_IMPORT_WITH_MEDIA
) {
drop(
throttledUpdateBackupMediaDownloadProgress(
readableChannel.getBackupAttachmentDownloadProgress
@ -847,7 +849,8 @@ async function saveAttachmentDownloadJobs(
await writableChannel.saveAttachmentDownloadJobs(jobs);
if (
jobs.some(
job => job.originalSource === AttachmentDownloadSource.BACKUP_IMPORT
job =>
job.originalSource === AttachmentDownloadSource.BACKUP_IMPORT_WITH_MEDIA
)
) {
drop(
@ -862,7 +865,9 @@ async function removeAttachmentDownloadJob(
job: AttachmentDownloadJobType
): Promise<void> {
await writableChannel.removeAttachmentDownloadJob(job);
if (job.originalSource === AttachmentDownloadSource.BACKUP_IMPORT) {
if (
job.originalSource === AttachmentDownloadSource.BACKUP_IMPORT_WITH_MEDIA
) {
drop(
throttledUpdateBackupMediaDownloadProgress(
readableChannel.getBackupAttachmentDownloadProgress