feat: complete media discovery

This commit is contained in:
Rogee
2024-12-06 14:19:57 +08:00
parent 2b551f1b69
commit 43bde1e62a
2 changed files with 4 additions and 4 deletions

View File

@@ -70,9 +70,9 @@ func (s Store) Hashes() []string {
} }
// Exists // Exists
func (s Store) Exists(name string) bool { func (s Store) HashExists(hash string) bool {
for _, m := range s { for _, m := range s {
if m.Name == name { if m.Hash == hash {
return true return true
} }
} }

View File

@@ -58,7 +58,7 @@ func (d *DiscoverMedias) RunE(from, to string) error {
return errors.Wrapf(err, "get file md5: %s", video) return errors.Wrapf(err, "get file md5: %s", video)
} }
if store.Exists(md5) { if store.HashExists(md5) {
continue continue
} }
@@ -242,7 +242,7 @@ func (d *DiscoverMedias) runCleanup(to string) {
} }
for _, dir := range dirs { for _, dir := range dirs {
if store.Exists(dir) { if store.HashExists(dir) {
continue continue
} }