From 1adfffca8dc419a3af9a48a745d41c4b0e893696 Mon Sep 17 00:00:00 2001 From: Jelle van Snik Date: Thu, 17 Feb 2022 18:36:39 +0100 Subject: [PATCH] rename scrapers to providers --- README.md | 3 ++- src/components/SearchBar.tsx | 2 +- src/components/media/MediaCard.tsx | 2 +- src/components/media/WatchedMediaCard.tsx | 2 +- src/{scrapers => providers}/index.ts | 0 src/{scrapers => providers}/list/theflix/index.ts | 8 ++++---- .../list/theflix/portableToMedia.ts | 2 +- src/{scrapers => providers}/list/theflix/search.ts | 2 +- src/{scrapers => providers}/types.ts | 0 src/{scrapers => providers}/wrapper.ts | 0 src/views/SearchView.tsx | 2 +- 11 files changed, 12 insertions(+), 11 deletions(-) rename src/{scrapers => providers}/index.ts (100%) rename src/{scrapers => providers}/list/theflix/index.ts (82%) rename src/{scrapers => providers}/list/theflix/portableToMedia.ts (94%) rename src/{scrapers => providers}/list/theflix/search.ts (94%) rename src/{scrapers => providers}/types.ts (100%) rename src/{scrapers => providers}/wrapper.ts (100%) diff --git a/README.md b/README.md index b7d790da..3164ca56 100644 --- a/README.md +++ b/README.md @@ -41,5 +41,6 @@ Check out [this project's issues](https://github.com/JamesHawkinss/movie-web/iss - [ ] Add github and discord top right - [ ] Store watched percentage - [ ] Implement movie + series view -- [ ] Add scraper stream method +- [ ] Add provider stream method - [ ] Better looking error boundary +- [ ] sort search results so they aren't sorted by provider diff --git a/src/components/SearchBar.tsx b/src/components/SearchBar.tsx index 4209e33e..5a619733 100644 --- a/src/components/SearchBar.tsx +++ b/src/components/SearchBar.tsx @@ -3,7 +3,7 @@ import { Icons } from "./Icon"; import { TextInputControl } from "./TextInputs/TextInputControl"; import { useState } from "react"; -import { MWMediaType, MWQuery } from "scrapers"; +import { MWMediaType, MWQuery } from "providers"; export interface SearchBarProps { buttonText?: string; diff --git a/src/components/media/MediaCard.tsx b/src/components/media/MediaCard.tsx index b6d90ffa..5c8fcd00 100644 --- a/src/components/media/MediaCard.tsx +++ b/src/components/media/MediaCard.tsx @@ -1,4 +1,4 @@ -import { getProviderFromId, MWMedia, MWMediaType } from "scrapers"; +import { getProviderFromId, MWMedia, MWMediaType } from "providers"; import { Link } from "react-router-dom"; import { Icon, Icons } from "components/Icon"; diff --git a/src/components/media/WatchedMediaCard.tsx b/src/components/media/WatchedMediaCard.tsx index e3019ff7..eaa1de2b 100644 --- a/src/components/media/WatchedMediaCard.tsx +++ b/src/components/media/WatchedMediaCard.tsx @@ -1,4 +1,4 @@ -import { MWMedia } from "scrapers"; +import { MWMedia } from "providers"; import { MediaCard } from "./MediaCard"; export interface WatchedMediaCardProps { diff --git a/src/scrapers/index.ts b/src/providers/index.ts similarity index 100% rename from src/scrapers/index.ts rename to src/providers/index.ts diff --git a/src/scrapers/list/theflix/index.ts b/src/providers/list/theflix/index.ts similarity index 82% rename from src/scrapers/list/theflix/index.ts rename to src/providers/list/theflix/index.ts index b262041e..de226788 100644 --- a/src/scrapers/list/theflix/index.ts +++ b/src/providers/list/theflix/index.ts @@ -3,16 +3,16 @@ import { MWMediaType, MWPortableMedia, MWQuery, -} from "scrapers/types"; +} from "providers/types"; import { searchTheFlix, getDataFromSearch, turnDataIntoMedia, -} from "scrapers/list/theflix/search"; +} from "providers/list/theflix/search"; -import { getDataFromPortableSearch } from "scrapers/list/theflix/portableToMedia"; -import { MWProviderMediaResult } from "scrapers"; +import { getDataFromPortableSearch } from "providers/list/theflix/portableToMedia"; +import { MWProviderMediaResult } from "providers"; export const theFlixScraper: MWMediaProvider = { id: "theflix", diff --git a/src/scrapers/list/theflix/portableToMedia.ts b/src/providers/list/theflix/portableToMedia.ts similarity index 94% rename from src/scrapers/list/theflix/portableToMedia.ts rename to src/providers/list/theflix/portableToMedia.ts index 935332d1..3d919c41 100644 --- a/src/scrapers/list/theflix/portableToMedia.ts +++ b/src/providers/list/theflix/portableToMedia.ts @@ -1,5 +1,5 @@ import { CORS_PROXY_URL } from "mw_constants"; -import { MWMediaType, MWPortableMedia } from "scrapers/types"; +import { MWMediaType, MWPortableMedia } from "providers/types"; const getTheFlixUrl = (media: MWPortableMedia, params?: URLSearchParams) => { if (media.mediaType === MWMediaType.MOVIE) { diff --git a/src/scrapers/list/theflix/search.ts b/src/providers/list/theflix/search.ts similarity index 94% rename from src/scrapers/list/theflix/search.ts rename to src/providers/list/theflix/search.ts index 6754051e..1cd46103 100644 --- a/src/scrapers/list/theflix/search.ts +++ b/src/providers/list/theflix/search.ts @@ -1,5 +1,5 @@ import { CORS_PROXY_URL } from "mw_constants"; -import { MWMediaType, MWProviderMediaResult, MWQuery } from "scrapers"; +import { MWMediaType, MWProviderMediaResult, MWQuery } from "providers"; const getTheFlixUrl = (type: "tv-shows" | "movies", params: URLSearchParams) => `https://theflix.to/${type}/trending?${params}`; diff --git a/src/scrapers/types.ts b/src/providers/types.ts similarity index 100% rename from src/scrapers/types.ts rename to src/providers/types.ts diff --git a/src/scrapers/wrapper.ts b/src/providers/wrapper.ts similarity index 100% rename from src/scrapers/wrapper.ts rename to src/providers/wrapper.ts diff --git a/src/views/SearchView.tsx b/src/views/SearchView.tsx index 5092ef4b..0da9c806 100644 --- a/src/views/SearchView.tsx +++ b/src/views/SearchView.tsx @@ -1,6 +1,6 @@ import { WatchedMediaCard } from "components/media/WatchedMediaCard"; import { SearchBarInput } from "components/SearchBar"; -import { MWMedia, MWMediaType, MWQuery, SearchProviders } from "scrapers"; +import { MWMedia, MWMediaType, MWQuery, SearchProviders } from "providers"; import { useEffect, useState } from "react"; import { ThinContainer } from "components/layout/ThinContainer"; import { SectionHeading } from "components/layout/SectionHeading";