feat: complte media store
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user