(ctx context.Context, gID db.GraphID, md *db.FileMeta)
| 177 | } |
| 178 | |
| 179 | func (d *DB) SetFileMeta(ctx context.Context, gID db.GraphID, md *db.FileMeta) error { |
| 180 | if md.ID == "" { |
| 181 | return errors.New("no file ID set on metadata") |
| 182 | } |
| 183 | |
| 184 | id := uuid.NewString() |
| 185 | err := d.q.SetFileMeta(ctx, sqlitedb.SetFileMetaParams{ |
| 186 | ID: id, |
| 187 | GraphID: string(gID), |
| 188 | FileID: string(md.ID), |
| 189 | BlobPath: md.BlobPath, |
| 190 | Checksum: md.Checksum, |
| 191 | Size: md.Size, |
| 192 | LastModifiedTx: int64(md.LastModifiedTX), |
| 193 | }) |
| 194 | if err != nil { |
| 195 | return fmt.Errorf("failed to set file metadata: %w", err) |
| 196 | } |
| 197 | return nil |
| 198 | } |
| 199 | |
| 200 | // Because the Logseq client can/will request files it hasn't uploaded yet, the |
| 201 | // map will contain nil entries for requested files that don't exist |
nothing calls this directly
no test coverage detected