Squashed commit of the following:

commit 5d38a76997
Merge: 7cccdb9 f160e23
Author: Blake <blakejoy@users.noreply.github.com>
Date:   Sat Apr 15 11:44:39 2023 -0400

    Merge pull request #22 from blakejoy/feat/add_linting

    feat - add linting and prettier

commit f160e2362c
Author: Blake Joynes <blakejoynes@gmail.com>
Date:   Sat Apr 15 11:44:00 2023 -0400

    add pre commit hook

commit 0fd8317884
Merge: bc91674 d1e87ba
Author: Blake Joynes <blakejoynes@gmail.com>
Date:   Sat Apr 15 11:41:28 2023 -0400

    add husky

commit bc91674c4b
Author: Blake Joynes <blakejoynes@gmail.com>
Date:   Sat Apr 15 11:39:24 2023 -0400

    add husky

commit d1e87ba7be
Author: Blake <blakejoy@users.noreply.github.com>
Date:   Fri Apr 14 08:48:33 2023 -0400

    Update .prettierrc

commit d064d4d86f
Author: Blake Joynes <blakejoynes@gmail.com>
Date:   Fri Apr 14 03:09:39 2023 -0400

    turn off linebreak rules

commit 06155bd323
Author: Blake Joynes <blakejoynes@gmail.com>
Date:   Thu Apr 13 21:58:41 2023 -0400

    add linting and prettier
This commit is contained in:
DerPenz
2023-04-15 18:32:06 +02:00
parent 562864a70f
commit 6c361002bf
37 changed files with 2373 additions and 2073 deletions

View File

@@ -2,42 +2,21 @@ module.exports = {
env: { env: {
browser: false, browser: false,
es2021: true, es2021: true,
node: true,
}, },
extends: [ extends: [
'plugin:@typescript-eslint/recommended', "eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
], ],
parser: '@typescript-eslint/parser', parser: "@typescript-eslint/parser",
parserOptions: { parserOptions: {
ecmaVersion: 12, ecmaVersion: 12,
sourceType: 'module', sourceType: "module",
}, },
plugins: [
'@typescript-eslint',
],
rules:{ rules:{
'@typescript-eslint/no-var-requires': 'off', 'linebreak-style': ['off', 'unix'],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/explicit-function-return-type': ['warn', { allowExpressions: true }],
indent: 'off',
'@typescript-eslint/indent': ['error', 2],
'no-trailing-spaces': 'error',
quotes: ['error', 'single', { allowTemplateLiterals: true }],
semi: ['error', 'always'],
'spaced-comment': ['error', 'always'],
'no-irregular-whitespace': ['error', { 'skipComments': true }],
'space-infix-ops': 'error',
'array-bracket-spacing': 'error',
'object-curly-spacing': ['error', 'always'],
'space-before-function-paren': ['error', {
named: 'never',
anonymous: 'never',
asyncArrow: 'always',
}],
'comma-dangle': ['warn', 'always-multiline'],
'no-multiple-empty-lines': 'error',
}, },
plugins: ["@typescript-eslint"],
}; };

4
.husky/pre-commit Executable file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npm run lint

3
.prettierignore Normal file
View File

@@ -0,0 +1,3 @@
dist
node_modules
.github

12
.prettierrc Normal file
View File

@@ -0,0 +1,12 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"arrowParens": "always",
"proseWrap": "never",
"htmlWhitespaceSensitivity": "strict"
}

3924
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,8 @@
"compile": "rm -rf dist && tsc -d && npm run copy-types", "compile": "rm -rf dist && tsc -d && npm run copy-types",
"lint": "eslint --ext .ts src/", "lint": "eslint --ext .ts src/",
"lint:fix": "eslint --ext .ts src/ --fix", "lint:fix": "eslint --ext .ts src/ --fix",
"prepublish": "tsc", "format": "npx prettier --write src",
"pre-commit": "npm run lint",
"copy-types": "mkdir dist/types && cp src/types/*.d.ts dist/types" "copy-types": "mkdir dist/types && cp src/types/*.d.ts dist/types"
}, },
"bugs": { "bugs": {
@@ -31,14 +32,17 @@
"devDependencies": { "devDependencies": {
"@types/node": "^15.3.0", "@types/node": "^15.3.0",
"@types/node-fetch": "^2.5.10", "@types/node-fetch": "^2.5.10",
"@typescript-eslint/eslint-plugin": "^4.23.0", "@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^4.23.0", "@typescript-eslint/parser": "^5.58.0",
"dotenv": "^9.0.2", "dotenv": "^9.0.2",
"eslint": "^7.26.0", "eslint": "^8.38.0",
"eslint-config-airbnb-base": "^14.2.1", "eslint-config-airbnb-typescript": "^17.0.0",
"eslint-plugin-import": "^2.23.1", "eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.3",
"prettier": "^2.8.7",
"ts-node": "^9.1.1", "ts-node": "^9.1.1",
"typescript": "^4.2.4" "typescript": "^4.9.5"
}, },
"dependencies": { "dependencies": {
"cross-fetch": "^3.1.4" "cross-fetch": "^3.1.4"
@@ -48,6 +52,11 @@
"yarn": "1.19.2", "yarn": "1.19.2",
"npm": "7.12.1" "npm": "7.12.1"
}, },
"husky": {
"hooks": {
"pre-commit": "npm run pre-commit"
}
},
"files": [ "files": [
"dist" "dist"
] ]

View File

@@ -17,6 +17,6 @@ export default class Api {
'Content-Type': 'application/json;charset=utf-8', 'Content-Type': 'application/json;charset=utf-8',
}, },
}); });
return await response.json() as T; return (await response.json()) as T;
} }
} }

View File

@@ -1,7 +1,6 @@
import { BaseEndpoint } from './base'; import { BaseEndpoint } from './base';
import { ChangeOptions, Changes } from '../types/changes'; import { ChangeOptions, Changes } from '../types/changes';
export class ChangeEndpoint extends BaseEndpoint { export class ChangeEndpoint extends BaseEndpoint {
constructor(protected readonly accessToken: string) { constructor(protected readonly accessToken: string) {
super(accessToken); super(accessToken);

View File

@@ -1,4 +1,9 @@
import { DetailedCollection, ImageCollection, LanguageOption, Translations } from '../types'; import {
DetailedCollection,
ImageCollection,
LanguageOption,
Translations,
} from '../types';
import { BaseEndpoint } from './base'; import { BaseEndpoint } from './base';
const BASE_COLLECTION = '/collection'; const BASE_COLLECTION = '/collection';

View File

@@ -9,5 +9,4 @@ export class ConfigurationEndpoint extends BaseEndpoint {
async getCurrent(): Promise<Configuration> { async getCurrent(): Promise<Configuration> {
return await this.api.get<Configuration>(`/configuration`); return await this.api.get<Configuration>(`/configuration`);
} }
} }

View File

@@ -1,7 +1,6 @@
import { BaseEndpoint } from './base'; import { BaseEndpoint } from './base';
import { CreditResponse } from '../types/credits'; import { CreditResponse } from '../types/credits';
export class CreditsEndpoint extends BaseEndpoint { export class CreditsEndpoint extends BaseEndpoint {
constructor(protected readonly accessToken: string) { constructor(protected readonly accessToken: string) {
super(accessToken); super(accessToken);
@@ -10,5 +9,4 @@ export class CreditsEndpoint extends BaseEndpoint {
async getById(id: string): Promise<CreditResponse> { async getById(id: string): Promise<CreditResponse> {
return await this.api.get<CreditResponse>(`/credit/${id}`); return await this.api.get<CreditResponse>(`/credit/${id}`);
} }
} }

View File

@@ -1,7 +1,7 @@
import { BaseEndpoint } from './base'; import { BaseEndpoint } from './base';
export interface Genres { export interface Genres {
genres: Array<{id: number, name: string}> genres: Array<{ id: number; name: string }>;
} }
export class GenreEndpoint extends BaseEndpoint { export class GenreEndpoint extends BaseEndpoint {

View File

@@ -1,5 +1,3 @@
export * from './account'; export * from './account';
export * from './certification'; export * from './certification';
export * from './changes'; export * from './changes';
@@ -16,4 +14,3 @@ export * from './trending';
export * from './find'; export * from './find';
export * from './keywords'; export * from './keywords';
export * from './collections'; export * from './collections';

View File

@@ -19,7 +19,8 @@ import {
ReleaseDates, ReleaseDates,
Reviews, Reviews,
SimilarMovies, SimilarMovies,
TopRatedMovies, Translations, TopRatedMovies,
Translations,
UpcomingMovies, UpcomingMovies,
Videos, Videos,
WatchProviders, WatchProviders,
@@ -37,7 +38,9 @@ export class MoviesEndpoint extends BaseEndpoint{
} }
async alternativeTitles(id: number): Promise<AlternativeTitles> { async alternativeTitles(id: number): Promise<AlternativeTitles> {
return await this.api.get<AlternativeTitles>(`${BASE_MOVIE}/${id}/alternative_titles`); return await this.api.get<AlternativeTitles>(
`${BASE_MOVIE}/${id}/alternative_titles`
);
} }
async changes(id: number, options?: ChangeOptions): Promise<MovieChanges>{ async changes(id: number, options?: ChangeOptions): Promise<MovieChanges>{
@@ -69,7 +72,9 @@ export class MoviesEndpoint extends BaseEndpoint{
} }
async releaseDates(id: number): Promise<ReleaseDates> { async releaseDates(id: number): Promise<ReleaseDates> {
return await this.api.get<ReleaseDates>(`${BASE_MOVIE}/${id}/release_dates`); return await this.api.get<ReleaseDates>(
`${BASE_MOVIE}/${id}/release_dates`
);
} }
async reviews(id: number, options?: PageOption): Promise<Reviews>{ async reviews(id: number, options?: PageOption): Promise<Reviews>{
@@ -93,7 +98,9 @@ export class MoviesEndpoint extends BaseEndpoint{
* @param id * @param id
*/ */
async watchProviders(id: number): Promise<WatchProviders> { async watchProviders(id: number): Promise<WatchProviders> {
return await this.api.get<WatchProviders>(`${BASE_MOVIE}/${id}/watch/providers`); return await this.api.get<WatchProviders>(
`${BASE_MOVIE}/${id}/watch/providers`
);
} }
async latest(): Promise<LatestMovie> { async latest(): Promise<LatestMovie> {
@@ -116,5 +123,3 @@ export class MoviesEndpoint extends BaseEndpoint{
return await this.api.get<UpcomingMovies>(`${BASE_MOVIE}/upcoming`, options); return await this.api.get<UpcomingMovies>(`${BASE_MOVIE}/upcoming`, options);
} }
} }

View File

@@ -30,23 +30,31 @@ export class PeopleEndpoint extends BaseEndpoint {
} }
async movieCredits(id: number): Promise<PersonMovieCredit> { async movieCredits(id: number): Promise<PersonMovieCredit> {
return await this.api.get<PersonMovieCredit>(`${BASE_PERSON}/${id}/movie_credits`); return await this.api.get<PersonMovieCredit>(
`${BASE_PERSON}/${id}/movie_credits`
);
} }
async tvShowCredits(id: number): Promise<PersonTvShowCredit> { async tvShowCredits(id: number): Promise<PersonTvShowCredit> {
return await this.api.get<PersonTvShowCredit>(`${BASE_PERSON}/${id}/tv_credits`); return await this.api.get<PersonTvShowCredit>(
`${BASE_PERSON}/${id}/tv_credits`
);
} }
async combinedCredits(id: number): Promise<PersonCombinedCredits> { async combinedCredits(id: number): Promise<PersonCombinedCredits> {
return await this.api.get<PersonCombinedCredits>(`${BASE_PERSON}/${id}/combined_credits`); return await this.api.get<PersonCombinedCredits>(
`${BASE_PERSON}/${id}/combined_credits`
);
} }
async externalId(id: number): Promise<ExternalIds> { async externalId(id: number): Promise<ExternalIds> {
return await this.api.get<ExternalIds>(`${BASE_PERSON}/${id}/external_ids`); return await this.api.get<ExternalIds>(`${BASE_PERSON}/${id}/external_ids`);
} }
async images(id: number): Promise<{id: number, profiles: Image[]}>{ async images(id: number): Promise<{ id: number; profiles: Image[] }> {
return await this.api.get<{id: number, profiles: Image[]}>(`${BASE_PERSON}/${id}/images`); return await this.api.get<{ id: number; profiles: Image[] }>(
`${BASE_PERSON}/${id}/images`
);
} }
async taggedImages(id: number, options?: PageOption): Promise<TaggedImages>{ async taggedImages(id: number, options?: PageOption): Promise<TaggedImages>{
@@ -54,7 +62,9 @@ export class PeopleEndpoint extends BaseEndpoint {
} }
async translation(id: number): Promise<PeopleTranslations> { async translation(id: number): Promise<PeopleTranslations> {
return await this.api.get<PeopleTranslations>(`${BASE_PERSON}/${id}/translations`); return await this.api.get<PeopleTranslations>(
`${BASE_PERSON}/${id}/translations`
);
} }
async latest(): Promise<PersonDetail> { async latest(): Promise<PersonDetail> {

View File

@@ -6,9 +6,12 @@ export class TrendingEndpoint extends BaseEndpoint {
super(accessToken); super(accessToken);
} }
async trending<T extends MediaType>(mediaType : T, timeWindow: TimeWindow): Promise<TrendingResults<T>> { async trending<T extends MediaType>(
return await this.api.get<TrendingResults<T>>(`/trending/${mediaType}/${timeWindow}`); mediaType: T,
timeWindow: TimeWindow
): Promise<TrendingResults<T>> {
return await this.api.get<TrendingResults<T>>(
`/trending/${mediaType}/${timeWindow}`
);
} }
} }

View File

@@ -40,7 +40,9 @@ export class TvShowsEndpoint extends BaseEndpoint{
} }
async alternativeTitles(id: number): Promise<AlternativeTitles> { async alternativeTitles(id: number): Promise<AlternativeTitles> {
return await this.api.get<AlternativeTitles>(`${BASE_TV}/${id}/alternative_titles`); return await this.api.get<AlternativeTitles>(
`${BASE_TV}/${id}/alternative_titles`
);
} }
async changes(id: number, options?: ChangeOptions): Promise<TvShowChanges>{ async changes(id: number, options?: ChangeOptions): Promise<TvShowChanges>{
@@ -48,7 +50,9 @@ export class TvShowsEndpoint extends BaseEndpoint{
} }
async contentRatings(id: number): Promise<ContentRatings> { async contentRatings(id: number): Promise<ContentRatings> {
return await this.api.get<ContentRatings>(`${BASE_TV}/${id}/content_ratings`); return await this.api.get<ContentRatings>(
`${BASE_TV}/${id}/content_ratings`
);
} }
async credits(id: number): Promise<Credits> { async credits(id: number): Promise<Credits> {
@@ -56,7 +60,9 @@ export class TvShowsEndpoint extends BaseEndpoint{
} }
async season(tvId: number, seasonNumber: number): Promise<SeasonDetails> { async season(tvId: number, seasonNumber: number): Promise<SeasonDetails> {
return await this.api.get<SeasonDetails>(`${BASE_TV}/${tvId}/season/${seasonNumber}`); return await this.api.get<SeasonDetails>(
`${BASE_TV}/${tvId}/season/${seasonNumber}`
);
} }
async episodeGroups(id: number): Promise<EpisodeGroups> { async episodeGroups(id: number): Promise<EpisodeGroups> {
@@ -84,7 +90,9 @@ export class TvShowsEndpoint extends BaseEndpoint{
} }
async screenedTheatrically(id: number): Promise<ScreenedTheatrically> { async screenedTheatrically(id: number): Promise<ScreenedTheatrically> {
return await this.api.get<ScreenedTheatrically>(`${BASE_TV}/${id}/screened_theatrically`); return await this.api.get<ScreenedTheatrically>(
`${BASE_TV}/${id}/screened_theatrically`
);
} }
async similar(id: number, options?: PageOption): Promise<SimilarTvShows>{ async similar(id: number, options?: PageOption): Promise<SimilarTvShows>{
@@ -104,7 +112,9 @@ export class TvShowsEndpoint extends BaseEndpoint{
* @param id * @param id
*/ */
async watchProviders(id: number): Promise<WatchProviders> { async watchProviders(id: number): Promise<WatchProviders> {
return await this.api.get<WatchProviders>(`${BASE_TV}/${id}/watch/providers`); return await this.api.get<WatchProviders>(
`${BASE_TV}/${id}/watch/providers`
);
} }
async latest(): Promise<LatestTvShows> { async latest(): Promise<LatestTvShows> {

View File

@@ -6,14 +6,14 @@ export interface Certification {
export interface Certifications { export interface Certifications {
certifications: { certifications: {
US: Certification[], US: Certification[];
CA: Certification[], CA: Certification[];
DE: Certification[], DE: Certification[];
GB: Certification[], GB: Certification[];
AU: Certification[], AU: Certification[];
BR: Certification[], BR: Certification[];
FR: Certification[], FR: Certification[];
NZ: Certification[], NZ: Certification[];
IN: Certification[], IN: Certification[];
} };
} }

View File

@@ -12,5 +12,5 @@ export interface Collection {
} }
export interface DetailedCollection extends Collection { export interface DetailedCollection extends Collection {
parts: Movie[] parts: Movie[];
} }

View File

@@ -1,4 +1,3 @@
export interface Images { export interface Images {
base_url: string; base_url: string;
secure_base_url: string; secure_base_url: string;
@@ -14,12 +13,11 @@ export interface Configuration {
change_keys: ChangeKeys[]; change_keys: ChangeKeys[];
} }
export const enum BackdropSizes { export const enum BackdropSizes {
W300 = 'w300', W300 = 'w300',
W780 = 'w780', W780 = 'w780',
W1280 = 'w1280', W1280 = 'w1280',
ORIGINAL = 'original' ORIGINAL = 'original',
} }
export const enum LogoSizes { export const enum LogoSizes {
@@ -29,7 +27,7 @@ export const enum LogoSizes {
W185 = 'w185', W185 = 'w185',
W300 = 'w300', W300 = 'w300',
W500 = 'w500', W500 = 'w500',
ORIGINAL = 'original' ORIGINAL = 'original',
} }
export const enum PosterSizes { export const enum PosterSizes {
@@ -39,22 +37,21 @@ export const enum PosterSizes {
W300 = 'w300', W300 = 'w300',
W500 = 'w500', W500 = 'w500',
W780 = 'w780', W780 = 'w780',
ORIGINAL = 'original' ORIGINAL = 'original',
} }
export const enum ProfileSizes { export const enum ProfileSizes {
W45 = 'w45', W45 = 'w45',
W185 = 'w185', W185 = 'w185',
W632 = 'w632', W632 = 'w632',
ORIGINAL = 'original' ORIGINAL = 'original',
} }
export const enum StillSizes { export const enum StillSizes {
W92 = 'w92', W92 = 'w92',
W185 = 'w185', W185 = 'w185',
W300 = 'w300', W300 = 'w300',
ORIGINAL = 'original' ORIGINAL = 'original',
} }
export const enum ChangeKeys { export const enum ChangeKeys {
@@ -110,5 +107,5 @@ export const enum ChangeKeys {
TVRAGE_ID = 'tvrage_id', TVRAGE_ID = 'tvrage_id',
TYPE = 'type', TYPE = 'type',
VIDEO = 'video', VIDEO = 'video',
VIDEOS = 'videos' VIDEOS = 'videos',
} }

View File

@@ -6,7 +6,6 @@ export interface CreditSeason {
season_number?: number; season_number?: number;
} }
export interface Media { export interface Media {
i?: number; i?: number;
name?: string; name?: string;
@@ -87,8 +86,6 @@ export interface ImageCollection {
backdrops: Image[]; backdrops: Image[];
posters: Image[]; posters: Image[];
} }
export interface Video { export interface Video {
id: string; id: string;
iso_639_1: string; iso_639_1: string;

View File

@@ -132,7 +132,6 @@ export interface ContentRatingsResult {
rating: string; rating: string;
} }
export interface Recommendation { export interface Recommendation {
adult: boolean; adult: boolean;
backdrop_path?: any; backdrop_path?: any;
@@ -150,7 +149,6 @@ export interface Recommendation {
vote_count: number; vote_count: number;
} }
export interface Recommendations { export interface Recommendations {
page: number; page: number;
results: Recommendation[]; results: Recommendation[];
@@ -176,7 +174,6 @@ export interface Reviews {
total_results: number; total_results: number;
} }
export interface TranslationData { export interface TranslationData {
title: string; title: string;
overview: string; overview: string;

View File

@@ -1,4 +1,10 @@
import { Genre, Movie, ProductionCompany, ProductionCountry, SpokenLanguage } from './'; import {
Genre,
Movie,
ProductionCompany,
ProductionCountry,
SpokenLanguage,
} from './';
export interface MovieDetails { export interface MovieDetails {
adult: boolean; adult: boolean;
@@ -34,7 +40,7 @@ export enum ReleaseDateType {
'Theatrical', 'Theatrical',
'Digital', 'Digital',
'Physical', 'Physical',
'TV' 'TV',
} }
export interface ReleaseDate { export interface ReleaseDate {
@@ -55,7 +61,6 @@ export interface ReleaseDates {
results: ReleaseDateResult[]; results: ReleaseDateResult[];
} }
export interface SimilarMovies { export interface SimilarMovies {
page: number; page: number;
results: Movie[]; results: Movie[];
@@ -82,7 +87,6 @@ export interface MovieLists {
total_results: number; total_results: number;
} }
export interface MovieChangeItem { export interface MovieChangeItem {
id: string; id: string;
action: string; action: string;
@@ -129,7 +133,6 @@ export interface LatestMovie {
vote_count: number; vote_count: number;
} }
export interface Dates { export interface Dates {
maximum: string; maximum: string;
minimum: string; minimum: string;

View File

@@ -4,5 +4,3 @@ export interface Search<T> {
total_pages: number; total_pages: number;
total_results: number; total_results: number;
} }

View File

@@ -1,4 +1,10 @@
import { Genre, ProductionCompany, ProductionCountry, SpokenLanguage, Crew } from './'; import {
Genre,
ProductionCompany,
ProductionCountry,
SpokenLanguage,
Crew,
} from './';
export interface CreatedBy { export interface CreatedBy {
id: number; id: number;
@@ -73,45 +79,44 @@ export interface TvShowDetails {
} }
export interface GuestStar { export interface GuestStar {
credit_id: string credit_id: string;
order: number order: number;
character: string character: string;
adult: boolean adult: boolean;
gender: number | null gender: number | null;
id: number id: number;
known_for_department: string known_for_department: string;
name: string name: string;
original_name: string original_name: string;
popularity: number popularity: number;
profile_path: string | null profile_path: string | null;
} }
export interface Episode { export interface Episode {
air_date: string air_date: string;
episode_number: number episode_number: number;
crew: Crew[] crew: Crew[];
guest_stars: GuestStar[] guest_stars: GuestStar[];
id: number id: number;
name: string name: string;
overview: string overview: string;
production_code: string production_code: string;
season_number: number season_number: number;
still_path: string still_path: string;
vote_average: number vote_average: number;
vote_count: number vote_count: number;
show_id: number; show_id: number;
runtime: number; runtime: number;
} }
export interface SeasonDetails { export interface SeasonDetails {
air_date: string air_date: string;
episodes: Episode[] episodes: Episode[];
name: string name: string;
overview: string overview: string;
id: number id: number;
poster_path: string | null poster_path: string | null;
season_number: number season_number: number;
} }
export interface TvShowItem { export interface TvShowItem {
@@ -165,7 +170,6 @@ export interface ScreenedTheatrically {
results: ScreenedTheatricallyResult[]; results: ScreenedTheatricallyResult[];
} }
export interface SimilarTvShow { export interface SimilarTvShow {
backdrop_path: string; backdrop_path: string;
first_air_date: string; first_air_date: string;
@@ -218,7 +222,6 @@ export interface LatestTvShows {
vote_count: number; vote_count: number;
} }
export interface OnTheAirResult { export interface OnTheAirResult {
poster_path: string; poster_path: string;
popularity: number; popularity: number;
@@ -242,7 +245,6 @@ export interface OnTheAir {
total_pages: number; total_pages: number;
} }
export interface AiringTodayResult { export interface AiringTodayResult {
poster_path: string; poster_path: string;
popularity: number; popularity: number;
@@ -266,7 +268,6 @@ export interface TvShowsAiringToday {
total_pages: number; total_pages: number;
} }
export interface PopularTvShowResult { export interface PopularTvShowResult {
poster_path: string; poster_path: string;
popularity: number; popularity: number;
@@ -290,7 +291,6 @@ export interface PopularTvShows {
total_pages: number; total_pages: number;
} }
export interface TopRatedTvShowResult { export interface TopRatedTvShowResult {
poster_path: string; poster_path: string;
popularity: number; popularity: number;
@@ -313,5 +313,3 @@ export interface TopRatedTvShows {
total_results: number; total_results: number;
total_pages: number; total_pages: number;
} }

View File

@@ -1,4 +1,3 @@
export interface Flatrate { export interface Flatrate {
display_priority: number; display_priority: number;
logo_path: string; logo_path: string;
@@ -20,7 +19,6 @@ export interface Buy {
provider_name: string; provider_name: string;
} }
export interface WatchLocale { export interface WatchLocale {
AR: { AR: {
link: string; link: string;
@@ -298,5 +296,3 @@ export interface WatchProviders {
id: number; id: number;
results: WatchLocale; results: WatchLocale;
} }

View File

@@ -8,7 +8,12 @@
* @param {string} imagePath raw image path * @param {string} imagePath raw image path
* @param {boolean} svg get svg version if true * @param {boolean} svg get svg version if true
*/ */
export const getFullImagePath = (baseUrl: string, fileSize: string, imagePath: string, svg = false): string => { export const getFullImagePath = (
baseUrl: string,
fileSize: string,
imagePath: string,
svg = false
): string => {
const imagePathArr = imagePath.split('.'); const imagePathArr = imagePath.split('.');
const imageFormat = svg ? 'svg' : imagePathArr[1]; const imageFormat = svg ? 'svg' : imagePathArr[1];