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