File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed
packages/database/src/lib Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -39,11 +39,6 @@ export const publishNode = async ({
3939 }
4040 const contentId = idResponse . data . id ;
4141 const lastModifiedDb = new Date ( idResponse . data . last_modified + "Z" ) ;
42- console . log (
43- idResponse . data . last_modified ,
44- lastModifiedDb . getTime ( ) ,
45- file . stat . mtime ,
46- ) ;
4742 if (
4843 existingPublish . includes ( myGroup ) &&
4944 file . stat . mtime <= lastModifiedDb . getTime ( )
@@ -124,10 +119,11 @@ export const publishNode = async ({
124119 // do not fail on cleanup
125120 if ( cleanupResult . error ) console . error ( cleanupResult . error ) ;
126121
127- await plugin . app . fileManager . processFrontMatter (
128- file ,
129- ( fm : Record < string , unknown > ) => {
130- fm . publishedToGroups = [ ...existingPublish , myGroup ] ;
131- } ,
132- ) ;
122+ if ( ! existingPublish . includes ( myGroup ) )
123+ await plugin . app . fileManager . processFrontMatter (
124+ file ,
125+ ( fm : Record < string , unknown > ) => {
126+ fm . publishedToGroups = [ ...existingPublish , myGroup ] ;
127+ } ,
128+ ) ;
133129} ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export const addFile = async ({
2525 if ( ! exists ) {
2626 // we should use upsert here for sync issues, but we get obscure rls errors.
2727 const uploadResult = await client . storage . from ( ASSETS_BUCKET_NAME ) . upload ( hashvalue , content , { contentType : mimetype } ) ;
28- if ( uploadResult . error && ! uploadResult . error . message . endsWith ( " already exists" ) )
28+ if ( uploadResult . error && ( uploadResult . error as any ) . statusCode !== "409" )
2929 throw uploadResult . error ;
3030 }
3131 // not doing an upsert because it does not update on conflict
You can’t perform that action at this time.
0 commit comments