diff options
author | Frédéric Guillot <fred@miniflux.net> | 2017-11-21 17:40:29 -0800 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2017-11-21 17:40:29 -0800 |
commit | 4fc18647ca73fed5cc3357eb0b50bcff8263f171 (patch) | |
tree | 2a9d0a5636bdbf43ceef86287bee323950e14412 /server/ui/controller/entry.go | |
parent | e52f0b9cd29b1e0bfb8f45bc4ef8507dc7a721f8 (diff) |
Make sure that items marked as removed are not shown
Diffstat (limited to 'server/ui/controller/entry.go')
-rw-r--r-- | server/ui/controller/entry.go | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/server/ui/controller/entry.go b/server/ui/controller/entry.go index c4ca587..82a13ad 100644 --- a/server/ui/controller/entry.go +++ b/server/ui/controller/entry.go @@ -33,6 +33,7 @@ func (c *Controller) ShowFeedEntry(ctx *core.Context, request *core.Request, res builder := c.store.GetEntryQueryBuilder(user.ID, user.Timezone) builder.WithFeedID(feedID) builder.WithEntryID(entryID) + builder.WithoutStatus(model.EntryStatusRemoved) entry, err := builder.GetEntry() if err != nil { @@ -52,6 +53,7 @@ func (c *Controller) ShowFeedEntry(ctx *core.Context, request *core.Request, res } builder = c.store.GetEntryQueryBuilder(user.ID, user.Timezone) + builder.WithoutStatus(model.EntryStatusRemoved) builder.WithFeedID(feedID) builder.WithCondition("e.id", "!=", entryID) builder.WithCondition("e.published_at", "<=", entry.Date) @@ -64,6 +66,7 @@ func (c *Controller) ShowFeedEntry(ctx *core.Context, request *core.Request, res } builder = c.store.GetEntryQueryBuilder(user.ID, user.Timezone) + builder.WithoutStatus(model.EntryStatusRemoved) builder.WithFeedID(feedID) builder.WithCondition("e.id", "!=", entryID) builder.WithCondition("e.published_at", ">=", entry.Date) @@ -88,8 +91,7 @@ func (c *Controller) ShowFeedEntry(ctx *core.Context, request *core.Request, res if entry.Status == model.EntryStatusUnread { err = c.store.SetEntriesStatus(user.ID, []int64{entry.ID}, model.EntryStatusRead) if err != nil { - log.Println(err) - response.Html().ServerError(nil) + response.Html().ServerError(err) return } } @@ -124,6 +126,7 @@ func (c *Controller) ShowCategoryEntry(ctx *core.Context, request *core.Request, builder := c.store.GetEntryQueryBuilder(user.ID, user.Timezone) builder.WithCategoryID(categoryID) builder.WithEntryID(entryID) + builder.WithoutStatus(model.EntryStatusRemoved) entry, err := builder.GetEntry() if err != nil { @@ -143,6 +146,7 @@ func (c *Controller) ShowCategoryEntry(ctx *core.Context, request *core.Request, } builder = c.store.GetEntryQueryBuilder(user.ID, user.Timezone) + builder.WithoutStatus(model.EntryStatusRemoved) builder.WithCategoryID(categoryID) builder.WithCondition("e.id", "!=", entryID) builder.WithCondition("e.published_at", "<=", entry.Date) @@ -155,6 +159,7 @@ func (c *Controller) ShowCategoryEntry(ctx *core.Context, request *core.Request, } builder = c.store.GetEntryQueryBuilder(user.ID, user.Timezone) + builder.WithoutStatus(model.EntryStatusRemoved) builder.WithCategoryID(categoryID) builder.WithCondition("e.id", "!=", entryID) builder.WithCondition("e.published_at", ">=", entry.Date) @@ -208,6 +213,7 @@ func (c *Controller) ShowUnreadEntry(ctx *core.Context, request *core.Request, r builder := c.store.GetEntryQueryBuilder(user.ID, user.Timezone) builder.WithEntryID(entryID) + builder.WithoutStatus(model.EntryStatusRemoved) entry, err := builder.GetEntry() if err != nil { @@ -227,6 +233,7 @@ func (c *Controller) ShowUnreadEntry(ctx *core.Context, request *core.Request, r } builder = c.store.GetEntryQueryBuilder(user.ID, user.Timezone) + builder.WithoutStatus(model.EntryStatusRemoved) builder.WithStatus(model.EntryStatusUnread) builder.WithCondition("e.id", "!=", entryID) builder.WithCondition("e.published_at", "<=", entry.Date) @@ -239,6 +246,7 @@ func (c *Controller) ShowUnreadEntry(ctx *core.Context, request *core.Request, r } builder = c.store.GetEntryQueryBuilder(user.ID, user.Timezone) + builder.WithoutStatus(model.EntryStatusRemoved) builder.WithStatus(model.EntryStatusUnread) builder.WithCondition("e.id", "!=", entryID) builder.WithCondition("e.published_at", ">=", entry.Date) @@ -292,6 +300,7 @@ func (c *Controller) ShowReadEntry(ctx *core.Context, request *core.Request, res builder := c.store.GetEntryQueryBuilder(user.ID, user.Timezone) builder.WithEntryID(entryID) + builder.WithoutStatus(model.EntryStatusRemoved) entry, err := builder.GetEntry() if err != nil { @@ -311,6 +320,7 @@ func (c *Controller) ShowReadEntry(ctx *core.Context, request *core.Request, res } builder = c.store.GetEntryQueryBuilder(user.ID, user.Timezone) + builder.WithoutStatus(model.EntryStatusRemoved) builder.WithStatus(model.EntryStatusRead) builder.WithCondition("e.id", "!=", entryID) builder.WithCondition("e.published_at", "<=", entry.Date) @@ -323,6 +333,7 @@ func (c *Controller) ShowReadEntry(ctx *core.Context, request *core.Request, res } builder = c.store.GetEntryQueryBuilder(user.ID, user.Timezone) + builder.WithoutStatus(model.EntryStatusRemoved) builder.WithStatus(model.EntryStatusRead) builder.WithCondition("e.id", "!=", entryID) builder.WithCondition("e.published_at", ">=", entry.Date) @@ -354,7 +365,7 @@ func (c *Controller) ShowReadEntry(ctx *core.Context, request *core.Request, res })) } -// UpdateEntriesStatus handles Ajax request to update a list of entries. +// UpdateEntriesStatus handles Ajax request to update the status for a list of entries. func (c *Controller) UpdateEntriesStatus(ctx *core.Context, request *core.Request, response *core.Response) { user := ctx.GetLoggedUser() |