Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
5rahim committed Sep 6, 2024
1 parent fe9ea77 commit 8efcf5b
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 40 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.

## v2.1.1

- ✨ Discover: New 'Schedule' section
- ✨ Discover: New 'Schedule' and 'Missed sequels' section
- ⚡️ Self update: Replace current process on Linux #114
- ⚡️ Auto play next episode now works for torrent streaming (with auto-select enabled)
- ⚡️ Anime media cards persist list data across pages
Expand All @@ -13,7 +13,7 @@ All notable changes to this project will be documented in this file.
- 🦺 Fixed anime media card trailers
- 🦺 Fixed nested popovers not opening on Firefox
- 🏗️ UI: Added desktop-specific components for future desktop app
- 🏗️ Created separate build processes for frontend
- 🏗️ Added separate build processes for frontend

## v2.1.0

Expand Down
7 changes: 6 additions & 1 deletion internal/api/anilist/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ import (
func ListMissedSequels(
animeCollectionWithRelations *AnimeCollectionWithRelations,
logger *zerolog.Logger,
) ([]*BaseAnime, error) {
) (ret []*BaseAnime, err error) {
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("panic: %v", r)
}
}()

variables := map[string]interface{}{}
variables["page"] = 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useAnilistListRecentAiringAnime } from "@/api/hooks/anilist.hooks"
import { LoadingSpinner } from "@/components/ui/loading-spinner"
import { Separator } from "@/components/ui/separator"
import { format, isSameMonth, isToday, subDays } from "date-fns"
import { addDays } from "date-fns/addDays"
import { formatDistanceToNow } from "date-fns/formatDistanceToNow"
import { isSameDay } from "date-fns/isSameDay"
import Image from "next/image"
import Link from "next/link"
Expand Down Expand Up @@ -92,46 +92,49 @@ export function DiscoverAiringSchedule() {
{days.map((day, index) => {
if (day.events.length === 0) return null
return (
<div key={index} className="flex flex-col gap-2">
<div className="flex items-center gap-2">
<h3 className="font-semibold">{format(new Date(day.date), "EEEE, PP")}</h3>
{day.isToday && <span className="text-[--muted]">Today</span>}
</div>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3">
{day.events?.toSorted((a, b) => a.datetime.localeCompare(b.datetime))?.map((event, index) => {
return (
<div key={event.id} className="flex gap-3 bg-[--background] rounded-md p-2">
<div
className="w-[5rem] h-[5rem] rounded-[--radius] flex-none object-cover object-center overflow-hidden relative"
>
<Image
src={event.media?.coverImage?.large || event.media?.bannerImage || "/no-cover.png"}
alt="banner"
fill
quality={80}
priority
sizes="20rem"
className="object-cover object-center"
/>
</div>
<>
<div key={index} className="flex flex-col gap-2">
<div className="flex items-center gap-2">
<h3 className="font-semibold">{format(new Date(day.date), "EEEE, PP")}</h3>
{day.isToday && <span className="text-[--muted]">Today</span>}
</div>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3">
{day.events?.toSorted((a, b) => a.datetime.localeCompare(b.datetime))?.map((event, index) => {
return (
<div key={event.id} className="flex gap-3 bg-[--background] rounded-md p-2">
<div
className="w-[5rem] h-[5rem] rounded-[--radius] flex-none object-cover object-center overflow-hidden relative"
>
<Image
src={event.media?.coverImage?.large || event.media?.bannerImage || "/no-cover.png"}
alt="banner"
fill
quality={80}
priority
sizes="20rem"
className="object-cover object-center"
/>
</div>

<div className="space-y-1">
<Link
href={`/entry?id=${event.media?.id}`}
className="font-medium tracking-wide line-clamp-1"
>{event.media?.title?.userPreferred}</Link>

<p className="text-[--muted]">
Ep {event.episode} airing at {event.time}
</p>
</div>

<div className="space-y-1">
<Link
href={`/entry?id=${event.media?.id}`}
className="font-medium tracking-wide line-clamp-1"
>{event.media?.title?.userPreferred}</Link>

<p className="text-[--muted]">
Episode {event.episode} {formatDistanceToNow(new Date(event.datetime), { addSuffix: true })}
</p>
</div>

</div>
)
})}
)
})}
</div>
</div>

</div>
<Separator />
</>
)
})}
</div>
Expand Down

0 comments on commit 8efcf5b

Please sign in to comment.