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