feat: update

This commit is contained in:
yanghao05
2025-04-22 14:45:04 +08:00
parent fb8c9a68a4
commit b1f090918d
19 changed files with 43 additions and 35 deletions

View File

@@ -22,8 +22,8 @@ import (
var _ contracts.JobArgs = (*VideoStoreShort)(nil)
type VideoStoreShort struct {
MediaID int64 `json:"media_id"`
FilePath string `json:"file_path"`
MediaHash string `json:"media_hash"`
FilePath string `json:"file_path"`
}
func (s VideoStoreShort) InsertOpts() InsertOpts {
@@ -57,7 +57,7 @@ func (w *VideoStoreShortWorker) Work(ctx context.Context, job *Job[VideoStoreSho
log.Infof("[Start] Working on job with strings: %+v", job.Args)
defer log.Infof("[End] Finished %s", job.Args.Kind())
media, err := models.Medias.GetByID(ctx, job.Args.MediaID)
media, err := models.Medias.GetByHash(ctx, job.Args.MediaHash)
if err != nil {
log.Errorf("Error getting media by ID: %v", err)
return JobCancel(err)