File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import type { FrontMatterCache , TFile } from "obsidian" ;
2+ import { Notice } from "obsidian" ;
23import type { default as DiscourseGraphPlugin } from "~/index" ;
34import { getLoggedInClient , getSupabaseContext } from "./supabaseContext" ;
45import { addFile } from "@repo/database/lib/files" ;
@@ -371,6 +372,13 @@ export const publishNodeToGroup = async ({
371372 for ( const attachment of attachments ) {
372373 const mimetype = mime . lookup ( attachment . path ) || "application/octet-stream" ;
373374 if ( mimetype . startsWith ( "text/" ) ) continue ;
375+ // Do not use standard upload for large files
376+ if ( attachment . stat . size >= 6 * 1024 * 1024 ) {
377+ new Notice (
378+ `Asset file ${ attachment . path } is larger than 6Mb and will not be uploaded` ,
379+ ) ;
380+ continue ;
381+ }
374382 existingFiles . push ( attachment . path ) ;
375383 const existingRef = existingReferencesByPath [ attachment . path ] ;
376384 if (
You can’t perform that action at this time.
0 commit comments