Follow track change when toggle

This commit is contained in:
nemunaire 2022-10-15 13:00:51 +02:00
commit 69ddfd48e9
3 changed files with 18 additions and 5 deletions

View file

@ -58,6 +58,10 @@ func (t *Track) Rename(newName string) error {
}
t.Path = newPath
// Recalculate hash
hash := sha512.Sum512([]byte(t.Path))
t.Id = hash[:]
return nil
}
@ -73,6 +77,10 @@ func (t *Track) MoveTo(path string) error {
}
t.Path = path
// Recalculate hash
hash := sha512.Sum512([]byte(t.Path))
t.Id = hash[:]
return nil
}