Skip to content

Commit

Permalink
feat: use ISearch as default for pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
Adailton Nascimento committed Feb 26, 2024
1 parent a1dc526 commit 27cb444
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
2 changes: 0 additions & 2 deletions src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import NewsParser from './news-parser';
import {
IProviderStats,
ISearch,
IByCountry,
IAnimeEpisode,
IAnimeInfo,
IAnimeResult,
Expand Down Expand Up @@ -81,7 +80,6 @@ export {
GetComicsComicsObject,
ComicRes,
ISearch,
IByCountry,
IMangaChapterPage,
TvType,
MovieParser,
Expand Down
6 changes: 1 addition & 5 deletions src/models/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface IAnimeResult {
[x: string]: any; // other fields
}

export interface Pagination<T> {
export interface ISearch<T> {
currentPage?: number;
hasNextPage?: boolean;
totalPages?: number;
Expand All @@ -43,10 +43,6 @@ export interface Pagination<T> {
results: T[];
}

export interface ISearch<T> extends Pagination<T> {}

export interface IByCountry<T> extends Pagination<T> {}

export interface Trailer {
id: string;
site?: string;
Expand Down
10 changes: 5 additions & 5 deletions src/providers/movies/flixhq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
ISource,
IMovieResult,
ISearch,
IByCountry,
} from '../../models';
import { MixDrop, VidCloud } from '../../extractors';

Expand Down Expand Up @@ -384,8 +383,8 @@ class FlixHQ extends MovieParser {
}
};

fetchByCountry = async (country: string, page: number = 1): Promise<IByCountry<IMovieResult>> => {
const result: IByCountry<IMovieResult> = {
fetchByCountry = async (country: string, page: number = 1): Promise<ISearch<IMovieResult>> => {
const result: ISearch<IMovieResult> = {
currentPage: page,
hasNextPage: false,
results: [],
Expand Down Expand Up @@ -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;

0 comments on commit 27cb444

Please sign in to comment.