Skip to content

Commit

Permalink
feat(AniWatch): add HiAnime rebrand (#8154)
Browse files Browse the repository at this point in the history
* feat: add HiAnime rebrand

* chore(AniWatch): bump version
  • Loading branch information
mallusrgreatv2 authored Mar 5, 2024
1 parent 36c6664 commit 11ed566
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions websites/A/AniWatch/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
},
"url": [
"aniwatch.to",
"aniwatchtv.to"
"aniwatchtv.to",
"hianime.to"
],
"version": "1.0.5",
"version": "1.0.6",
"logo": "https://cdn.rcd.gg/PreMiD/websites/A/AniWatch/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/A/AniWatch/assets/thumbnail.png",
"color": "#ffdd95",
Expand Down
8 changes: 5 additions & 3 deletions websites/A/AniWatch/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ let data: {

const enum Assets {
AniWatchLogo = "https://cdn.rcd.gg/PreMiD/websites/A/AniWatch/assets/0.png",
HiAnimeLogo = "https://i.imgur.com/a9gT2wg.png",
Settings = "https://cdn.rcd.gg/PreMiD/websites/A/AniWatch/assets/1.png",
Notifications = "https://cdn.rcd.gg/PreMiD/websites/A/AniWatch/assets/2.png",
}
Expand All @@ -27,15 +28,16 @@ presence.on(
);

presence.on("UpdateData", async () => {
const presenceData: PresenceData = {
largeImageKey: Assets.AniWatchLogo,
const isHiAnime = document.location.hostname === "hianime.to",
presenceData: PresenceData = {
largeImageKey: isHiAnime ? Assets.HiAnimeLogo : Assets.AniWatchLogo,
startTimestamp: browsingTimestamp,
},
{ pathname, href } = document.location,
buttons = await presence.getSetting<boolean>("buttons");

if (pathname === "/" || pathname === "/home")
presenceData.details = "Exploring AniWatch.to";
presenceData.details = `Exploring ${isHiAnime ? "HiAnime" : "AniWatch"}.to`;
else if (
/\/(most-favorite|most-popular|movie|recently-added|recently-updated|tv|top-airing|top-upcoming|ona|ova|special|(genre\/.*))/.test(
pathname
Expand Down

0 comments on commit 11ed566

Please sign in to comment.