diff --git a/pages/editor/editor.pixy b/pages/editor/editor.pixy index 1195e37f..9bca9e72 100644 --- a/pages/editor/editor.pixy +++ b/pages/editor/editor.pixy @@ -27,7 +27,8 @@ component EditorTabs(url string) Tab("Shoboi", "list", "/editor/anime/missing/shoboi") Tab("AniList", "list", "/editor/anime/missing/anilist") Tab("Genres", "list", "/editor/anime/missing/genres") - Tab("Hi-Res Image", "list", "/editor/anime/missing/hiresimage") + Tab("Low-Res", "image", "/editor/anime/lowresimage") + Tab("Ultra Low-Res", "image", "/editor/anime/ultralowresimage") //- a.tab.ajax(href="/admin", aria-label="Admin") //- Icon("wrench") diff --git a/pages/editor/lowresimages.go b/pages/editor/lowresimages.go index 74302e42..d1d20876 100644 --- a/pages/editor/lowresimages.go +++ b/pages/editor/lowresimages.go @@ -10,6 +10,15 @@ const maxImageEntries = 70 // LowResolutionAnimeImages filters anime with low resolution images. func LowResolutionAnimeImages(ctx *aero.Context) string { + return filterAnimeImages(ctx, "Anime with low resolution images", arn.AnimeImageLargeWidth, arn.AnimeImageLargeHeight) +} + +// UltraLowResolutionAnimeImages filters anime with ultra low resolution images. +func UltraLowResolutionAnimeImages(ctx *aero.Context) string { + return filterAnimeImages(ctx, "Anime with ultra low resolution images", arn.AnimeImageLargeWidth/2, arn.AnimeImageLargeHeight/2) +} + +func filterAnimeImages(ctx *aero.Context, title string, minExpectedWidth int, minExpectedHeight int) string { year, _ := ctx.GetInt("year") animeType := ctx.Get("type") @@ -22,7 +31,7 @@ func LowResolutionAnimeImages(ctx *aero.Context) string { return false } - return anime.Image.Width < arn.AnimeImageLargeWidth || anime.Image.Height < arn.AnimeImageLargeHeight + return anime.Image.Width < minExpectedWidth || anime.Image.Height < minExpectedHeight }) // Sort @@ -36,7 +45,7 @@ func LowResolutionAnimeImages(ctx *aero.Context) string { } return ctx.HTML(components.AnimeEditorListFull( - "Anime with low resolution images", + title, lowResAnime, count, "/editor/anime/missing/hiresimage", diff --git a/pages/index.go b/pages/index.go index c4d55ef2..da8b39ff 100644 --- a/pages/index.go +++ b/pages/index.go @@ -254,9 +254,12 @@ func Configure(app *aero.Application) { l.Page("/editor/anime/missing/genres", editor.Genres) l.Page("/editor/anime/missing/genres/:year", editor.Genres) l.Page("/editor/anime/missing/genres/:year/:type", editor.Genres) - l.Page("/editor/anime/missing/hiresimage", editor.LowResolutionAnimeImages) - l.Page("/editor/anime/missing/hiresimage/:year", editor.LowResolutionAnimeImages) - l.Page("/editor/anime/missing/hiresimage/:year/:type", editor.LowResolutionAnimeImages) + l.Page("/editor/anime/lowresimage", editor.LowResolutionAnimeImages) + l.Page("/editor/anime/lowresimage/:year", editor.LowResolutionAnimeImages) + l.Page("/editor/anime/lowresimage/:year/:type", editor.LowResolutionAnimeImages) + l.Page("/editor/anime/ultralowresimage", editor.UltraLowResolutionAnimeImages) + l.Page("/editor/anime/ultralowresimage/:year", editor.UltraLowResolutionAnimeImages) + l.Page("/editor/anime/ultralowresimage/:year/:type", editor.UltraLowResolutionAnimeImages) // Editor - MALdiff l.Page("/editor/anime/maldiff", editor.CompareMAL)