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:
2017-09-05 15:01:43 +02:00
parent 2f526632fe
commit b0eefe8de3
5 changed files with 87 additions and 63 deletions

View File

@@ -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
}