Makes all tests pass green again
* Removed a concurrent write condition that was happening while fetching BD * Updated the local test database to match bedetheque.com state * Note field being highly dynamic removed test from it.
This commit is contained in:
13
album.go
13
album.go
@@ -5,6 +5,7 @@ import (
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -65,6 +66,7 @@ type Album struct {
|
||||
Designers []string `json:"dessins"`
|
||||
Colorists []string `json:"couleurs"`
|
||||
|
||||
mx sync.Mutex
|
||||
Links map[string]string
|
||||
|
||||
FetchDate time.Time
|
||||
@@ -114,3 +116,14 @@ func AlbumCoverExt(URL string) string {
|
||||
}
|
||||
return strings.ToLower(ext)
|
||||
}
|
||||
|
||||
func (a *Album) addLink(title string, value string) {
|
||||
a.mx.Lock()
|
||||
defer a.mx.Unlock()
|
||||
|
||||
if a.Links == nil {
|
||||
a.Links = make(map[string]string)
|
||||
}
|
||||
|
||||
a.Links[title] = value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user