From 27cb444d8524f1dcf5f849861c86fa14dbb62894 Mon Sep 17 00:00:00 2001 From: Adailton Nascimento Date: Sun, 25 Feb 2024 21:11:33 -0300 Subject: [PATCH] feat: use ISearch as default for pagination --- src/models/index.ts | 2 -- src/models/types.ts | 6 +----- src/providers/movies/flixhq.ts | 10 +++++----- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/models/index.ts b/src/models/index.ts index 1727ab466..538bac66c 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -11,7 +11,6 @@ import NewsParser from './news-parser'; import { IProviderStats, ISearch, - IByCountry, IAnimeEpisode, IAnimeInfo, IAnimeResult, @@ -81,7 +80,6 @@ export { GetComicsComicsObject, ComicRes, ISearch, - IByCountry, IMangaChapterPage, TvType, MovieParser, diff --git a/src/models/types.ts b/src/models/types.ts index 4f3b5ef88..aba24ce7c 100644 --- a/src/models/types.ts +++ b/src/models/types.ts @@ -32,7 +32,7 @@ export interface IAnimeResult { [x: string]: any; // other fields } -export interface Pagination { +export interface ISearch { currentPage?: number; hasNextPage?: boolean; totalPages?: number; @@ -43,10 +43,6 @@ export interface Pagination { results: T[]; } -export interface ISearch extends Pagination {} - -export interface IByCountry extends Pagination {} - export interface Trailer { id: string; site?: string; diff --git a/src/providers/movies/flixhq.ts b/src/providers/movies/flixhq.ts index 59c996223..3846b4fed 100644 --- a/src/providers/movies/flixhq.ts +++ b/src/providers/movies/flixhq.ts @@ -9,7 +9,6 @@ import { ISource, IMovieResult, ISearch, - IByCountry, } from '../../models'; import { MixDrop, VidCloud } from '../../extractors'; @@ -384,8 +383,8 @@ class FlixHQ extends MovieParser { } }; - fetchByCountry = async (country: string, page: number = 1): Promise> => { - const result: IByCountry = { + fetchByCountry = async (country: string, page: number = 1): Promise> => { + const result: ISearch = { currentPage: page, hasNextPage: false, results: [], @@ -428,7 +427,8 @@ class FlixHQ extends MovieParser { // const search = await movie.search('the flash'); // // const movieInfo = await movie.fetchEpisodeSources('1168337', 'tv/watch-vincenzo-67955'); // // const recentTv = await movie.fetchTrendingTvShows(); -// console.log(search); -// })(); +// // const search = await movie.fetchByCountry('KR') +// // console.log(search); +//})(); export default FlixHQ;