Could happen if a file is added without a cached MyListEntry. Make a fake
MyListEntry and cache that, with an old enough Cached timestamp to make
it always stale.
Also change the always stale timestamp in parseMylistReply to a more
reliably ancient one.
if mla.Cached.IsZero() {
// as attractive as such an ancient mtime would be,
// few filesystems can represent it; just make it old enough
if mla.Cached.IsZero() {
// as attractive as such an ancient mtime would be,
// few filesystems can represent it; just make it old enough
- mla.Cached = now.Add(-2 * MyListCacheDuration)
+ mla.Cached = time.Unix(0, 0),
Cache.Set(mla, "mylist-anime", uid, f.AID)
Cache.Chtime(mla.Cached, "mylist-anime", uid, f.AID)
Cache.Set(mla, "mylist-anime", uid, f.AID)
Cache.Chtime(mla.Cached, "mylist-anime", uid, f.AID)
if set == nil ||
(set.ViewDate == nil && set.Watched == nil && set.State == nil &&
set.Source == nil && set.Storage == nil && set.Other == nil) {
return
}
if set == nil ||
(set.ViewDate == nil && set.Watched == nil && set.State == nil &&
set.Source == nil && set.Storage == nil && set.Other == nil) {
return
}
+ if e == nil {
+ now := time.Now()
+ e = &MyListEntry{
+ LID: lid,
+
+ AID: f.AID,
+ EID: f.EID,
+ FID: f.FID,
+ GID: f.GID,
+
+ DateAdded: now,
+
+ // make sure it's expired
+ Cached: time.Unix(0, 0),
+ }
+ }
if set.ViewDate != nil {
e.DateWatched = *set.ViewDate
} else if set.Watched != nil {
if set.ViewDate != nil {
e.DateWatched = *set.ViewDate
} else if set.Watched != nil {