feat: update video cut and extract head image job

This commit is contained in:
yanghao05
2025-04-22 10:37:57 +08:00
parent 326a9e523b
commit 284531d10e
15 changed files with 474 additions and 136 deletions

View File

@@ -5,6 +5,7 @@ import (
"time"
"quyun/app/requests"
"quyun/database/fields"
"quyun/database/schemas/public/model"
"quyun/database/schemas/public/table"
@@ -215,3 +216,23 @@ func (m *mediasModel) Delete(ctx context.Context, id int64) error {
m.log.Infof("media item deleted successfully")
return nil
}
// UpdateMetas
func (m *mediasModel) UpdateMetas(ctx context.Context, id int64, metas fields.MediaMetas) error {
meta := fields.ToJson(metas)
tbl := table.Medias
stmt := tbl.
UPDATE(tbl.Metas).
SET(meta).
WHERE(tbl.ID.EQ(Int64(id)))
m.log.Infof("sql: %s", stmt.DebugSql())
if _, err := stmt.ExecContext(ctx, db); err != nil {
m.log.Errorf("error updating media metas: %v", err)
return err
}
m.log.Infof("media (%d) metas updated successfully", id)
return nil
}