Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.

Commit

Permalink
Update v3.9.3 - Merged Beta to Main (#51)
Browse files Browse the repository at this point in the history
* commit

* update db

* Update v3.9.1-beta-v3.1

* Update v3.9.1

* Fix watched progress not showing

* Secure headers

* Fix recently watched image

* Update v3.9.2

> Added custom lists for AniList
> Fixed episode listMode progress

* Update db route

* Fixed AniList

* Fix next button on dub anime

> video is playing sub anime instead dub

* small adjusment for premid

* fix eslint

* small updates

> added ability to remove episode from recently watched

* Update v3.9.3
  • Loading branch information
DevanAbinaya authored Aug 12, 2023
1 parent e740f67 commit 3e78826
Show file tree
Hide file tree
Showing 34 changed files with 528 additions and 200 deletions.
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ NEXTAUTH_URL="for development use http://localhost:3000/ and for production use
PROXY_URI="I recommend you to use this cors-anywhere as a proxy https://github.com/Rob--W/cors-anywhere follow the instruction on how to use it there. Skip this if you only use gogoanime as a source"
API_URI="host your own API from this repo https://github.com/consumet/api.consumet.org. Don't put / at the end of the url."
API_KEY="this API key is used for schedules and manga page. get the key from https://anify.tv/discord"
DISQUS_SHORTNAME='put your disqus shortname here. (optional)'
DISQUS_SHORTNAME='put your disqus shortname here. (optional)'

## Prisma
DATABASE_URL="Your postgresql connection url"
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "next/core-web-vitals",
"rules": { "react/no-unescaped-entities": 0 }
"rules": {
"react/no-unescaped-entities": 0,
"react/no-unknown-property": ["error", { "ignore": ["css"] }]
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ npm install
3. Generate Prisma :

```bash
npx prisma migrate dev
npx prisma generate
```

Expand Down
1 change: 1 addition & 0 deletions components/anime/episode.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ export default function AnimeEpisode({ info, progress }) {
info={info}
episode={episode}
index={index}
artStorage={artStorage}
providerId={providerId}
progress={progress}
dub={isDub}
Expand Down
5 changes: 4 additions & 1 deletion components/anime/infoDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ export default function DesktopDetails({

<div className="hidden lg:flex w-full flex-col gap-5 h-[250px]">
<div className="flex flex-col gap-2">
<h1 className=" font-inter font-bold text-[36px] text-white line-clamp-1">
<h1
className="title font-inter font-bold text-[36px] text-white line-clamp-1"
title={info?.title?.romaji || info?.title?.english}
>
{info ? (
info?.title?.romaji || info?.title?.english
) : (
Expand Down
18 changes: 16 additions & 2 deletions components/anime/viewMode/listMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,28 @@ export default function ListMode({
info,
episode,
index,
artStorage,
providerId,
progress,
dub,
}) {
const time = artStorage?.[episode?.id]?.timeWatched;
const duration = artStorage?.[episode?.id]?.duration;
let prog = (time / duration) * 100;
if (prog > 90) prog = 100;

return (
<div key={episode.number} className="flex flex-col gap-3 px-2">
<Link
href={`/en/anime/watch/${info.id}/${providerId}?id=${encodeURIComponent(
episode.id
)}&num=${episode.number}${dub ? `&dub=${dub}` : ""}`}
className={`text-start text-sm lg:text-lg ${
progress && episode.number <= progress
progress
? progress && episode.number <= progress
? "text-[#5f5f5f]"
: "text-white"
: prog === 100
? "text-[#5f5f5f]"
: "text-white"
}`}
Expand All @@ -24,7 +34,11 @@ export default function ListMode({
{episode.title && (
<p
className={`text-xs lg:text-sm ${
progress && episode.number <= progress
progress
? progress && episode.number <= progress
? "text-[#5f5f5f]"
: "text-[#b1b1b1]"
: prog === 100
? "text-[#5f5f5f]"
: "text-[#b1b1b1]"
} italic`}
Expand Down
4 changes: 2 additions & 2 deletions components/anime/viewMode/thumbnailDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function ThumbnailDetail({
progress,
dub,
}) {
const time = artStorage?.[epi?.id]?.time;
const time = artStorage?.[epi?.id]?.timeWatched;
const duration = artStorage?.[epi?.id]?.duration;
let prog = (time / duration) * 100;
if (prog > 90) prog = 100;
Expand All @@ -33,7 +33,7 @@ export default function ThumbnailDetail({
className="object-cover z-30 rounded-lg h-[110px] lg:h-[160px] brightness-[65%]"
/>
<span
className={`absolute bottom-0 left-0 h-[3px] bg-red-700`}
className={`absolute bottom-0 left-0 h-[2px] bg-red-700`}
style={{
width:
progress && artStorage && epi?.number <= progress
Expand Down
4 changes: 2 additions & 2 deletions components/anime/viewMode/thumbnailOnly.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function ThumbnailOnly({
progress,
dub,
}) {
const time = artStorage?.[episode?.id]?.time;
const time = artStorage?.[episode?.id]?.timeWatched;
const duration = artStorage?.[episode?.id]?.duration;
let prog = (time / duration) * 100;
if (prog > 90) prog = 100;
Expand All @@ -25,7 +25,7 @@ export default function ThumbnailOnly({
Episode {episode?.number}
</span>
<span
className={`absolute bottom-7 left-0 h-1 bg-red-600`}
className={`absolute bottom-7 left-0 h-[2px] bg-red-600`}
style={{
width:
progress && artStorage && episode?.number <= progress
Expand Down
18 changes: 13 additions & 5 deletions components/anime/watch/primary/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default function Details({
info,
session,
epiNumber,
description,
id,
onList,
setOnList,
Expand Down Expand Up @@ -48,7 +49,10 @@ export default function Details({
<Skeleton height={240} />
)}
</div>
<div className="grid w-full pl-5 gap-3 h-[240px]">
<div
className="grid w-full pl-5 gap-3 h-[240px]"
data-episode={info?.episodes || "0"}
>
<div className="grid grid-cols-2 gap-1 items-center">
<h2 className="text-sm font-light font-roboto text-[#878787]">
Studios
Expand Down Expand Up @@ -93,11 +97,15 @@ export default function Details({
<div className="grid grid-flow-dense grid-cols-2 gap-2 h-full w-full">
{info ? (
<>
<div className="line-clamp-3">{info.title?.romaji || ""}</div>
<div className="line-clamp-3">
<div className="title-rm line-clamp-3">
{info.title?.romaji || ""}
</div>
<div className="title-en line-clamp-3">
{info.title?.english || ""}
</div>
<div className="line-clamp-3">{info.title?.native || ""}</div>
<div className="title-nt line-clamp-3">
{info.title?.native || ""}
</div>
</>
) : (
<Skeleton width={200} height={50} />
Expand All @@ -120,7 +128,7 @@ export default function Details({
<div className={`bg-secondary rounded-md mt-3 mx-3`}>
{info && (
<p
dangerouslySetInnerHTML={{ __html: info?.description }}
dangerouslySetInnerHTML={{ __html: description }}
className={`p-5 text-sm font-light font-roboto text-[#e4e4e4] `}
/>
)}
Expand Down
20 changes: 16 additions & 4 deletions components/anime/watch/primarySide.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default function PrimarySide({
setOnList,
episodeList,
timeWatched,
dub,
}) {
const [episodeData, setEpisodeData] = useState();
const [open, setOpen] = useState(false);
Expand Down Expand Up @@ -148,6 +149,7 @@ export default function PrimarySide({
aniTitle={info.title?.romaji || info.title?.english}
track={navigation}
timeWatched={timeWatched}
dub={dub}
/>
)
) : (
Expand All @@ -162,13 +164,14 @@ export default function PrimarySide({
<Link
href={`/en/anime/${info.id}`}
className="hover:underline"
title={navigation?.playing?.title || info.title?.romaji}
>
{navigation?.playing?.title || info.title?.romaji}
</Link>
</h1>
<h1 className="text-sm font-karla font-light">
<h3 className="text-sm font-karla font-light">
Episode {epiNumber}
</h1>
</h3>
</div>
<div className="flex gap-4 items-center justify-end">
<div className="relative">
Expand All @@ -180,7 +183,11 @@ export default function PrimarySide({
(episode) => episode.number === parseInt(e.target.value)
);
router.push(
`/en/anime/watch/${info.id}/${providerId}?id=${selectedEpisode.id}&num=${selectedEpisode.number}`
`/en/anime/watch/${info.id}/${providerId}?id=${
selectedEpisode.id
}&num=${selectedEpisode.number}${
dub ? `&dub=${dub}` : ""
}`
);
}}
>
Expand All @@ -199,7 +206,11 @@ export default function PrimarySide({
}relative group`}
onClick={() => {
router.push(
`/en/anime/watch/${info.id}/${providerId}?id=${navigation?.next.id}&num=${navigation?.next.number}`
`/en/anime/watch/${info.id}/${providerId}?id=${
navigation?.next.id
}&num=${navigation?.next.number}${
dub ? `&dub=${dub}` : ""
}`
);
}}
>
Expand Down Expand Up @@ -229,6 +240,7 @@ export default function PrimarySide({
<Details
info={info}
session={session}
description={navigation?.playing?.description || info?.description}
epiNumber={epiNumber}
id={watchId}
onList={onList}
Expand Down
4 changes: 2 additions & 2 deletions components/anime/watch/secondarySide.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function SecondarySide({
{episode && episode.length > 0 ? (
episode.some((item) => item.title && item.description) > 0 ? (
episode.map((item) => {
const time = artStorage?.[item.id]?.time;
const time = artStorage?.[item.id]?.timeWatched;
const duration = artStorage?.[item.id]?.duration;
let prog = (time / duration) * 100;
if (prog > 90) prog = 100;
Expand Down Expand Up @@ -50,7 +50,7 @@ export default function SecondarySide({
}`}
/>
<span
className={`absolute bottom-0 left-0 h-[3px] bg-red-700`}
className={`absolute bottom-0 left-0 h-[2px] bg-red-700`}
style={{
width:
progress && artStorage && item?.number <= progress
Expand Down
Loading

0 comments on commit 3e78826

Please sign in to comment.