forked from PreMiD/Presences
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(filman.cc): add presence (PreMiD#6104)
Co-authored-by: Slowlife <slowlife1165@gmail.com> Co-authored-by: Slowlife01 <slowlife1165@gmail.com>
- Loading branch information
1 parent
b84dd51
commit bd64d1f
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"$schema": "https://schemas.premid.app/metadata/1.7", | ||
"author": { | ||
"name": "xKubson_", | ||
"id": "404217213873029120" | ||
}, | ||
"service": "filman.cc", | ||
"description": { | ||
"en": "Polish site offering links to series and movies from other sources.", | ||
"pl": "Polska strona oferująca linki do seriali i filmów z innych źródeł." | ||
}, | ||
"url": "filman.cc", | ||
"version": "1.0.0", | ||
"logo": "https://i.imgur.com/NHoj4QX.png", | ||
"thumbnail": "https://i.imgur.com/Fx7f5BM.png", | ||
"color": "#00b3ff", | ||
"category": "videos", | ||
"tags": ["videos"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const presence = new Presence({ | ||
clientId: "966334543789424781" | ||
}), | ||
browsingTimestamp = Math.floor(Date.now() / 1000); | ||
|
||
presence.on("UpdateData", async () => { | ||
const presenceData: PresenceData = { | ||
largeImageKey: "logo", | ||
startTimestamp: browsingTimestamp | ||
}, | ||
path = document.location.pathname.toLowerCase(); | ||
if (path == "/" || path == "/online") | ||
presenceData.details = "Przegląda stronę główną..."; | ||
else if (path.includes("/movies")) { | ||
presenceData.details = "Ogląda film:"; | ||
presenceData.state = document.title.split(" ").slice(0, -9).join(" "); | ||
} else if (path.includes("/serial-online/") && path.split("/").length == 5) { | ||
presenceData.details = "Ogląda serial:"; | ||
presenceData.state = `${document.title.split(" ").slice(0, -9).join(" ")}`; | ||
} else if (path.includes("/serial-online")) { | ||
presenceData.details = "Sprawdza serial:"; | ||
presenceData.state = document.title.split(" ").slice(0, -9).join(" "); | ||
} else if (path.includes("/filmy-online-pl")) | ||
presenceData.details = "Przegląda listę filmów"; | ||
else if (path.includes("/seriale-online-pl")) | ||
presenceData.details = "Przegląda listę seriali"; | ||
else if (path.includes("/dla-dzieci-pl")) | ||
presenceData.details = 'Przegląda "Dla dzieci"'; | ||
else if (path.includes("/popularne")) | ||
presenceData.details = "Przegląda popularne filmy i seriale"; | ||
else if (path.includes("/tag")) { | ||
presenceData.details = "Przegląda tag:"; | ||
presenceData.state = path.split("/")[2]; | ||
} else if (path.includes("/wyszukiwarka")) { | ||
presenceData.details = "Szuka:"; | ||
presenceData.state = document.title.split(" ").slice(4, -9).join(" "); | ||
} else if (path.includes("/regulamin")) | ||
presenceData.details = "Czyta regulamin"; | ||
else if (path.includes("/pomoc")) presenceData.details = "Czyta FAQ"; | ||
else if (path.includes("/poszukiwane")) | ||
presenceData.details = "Przegląda poszukiwane filmy i seriale..."; | ||
|
||
if (presenceData.details) presence.setActivity(presenceData); | ||
else presence.setActivity(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "../../../tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "./dist/" | ||
} | ||
} |