Skip to content

Commit

Permalink
revert: "fix(book): follow rank sort removal"
Browse files Browse the repository at this point in the history
This reverts commit 3fe4471.
  • Loading branch information
NateScarlet committed Nov 30, 2022
1 parent 9e9f482 commit e957b52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/book/category_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ type Sort string
const (
SortTotalRecommend Sort = "2"
SortCharCount Sort = "3"
SortLastUpdated Sort = "5"
SortRecentFinished Sort = "6"
SortWeekRecommend Sort = "9"
SortMonthRecommend Sort = "10"
SortTotalBookmark Sort = "11"
Expand Down
5 changes: 5 additions & 0 deletions pkg/book/category_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ func TestCategorySearch_simple(t *testing.T) {
{CategorySearchOptionSubCategory(SC未来世界)},
{CategorySearchOptionPage(2)},
{CategorySearchOptionPage(2), CategorySearchOptionSort(SortMonthRecommend)},
{CategorySearchOptionSort(SortLastUpdated)},
{CategorySearchOptionSort(SortMonthRecommend)},
{CategorySearchOptionSort(SortRecentFinished)},
{CategorySearchOptionSort(SortTotalBookmark)},
{CategorySearchOptionSort(SortTotalRecommend)},
{CategorySearchOptionSort(SortWeekRecommend)},
Expand Down Expand Up @@ -72,6 +74,9 @@ func TestCategorySearch_simple(t *testing.T) {
if opt.sort == "" {
assert.NotEmpty(t, i.LastUpdated)
}
if opt.sort == SortRecentFinished {
assert.NotEmpty(t, i.Finished)
}
hasWeekRecommendCount = hasWeekRecommendCount || i.WeekRecommendCount > 0
hasMonthRecommendCount = hasMonthRecommendCount || i.MonthRecommendCount > 0
hasTotalRecommendCount = hasTotalRecommendCount || i.TotalRecommendCount > 0
Expand Down

0 comments on commit e957b52

Please sign in to comment.