Added deletion to Kitsu imports
This commit is contained in:
@ -14,9 +14,14 @@ import (
|
||||
func NewKitsuAnime(ctx *aero.Context) string {
|
||||
user := utils.GetUser(ctx)
|
||||
finder := arn.NewAnimeFinder("kitsu/anime")
|
||||
deletedIDs, err := arn.GetIDList("deleted kitsu anime")
|
||||
|
||||
if err != nil {
|
||||
deletedIDs = arn.IDList{}
|
||||
}
|
||||
|
||||
animes := arn.FilterKitsuAnime(func(anime *kitsu.Anime) bool {
|
||||
return finder.GetAnime(anime.ID) == nil
|
||||
return finder.GetAnime(anime.ID) == nil && !arn.Contains(deletedIDs, anime.ID)
|
||||
})
|
||||
|
||||
sort.Slice(animes, func(i, j int) bool {
|
||||
|
@ -28,6 +28,9 @@ component NewKitsuAnime(animes []*kitsu.Anime, url string, user *arn.User)
|
||||
if len(anime.Attributes.StartDate) >= 4
|
||||
span= anime.Attributes.StartDate[:4]
|
||||
td
|
||||
button.action(data-action="importKitsuAnime", data-trigger="click", data-id=anime.ID)
|
||||
Icon("download")
|
||||
span Import
|
||||
.buttons
|
||||
button.action(data-action="importKitsuAnime", data-trigger="click", data-id=anime.ID)
|
||||
RawIcon("download")
|
||||
|
||||
button.action(data-action="deleteKitsuAnime", data-trigger="click", data-id=anime.ID)
|
||||
RawIcon("trash")
|
Reference in New Issue
Block a user