Added episode count filter for editors

This commit is contained in:
Eduard Urbach 2020-11-07 08:24:27 +09:00
parent 81f18ec233
commit 3738b46ce9
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0
3 changed files with 20 additions and 0 deletions

View File

@ -66,6 +66,7 @@ component EditorTabs(url string, user *arn.User)
Tab("Start date", "calendar", "/editor/anime/details/startdate" + user.Settings().Editor.Filter.Suffix())
Tab("End date", "calendar", "/editor/anime/details/enddate" + user.Settings().Editor.Filter.Suffix())
Tab("Ep. Length", "clock-o", "/editor/anime/details/episodelength" + user.Settings().Editor.Filter.Suffix())
Tab("Ep. Count", "clock-o", "/editor/anime/details/episodecount" + user.Settings().Editor.Filter.Suffix())
Tab("Source", "book", "/editor/anime/details/source" + user.Settings().Editor.Filter.Suffix())
if strings.Contains(url, "/editor/anime/companies")

View File

@ -0,0 +1,18 @@
package filteranime
import (
"github.com/aerogo/aero"
"github.com/animenotifier/notify.moe/arn"
)
// EpisodeCount ...
func EpisodeCount(ctx aero.Context) error {
return editorList(
ctx,
"Anime without an episode count",
func(anime *arn.Anime) bool {
return anime.EpisodeCount == 0
},
nil,
)
}

View File

@ -46,6 +46,7 @@ func Register(app *aero.Application) {
editorFilterable("/editor/anime/details/startdate", filteranime.StartDate)
editorFilterable("/editor/anime/details/enddate", filteranime.EndDate)
editorFilterable("/editor/anime/details/episodelength", filteranime.EpisodeLength)
editorFilterable("/editor/anime/details/episodecount", filteranime.EpisodeCount)
editorFilterable("/editor/anime/details/source", filteranime.Source)
editorFilterable("/editor/anime/details/status", filteranime.Status)