Skip to content

Commit

Permalink
fix(FMovies): fix bugs (#7563)
Browse files Browse the repository at this point in the history
fix(FMovies): fix bugs

Co-authored-by: oermin <[email protected]>
  • Loading branch information
Dark_Ville and oErmin authored Aug 9, 2023
1 parent 0d6fa94 commit d75fbc3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion websites/F/FMovies/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"en": "Watch online movies for free, watch movies free in high quality without registration. Just a better place for watching online movies for free. Fmovies.to, FFmovies.is, FFmovies.to"
},
"url": "fmovies.to",
"version": "1.1.0",
"version": "1.1.1",
"logo": "https://cdn.rcd.gg/PreMiD/websites/F/FMovies/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/F/FMovies/assets/thumbnail.jpeg",
"color": "#1BB3C6",
Expand Down
24 changes: 9 additions & 15 deletions websites/F/FMovies/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function setCommonData(
} else presenceData.smallImageKey = Assets.Pause;
presenceData.buttons = [
{
label: href.includes("movie") ? "Watch Movie" : "Watch Series",
label: href.includes("/movie") ? "Watch Movie" : "Watch Series",
url: href,
},
];
Expand All @@ -65,20 +65,14 @@ presence.on("UpdateData", async () => {

if (pathname.includes("/series/") || pathname.includes("/tv/")) {
const season =
document.querySelector<HTMLSpanElement>(".value")?.textContent ??
document
.querySelector('[class="season-view"]')
?.textContent?.match(/[0-9]{1,}/gm)?.[0];
let episode =
document.querySelector<HTMLAnchorElement>("a.active")?.textContent ??
document.querySelector('[class="watch"]')?.getAttribute("data-ep");
if (season || episode) {
if (episode.includes(":")) {
episode = episode
.split(":")?.[0]
.replace(/episode(s)?/gi, "")
.trim();
}
document
.querySelector(".watch[data-season]")
?.getAttribute("data-season") || null,
episode =
document.querySelector(".watch[data-ep]")?.getAttribute("data-ep") ||
null;

if (season !== null || episode !== null) {
presenceData.state =
episode && season
? `S${season}:E${episode}`
Expand Down

0 comments on commit d75fbc3

Please sign in to comment.