fix: sync issues

This commit is contained in:
Rogee
2024-12-06 15:18:15 +08:00
parent 7d446b46c2
commit 4191eba953
3 changed files with 34 additions and 11 deletions

View File

@@ -87,12 +87,21 @@ func (s Store) Hashes() []string {
}
// Exists
func (s Store) HashExists(hash string) bool {
func (s Store) HashExists(hash string) (VideoInfo, bool) {
for _, m := range s {
if m.Hash == hash {
return true
return m, true
}
}
return false
return VideoInfo{}, false
}
func (s Store) Update(info VideoInfo) {
for i, m := range s {
if m.Hash == info.Hash {
s[i] = info
break
}
}
}