feat: update discover medias
This commit is contained in:
@@ -9,12 +9,12 @@ import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type Store []UUIDMap
|
||||
type Store []VideoInfo
|
||||
|
||||
type UUIDMap struct {
|
||||
UUID string
|
||||
Name string
|
||||
Price uint
|
||||
type VideoInfo struct {
|
||||
Hash string
|
||||
Name string
|
||||
Duration uint
|
||||
}
|
||||
|
||||
func NewStore(path string) (Store, error) {
|
||||
@@ -56,17 +56,17 @@ func (s Store) Save(path string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s Store) Add(uuid, name string, price uint) {
|
||||
s = append(s, UUIDMap{UUID: uuid, Name: name, Price: price})
|
||||
func (s Store) Append(info VideoInfo) Store {
|
||||
return append(s, info)
|
||||
}
|
||||
|
||||
func (s Store) UUIDs() []string {
|
||||
var uuids []string
|
||||
func (s Store) Hashes() []string {
|
||||
var hashes []string
|
||||
for _, m := range s {
|
||||
uuids = append(uuids, m.UUID)
|
||||
hashes = append(hashes, m.Hash)
|
||||
}
|
||||
|
||||
return uuids
|
||||
return hashes
|
||||
}
|
||||
|
||||
// Exists
|
||||
|
||||
Reference in New Issue
Block a user