Use custom identifiers
This commit is contained in:
parent
b2d50972ed
commit
299f3ba0cf
5 changed files with 45 additions and 16 deletions
|
|
@ -13,10 +13,10 @@ import (
|
|||
const CURRENT_GONG = "_current_gong"
|
||||
|
||||
type Gong struct {
|
||||
Id []byte `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Path string `json:"path"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Id Identifier `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Path string `json:"path"`
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
|
||||
func currentGongPath(cfg *config.Config) string {
|
||||
|
|
@ -36,7 +36,7 @@ func LoadGongs(cfg *config.Config) (gongs []*Gong, err error) {
|
|||
hash := sha512.Sum512([]byte(path))
|
||||
pabs, _ := filepath.Abs(path)
|
||||
gongs = append(gongs, &Gong{
|
||||
Id: hash[:63],
|
||||
Id: hash[:],
|
||||
Name: strings.TrimSuffix(d.Name(), filepath.Ext(d.Name())),
|
||||
Path: path,
|
||||
Enabled: current_gong == pabs,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue