diff options
| author | Factiven <[email protected]> | 2023-07-25 07:18:18 +0700 |
|---|---|---|
| committer | Factiven <[email protected]> | 2023-07-25 07:18:18 +0700 |
| commit | 7a518c1809b8daf35412e0c562cd669e01c0f694 (patch) | |
| tree | 08af2d56a635077a72d8e7cd03dd68ff48fa6a4a | |
| parent | Fixed mediaList won't update (diff) | |
| download | moopa-7a518c1809b8daf35412e0c562cd669e01c0f694.tar.xz moopa-7a518c1809b8daf35412e0c562cd669e01c0f694.zip | |
added .env disqus shortname
| -rw-r--r-- | README.md | 3 | ||||
| -rw-r--r-- | components/anime/watch/primary/details.js | 2 | ||||
| -rw-r--r-- | components/anime/watch/primarySide.js | 2 | ||||
| -rw-r--r-- | components/disqus.js | 3 | ||||
| -rw-r--r-- | pages/en/anime/watch/[...info].js | 4 |
5 files changed, 12 insertions, 2 deletions
@@ -70,7 +70,7 @@ - [x] Ability to auto track anime after watching >= 90% through the video - [x] Create a user profile page to see lists of anime watched - [x] Ability to edit list inside detail page -- [X] Working on Manga pages +- [x] Working on Manga pages ## Bug Report @@ -101,6 +101,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 for manga page. get the key from https://anify.tv/discord (key doesn't contain any special character in it)" +DISQUS_SHORTNAME='put your disqus shortname here. (optional)' ``` 4. Add this endpoint as Redirect Url on AniList Developer : diff --git a/components/anime/watch/primary/details.js b/components/anime/watch/primary/details.js index f24bf3b..dfaf60c 100644 --- a/components/anime/watch/primary/details.js +++ b/components/anime/watch/primary/details.js @@ -12,6 +12,7 @@ export default function Details({ onList, setOnList, handleOpen, + disqus, }) { const [url, setUrl] = useState(null); const { markPlanning } = useAniList(session); @@ -130,6 +131,7 @@ export default function Details({ title: info.title.romaji, url: url, episode: epiNumber, + name: disqus, }} /> </div> diff --git a/components/anime/watch/primarySide.js b/components/anime/watch/primarySide.js index 394e553..f6e4e62 100644 --- a/components/anime/watch/primarySide.js +++ b/components/anime/watch/primarySide.js @@ -22,6 +22,7 @@ export default function PrimarySide({ status, onList, proxy, + disqus, setOnList, episodeList, }) { @@ -193,6 +194,7 @@ export default function PrimarySide({ onList={onList} setOnList={setOnList} handleOpen={handleOpen} + disqus={disqus} /> </div> </div> diff --git a/components/disqus.js b/components/disqus.js index b276995..ee15b98 100644 --- a/components/disqus.js +++ b/components/disqus.js @@ -1,7 +1,8 @@ import { DiscussionEmbed } from "disqus-react"; +require("dotenv").config(); const DisqusComments = ({ post }) => { - const disqusShortname = "your_disqus_shortname"; + const disqusShortname = post.name || "your_disqus_shortname"; const disqusConfig = { url: post.url, identifier: post.id, // Single post id diff --git a/pages/en/anime/watch/[...info].js b/pages/en/anime/watch/[...info].js index 500f68b..21709fd 100644 --- a/pages/en/anime/watch/[...info].js +++ b/pages/en/anime/watch/[...info].js @@ -17,6 +17,7 @@ export default function Info({ provider, epiNumber, proxy, + disqus, }) { const [info, setInfo] = useState(null); const [currentEpisode, setCurrentEpisode] = useState(null); @@ -184,6 +185,7 @@ export default function Info({ status={statuses} onList={onList} proxy={proxy} + disqus={disqus} setOnList={setOnList} setLoading={setLoading} loading={loading} @@ -215,6 +217,7 @@ export async function getServerSideProps(context) { } const proxy = process.env.PROXY_URI; + const disqus = process.env.DISQUS_SHORTNAME; const aniId = query.info[0]; const provider = query.info[1]; @@ -229,6 +232,7 @@ export async function getServerSideProps(context) { watchId: watchId || null, epiNumber: epiNumber || null, proxy, + disqus, }, }; } |