@@ -21,6 +21,10 @@ export interface AttachmentQueueOptions {
2121 * Whether to mark the initial watched attachment IDs to be synced
2222 */
2323 performInitialSync ?: boolean ;
24+ /**
25+ * Should attachments be downloaded
26+ */
27+ downloadAttachments ?: boolean ;
2428 /**
2529 * How to handle download errors, return { retry: false } to ignore the download
2630 */
@@ -35,7 +39,8 @@ export const DEFAULT_ATTACHMENT_QUEUE_OPTIONS: Partial<AttachmentQueueOptions> =
3539 attachmentDirectoryName : 'attachments' ,
3640 syncInterval : 30_000 ,
3741 cacheLimit : 100 ,
38- performInitialSync : true
42+ performInitialSync : true ,
43+ downloadAttachments : true
3944} ;
4045
4146export abstract class AbstractAttachmentQueue < T extends AttachmentQueueOptions = AttachmentQueueOptions > {
@@ -426,6 +431,9 @@ export abstract class AbstractAttachmentQueue<T extends AttachmentQueueOptions =
426431 }
427432
428433 watchDownloads ( ) {
434+ if ( this . options . downloadAttachments ) {
435+ return ;
436+ }
429437 this . idsToDownload ( async ( ids ) => {
430438 ids . map ( ( id ) => this . downloadQueue . add ( id ) ) ;
431439 // No need to await this, the lock will ensure only one loop is running at a time
@@ -434,6 +442,9 @@ export abstract class AbstractAttachmentQueue<T extends AttachmentQueueOptions =
434442 }
435443
436444 private async downloadRecords ( ) {
445+ if ( this . options . downloadAttachments ) {
446+ return ;
447+ }
437448 if ( this . downloading ) {
438449 return ;
439450 }
0 commit comments