Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor additions and bug fix. #4169

Merged
merged 4 commits into from
Jul 31, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[CodeFactor] Apply fixes to commit f2f786a
  • Loading branch information
code-factor committed Jul 30, 2021
commit f305b4711c0c914203f2716f5b3401f449eaa1ff
29 changes: 12 additions & 17 deletions websites/A/AnizmTV/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ presence.on("UpdateData", async () => {
.querySelector("#pageContent > div > h2 > a")
?.getAttribute("href") || document.URL;

if (!title || !episode) {
if (!title || !episode)
video = null;
}


if (
document.location.pathname.includes("/SeriEkle") ||
Expand All @@ -64,35 +64,34 @@ presence.on("UpdateData", async () => {
);
}

data.state = tags.innerText + " panelinde!";
data.state = `${tags.innerText} panelinde!`;
} else if (document.location.pathname.includes("/profil")) {
data.details = "Profile Göz atıyor...";
tags = document.querySelector(
"#pageContent > div > div.profileCoverArea.autoPosterSize.anizm_round > div.info.pfull > div > div > div:nth-child(1) > div.profileNickname"
);
data.state = tags.innerText.split("@").slice(1).join(" ");
} else if (document.location.pathname.includes("/ayarlar")) {
} else if (document.location.pathname.includes("/ayarlar"))
data.details = "Ayarlara Göz atıyor...";
} else if (document.location.pathname.includes("/ara")) {
else if (document.location.pathname.includes("/ara")) {
data.details = "Aranıyor: ";
tags = document.querySelector("#pageContent > div > h2 > span");
data.state = tags.innerText.split("Aranan: ").slice(1).join(" ");
} else if (document.location.pathname.includes("/girisyap")) {
} else if (document.location.pathname.includes("/girisyap"))
data.details = "Giriş yapıyor...";
} else if (document.location.pathname.includes("/uyeol")) {
else if (document.location.pathname.includes("/uyeol"))
data.details = "Üye oluyor...";
} else if (window.location.href.indexOf("?sayfa=") > 1) {
else if (window.location.href.indexOf("?sayfa=") > 1) {
const pageNum = document.URL.split("?sayfa=")[1]
.split("#episodes")
.slice(0)
.join(" ");
data.details = (await strings).browsing;
data.state = "Sayfa: " + pageNum;
data.state = `Sayfa: ${pageNum}`;
}

//Episode part
if (title && episode)
{
if (title && episode) {
data.details = title.textContent;
data.state = episode.textContent.split("/ ").slice(1).join(" ");
data.buttons = [
Expand All @@ -107,8 +106,7 @@ presence.on("UpdateData", async () => {
];
}
//Series part
else if (title)
{
else if (title) {
data.details = title.textContent;
data.buttons = [
{
Expand Down Expand Up @@ -136,11 +134,8 @@ presence.on("UpdateData", async () => {
document.location.pathname.includes("/uyeol") ||
window.location.href.indexOf("?sayfa=") > 1
)
{
data.startTimestamp = startTimestamp;
}
else
{
else {
data.details = (await strings).browsing;
data.startTimestamp = startTimestamp;
}
Expand Down