diff --git a/src/components/MovieRow.js b/src/components/MovieRow.js index 00219e19..d8ae3162 100644 --- a/src/components/MovieRow.js +++ b/src/components/MovieRow.js @@ -24,7 +24,6 @@ export function MovieRow(props) { ({props.year})
- {props.source}

Watch {props.type}

diff --git a/src/index.css b/src/index.css index c2586220..615da981 100644 --- a/src/index.css +++ b/src/index.css @@ -22,6 +22,8 @@ --choice: #2E2F37; --choice-hover: #45464D; --choice-active: #45464D; + + --source-headings: #5b5c63; } /* @media (prefers-color-scheme: light) { :root { diff --git a/src/lib/gomostream.js b/src/lib/gomostream.js index 5d8ba77b..9d092827 100644 --- a/src/lib/gomostream.js +++ b/src/lib/gomostream.js @@ -35,7 +35,7 @@ async function findContent(searchTerm, type) { if (results.length > 1) { return { options: results }; } else { - return { options: [ { ...results[0], source: 'gomostream' } ] } + return { options: [ results[0] ] } } } catch (err) { console.error(err); diff --git a/src/views/Search.css b/src/views/Search.css index 0e0a9932..7492e22e 100644 --- a/src/views/Search.css +++ b/src/views/Search.css @@ -40,3 +40,11 @@ .topRightCredits a:hover .arrow { transform: translateY(.1rem) translateX(.2rem); } + +p.source { + text-transform: uppercase; + font-weight: bold; + color: var(--source-headings); + font-size: 0.8em; + margin-top: 2rem; +} diff --git a/src/views/Search.js b/src/views/Search.js index 07765d9e..189bb5ab 100644 --- a/src/views/Search.js +++ b/src/views/Search.js @@ -49,7 +49,7 @@ export function SearchView() { if (type === "movie") { // getStreamUrl(slug, type, source, season, episode) const { url } = await getStreamUrl(slug, type, source); - + if (url === '') { return fail(`Not found: ${title}`) } @@ -128,7 +128,7 @@ export function SearchView() { noWrap={true} selected={type} /> - searchMovie(str, type)} /> + searchMovie(str, type)} /> 0} failed={failed} progress={progress} steps={maxSteps} text={text} /> @@ -136,15 +136,25 @@ export function SearchView() { Whoops, there are a few {type}s like that - {options?.map((v, i) => ( - { - setShowingOptions(false) - getStream(v.title, v.slug, v.type, v.source) - }}/> - ))} + { Object.entries(options.reduce((a, v) => { + if (!a[v.source]) a[v.source] = [] + a[v.source].push(v) + return a; + }, {})).map(v => ( +
+

{v[0]}

+ {v[1].map((v, i) => ( + { + setShowingOptions(false) + getStream(v.title, v.slug, v.type, v.source) + }} /> + ))} +
+ )) + }
- Check it out on GitHub + Check it out on GitHub
)