diff --git a/backend/common/media_store/store.go b/backend/common/media_store/store.go index 9cc1cce..119f4c8 100644 --- a/backend/common/media_store/store.go +++ b/backend/common/media_store/store.go @@ -70,9 +70,9 @@ func (s Store) Hashes() []string { } // Exists -func (s Store) Exists(name string) bool { +func (s Store) HashExists(hash string) bool { for _, m := range s { - if m.Name == name { + if m.Hash == hash { return true } } diff --git a/backend/modules/tasks/discover/discover_medias.go b/backend/modules/tasks/discover/discover_medias.go index 2a5c8bc..5e78870 100644 --- a/backend/modules/tasks/discover/discover_medias.go +++ b/backend/modules/tasks/discover/discover_medias.go @@ -58,7 +58,7 @@ func (d *DiscoverMedias) RunE(from, to string) error { return errors.Wrapf(err, "get file md5: %s", video) } - if store.Exists(md5) { + if store.HashExists(md5) { continue } @@ -242,7 +242,7 @@ func (d *DiscoverMedias) runCleanup(to string) { } for _, dir := range dirs { - if store.Exists(dir) { + if store.HashExists(dir) { continue }