Example #1
0
func ttRssFeedListCategoryFeed(u content.User, f content.UserFeed, id data.FeedId, includeUnread bool) (c ttRssCategory) {
	c.BareId = id
	c.Id = "FEED:" + strconv.FormatInt(int64(id), 10)
	c.Type = "feed"

	copts := data.ArticleCountOptions{UnreadOnly: true}
	if f != nil {
		c.Name = f.Data().Title
		c.Unread = f.Count(copts)
	} else {
		c.Name = ttRssSpecialTitle(id)
		switch id {
		case TTRSS_FAVORITE_ID:
			copts.FavoriteOnly = true
			c.Unread = u.Count(copts)
		case TTRSS_FRESH_ID:
			copts.AfterDate = time.Now().Add(TTRSS_FRESH_DURATION)
			c.Unread = u.Count(copts)
		case TTRSS_ALL_ID:
			c.Unread = u.Count(copts)
		}
	}

	return
}
Example #2
0
func TestImplements(t *testing.T) {
	var article content.Article

	r := NewRepo(nil, nil)

	article = r.Article()
	article.Data()

	var userArticle content.UserArticle

	userArticle = r.UserArticle(nil)
	userArticle.Data()

	var scoredArticle content.ScoredArticle

	scoredArticle = r.ScoredArticle()
	scoredArticle.Data()

	var feed content.Feed

	feed = r.Feed()
	feed.Data()

	var userFeed content.UserFeed

	userFeed = r.UserFeed(nil)
	userFeed.Data()

	var taggedFeed content.TaggedFeed

	taggedFeed = r.TaggedFeed(nil)
	taggedFeed.Data()

	r.HasErr()

	var subscription content.Subscription

	subscription = r.Subscription()
	subscription.Data()

	var tag content.Tag

	tag = r.Tag(nil)
	tag.Value()

	var user content.User

	user = r.User()
	user.Data()
}