Show friends in reverse order
This commit is contained in:
parent
70a2cc275d
commit
dd6693a9d2
@ -50,6 +50,10 @@ func Get(ctx *aero.Context) string {
|
|||||||
friends = user.Follows().Users()
|
friends = user.Follows().Users()
|
||||||
deleted := 0
|
deleted := 0
|
||||||
|
|
||||||
|
if animeListItem != nil {
|
||||||
|
episodeToFriends[animeListItem.Episodes] = append(episodeToFriends[animeListItem.Episodes], user)
|
||||||
|
}
|
||||||
|
|
||||||
for i := range friends {
|
for i := range friends {
|
||||||
j := i - deleted
|
j := i - deleted
|
||||||
friend := friends[j]
|
friend := friends[j]
|
||||||
@ -68,10 +72,6 @@ func Get(ctx *aero.Context) string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if animeListItem != nil {
|
|
||||||
episodeToFriends[animeListItem.Episodes] = append(episodeToFriends[animeListItem.Episodes], user)
|
|
||||||
}
|
|
||||||
|
|
||||||
arn.SortUsersLastSeenFirst(friends)
|
arn.SortUsersLastSeenFirst(friends)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,12 @@ func Episodes(ctx *aero.Context) string {
|
|||||||
episodeToFriends := map[int][]*arn.User{}
|
episodeToFriends := map[int][]*arn.User{}
|
||||||
|
|
||||||
if user != nil {
|
if user != nil {
|
||||||
|
ownListItem := user.AnimeList().Find(anime.ID)
|
||||||
|
|
||||||
|
if ownListItem != nil {
|
||||||
|
episodeToFriends[ownListItem.Episodes] = append(episodeToFriends[ownListItem.Episodes], user)
|
||||||
|
}
|
||||||
|
|
||||||
for _, friend := range user.Follows().Users() {
|
for _, friend := range user.Follows().Users() {
|
||||||
friendAnimeList := friend.AnimeList()
|
friendAnimeList := friend.AnimeList()
|
||||||
friendAnimeListItem := friendAnimeList.Find(anime.ID)
|
friendAnimeListItem := friendAnimeList.Find(anime.ID)
|
||||||
@ -26,12 +32,6 @@ func Episodes(ctx *aero.Context) string {
|
|||||||
episodeToFriends[friendAnimeListItem.Episodes] = append(episodeToFriends[friendAnimeListItem.Episodes], friend)
|
episodeToFriends[friendAnimeListItem.Episodes] = append(episodeToFriends[friendAnimeListItem.Episodes], friend)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ownListItem := user.AnimeList().Find(anime.ID)
|
|
||||||
|
|
||||||
if ownListItem != nil {
|
|
||||||
episodeToFriends[ownListItem.Episodes] = append(episodeToFriends[ownListItem.Episodes], user)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -23,6 +23,7 @@ component AnimeEpisodes(anime *arn.Anime, episodes []*arn.AnimeEpisode, episodeT
|
|||||||
if validate.DateTime(episode.AiringDate.Start)
|
if validate.DateTime(episode.AiringDate.Start)
|
||||||
.episode-airing-date-start.utc-airing-date.no-tip(data-start-date=episode.AiringDate.Start, data-end-date=episode.AiringDate.End, data-episode-number=episode.Number)= episode.AiringDate.StartDateHuman()
|
.episode-airing-date-start.utc-airing-date.no-tip(data-start-date=episode.AiringDate.Start, data-end-date=episode.AiringDate.End, data-episode-number=episode.Number)= episode.AiringDate.StartDateHuman()
|
||||||
|
|
||||||
|
//- Show friends in reverse order
|
||||||
.episode-friends
|
.episode-friends
|
||||||
each friend in episodeToFriends[episode.Number]
|
each friend in episodeToFriends[episode.Number] reversed
|
||||||
AvatarNoLink(friend)
|
AvatarNoLink(friend)
|
||||||
|
Loading…
Reference in New Issue
Block a user