Skip to content

Commit

Permalink
clear watched from previous domain
Browse files Browse the repository at this point in the history
  • Loading branch information
Dovakiin0 committed Nov 29, 2024
1 parent 20db0c1 commit e57d5ee
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 24 deletions.
57 changes: 34 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
![logo.png](logo.png)

## Getting Started
Watch your favourite anime anywhere, anytime. No Ads.

First, run the development server:
Previously called [**AnimeWorldz**](https://github.com/Dovakiin0/Kitsune/tree/v2.0), Kitsune is a free, open-source anime streaming website. It is built using the [Next Js](https://nextjs.org/) framework and [Tailwind CSS](https://tailwindcss.com/).

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```
_Kitsune is still under development and may encounter many bugs. Feel free to open any issue regarding bugs or features_

Also checkout the mobile app: [Android](https://github.com/Dovakiin0/animeworldz-mobile), which is still called AnimeWorldz but will later be updated.

## Features

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
- **No Ads** - No ads, no popups, no redirects, no bullshit.
- **PWA Support** - Kitsune is a PWA, which means you can install it on your phone.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
## Contributing

```
fork the repo
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
git clone <forked-repo>
git checkout -b <new-feature>
git add <changed-file>
git commit -m "New feature"
git push origin <new-feature>
## Learn More
then submit a pull request
```

To learn more about Next.js, take a look at the following resources:
## Local Development

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
```
clone the repo
cd kitsune/
npm install or yarn
```

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
rename the `.env.example` file to `.env` then set in TMDB access key (READ ACCESS TOKEN) and vercel KV(optional).
then run the app

## Deploy on Vercel
```
npm run dev or yarn dev
```

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
## Support

Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
Join the Discord server: <https://discord.gg/6yAJ3XDHTt>
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/app/anime/watch/video-player-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ const VideoPlayerSection = () => {
);

useEffect(() => {
if (!Array.isArray(watchedDetails)) {
localStorage.removeItem("watched");
return;
}

if (episodeData) {
const existingAnime = watchedDetails.find(
(watchedAnime) => watchedAnime.anime.id === anime.anime.info.id,
Expand Down
5 changes: 5 additions & 0 deletions src/components/continue-watching.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ const ContinueWatching = (props: Props) => {
episodes: string[];
}[] = storedData ? JSON.parse(storedData) : [];

if (!Array.isArray(watchedAnimes)) {
localStorage.removeItem("watched");
return;
}

const animes = watchedAnimes.reverse().map((anime) => ({
id: anime.anime.id,
name: anime.anime.title,
Expand Down
1 change: 0 additions & 1 deletion src/components/latest-episodes-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ type Props = {

const LatestEpisodesAnime = (props: Props) => {
if (props.loading) return <LoadingSkeleton />;
console.log(props.latestEpisodes);
return (
<Container className="flex flex-col gap-5 py-10 items-center lg:items-start lg:mt-[-10.125rem] z-20 ">
<h5 className="text-2xl font-bold">Recent Releases</h5>
Expand Down
5 changes: 5 additions & 0 deletions src/hooks/use-is-anime-watched.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ export const useHasAnimeWatched = (animeId: string, episodeId?: string) => {
const watchedDetails: Array<IWatchedAnime> =
JSON.parse(localStorage.getItem("watched") as string) || [];

if (!Array.isArray(watchedDetails)) {
localStorage.removeItem("watched");
return;
}

const anime = watchedDetails.find(
(watchedAnime) => watchedAnime.anime.id === animeId,
);
Expand Down

0 comments on commit e57d5ee

Please sign in to comment.