diff --git a/.docs/content/1.get-started/4.changelog.md b/.docs/content/1.get-started/4.changelog.md index 82b33fa..0836b31 100644 --- a/.docs/content/1.get-started/4.changelog.md +++ b/.docs/content/1.get-started/4.changelog.md @@ -6,6 +6,7 @@ title: 'Changelog' - Fixed VidSrcTo (both Vidplay and Filemoon embeds) - Added dropload, filelions and vtube embeds to Primewire - Fixed and enabled Smashystream +- Improved RidoMovies search results # Version 2.2.8 - Fix package exports for CJS and ESM diff --git a/src/providers/embeds/filemoon/index.ts b/src/providers/embeds/filemoon/index.ts index e63e2be..fb6ee08 100644 --- a/src/providers/embeds/filemoon/index.ts +++ b/src/providers/embeds/filemoon/index.ts @@ -1,8 +1,6 @@ import { load } from 'cheerio'; import { unpack } from 'unpacker'; -import { flags } from '@/entrypoint/utils/targets'; - import { SubtitleResult } from './types'; import { makeEmbed } from '../../base'; import { Caption, getCaptionTypeFromUrl, labelToLanguageCode } from '../../captions'; diff --git a/src/providers/sources/ridomovies/index.ts b/src/providers/sources/ridomovies/index.ts index 1fa7659..638ea13 100644 --- a/src/providers/sources/ridomovies/index.ts +++ b/src/providers/sources/ridomovies/index.ts @@ -19,13 +19,19 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) => q: ctx.media.title, }, }); - const show = searchResult.data.items[0]; - if (!show) throw new NotFoundError('No watchable item found'); + const mediaData = searchResult.data.items.map((movieEl) => { + const name = movieEl.title; + const year = movieEl.contentable.releaseYear; + const fullSlug = movieEl.fullSlug; + return { name, year, fullSlug }; + }); + const targetMedia = mediaData.find((m) => m.name === ctx.media.title && m.year === ctx.media.releaseYear.toString()); + if (!targetMedia?.fullSlug) throw new NotFoundError('No watchable item found'); - let iframeSourceUrl = `/${show.fullSlug}/videos`; + let iframeSourceUrl = `/${targetMedia.fullSlug}/videos`; if (ctx.media.type === 'show') { - const showPageResult = await ctx.proxiedFetcher(`/${show.fullSlug}`, { + const showPageResult = await ctx.proxiedFetcher(`/${targetMedia.fullSlug}`, { baseUrl: ridoMoviesBase, }); const fullEpisodeSlug = `season-${ctx.media.season.number}/episode-${ctx.media.episode.number}`;