feat: complte media store

This commit is contained in:
Rogee
2024-12-06 15:06:15 +08:00
parent 43bde1e62a
commit 7d446b46c2
10 changed files with 199 additions and 226 deletions

View File

@@ -1,6 +1,8 @@
package store
import (
"context"
"backend/common/media_store"
"backend/modules/medias"
@@ -27,7 +29,13 @@ func (d *StoreMedias) RunE(targetPath string) error {
if err != nil {
return errors.Wrapf(err, "new store: %s", targetPath)
}
_ = store
for _, item := range store {
err := d.mediasSvc.Upsert(context.Background(), 1, item)
if err != nil {
d.log.WithError(err).Errorf("upsert media: %s - %s", item.Hash, item.Name)
}
}
return nil
}