"github.com/Kovensky/go-anidb/udp"
"github.com/Kovensky/go-fscache"
"image"
- "log"
"regexp"
"sort"
"strconv"
return ch
}
-var validEd2kHash = regexp.MustCompile(`\A[:xdigit:]{32}\z`)
+var validEd2kHash = regexp.MustCompile(`\A[[:xdigit:]]{32}\z`)
// Retrieves a File by its Ed2kHash + Filesize combination. Uses the UDP API.
func (adb *AniDB) FileByEd2kSize(ed2k string, size int64) <-chan *File {
fid := FID(0)
switch ts, err := Cache.Get(&fid, key...); {
- case err != nil && time.Now().Sub(ts) < FileCacheDuration:
+ case err == nil && time.Now().Sub(ts) < FileCacheDuration:
intentMap.NotifyClose(fid, key...)
return ch
}
if partial {
if calledFromFIDsByGID {
epno = test
- log.Printf("UDP!!! FID %d is only part of episode %s with no complementary files", fid, epno)
+ adb.Logger.Printf("UDP!!! FID %d is only part of episode %s with no complementary files", fid, epno)
} else if len(test) == 1 && test[0].Start.Number == test[0].End.Number {
fids := []int{}