1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-20 14:37:43 +01:00

Polish discover page (Actually the pinical of my coding experince so far :3)

This commit is contained in:
Cooper Ransom 2024-04-04 09:38:52 -04:00
parent fd7fb26906
commit a2b39ee288
2 changed files with 10 additions and 13 deletions

View file

@ -2510,7 +2510,7 @@ packages:
/@vitest/snapshot@1.4.0:
resolution: {integrity: sha512-saAFnt5pPIA5qDGxOHxJ/XxhMFKkUSBJmVt5VgDsAqPTX6JP326r5C/c9UuCMPoXNzuudTPsYDZCoJ5ilpqG2A==}
dependencies:
magic-string: 0.30.8
magic-string: 0.30.9
pathe: 1.1.2
pretty-format: 29.7.0
dev: true
@ -4957,8 +4957,8 @@ packages:
sourcemap-codec: 1.4.8
dev: true
/magic-string@0.30.8:
resolution: {integrity: sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==}
/magic-string@0.30.9:
resolution: {integrity: sha512-S1+hd+dIrC8EZqKyT9DstTH/0Z+f76kmmvZnkfQVmOpDEF9iVgdYif3Q/pIWHmCoo59bQVGW0kVL3e2nl+9+Sw==}
engines: {node: '>=12'}
dependencies:
'@jridgewell/sourcemap-codec': 1.4.15
@ -6963,7 +6963,7 @@ packages:
execa: 8.0.1
jsdom: 23.2.0
local-pkg: 0.5.0
magic-string: 0.30.8
magic-string: 0.30.9
pathe: 1.1.2
picocolors: 1.0.0
std-env: 3.7.0
@ -7234,7 +7234,6 @@ packages:
/workbox-google-analytics@7.0.0:
resolution: {integrity: sha512-MEYM1JTn/qiC3DbpvP2BVhyIH+dV/5BjHk756u9VbwuAhu0QHyKscTnisQuz21lfRpOwiS9z4XdqeVAKol0bzg==}
deprecated: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained
dependencies:
workbox-background-sync: 7.0.0
workbox-core: 7.0.0

View file

@ -13,8 +13,6 @@ import { allThemes } from "../../themes/all";
import { get } from "../backend/metadata/tmdb";
import { Icon, Icons } from "../components/Icon";
const pagesToFetch = 3;
// Define the Media type
interface Media {
id: number;
@ -121,8 +119,8 @@ export function Discover() {
[data.genres[i], data.genres[j]] = [data.genres[j], data.genres[i]];
}
// Fetch only the first 4 TV show genres
setTVGenres(data.genres.slice(0, 4));
// Fetch only the first 5 TV show genres
setTVGenres(data.genres.slice(0, 5));
} catch (error) {
console.error("Error fetching TV show genres:", error);
}
@ -359,8 +357,8 @@ export function Discover() {
[data.genres[i], data.genres[j]] = [data.genres[j], data.genres[i]];
}
// Fetch only the first 4 genres
setGenres(data.genres.slice(0, 4));
// Fetch only the first 5 genres
setGenres(data.genres.slice(0, 5));
} catch (error) {
console.error("Error fetching genres:", error);
}
@ -374,8 +372,8 @@ export function Discover() {
const fetchMoviesForGenre = async (genreId: number) => {
try {
const movies: any[] = [];
for (let page = 1; page <= 4; page += 1) {
// Fetch only 4 pages
for (let page = 1; page <= 6; page += 1) {
// Fetch only 6 pages
const data = await get<any>("/discover/movie", {
api_key: conf().TMDB_READ_API_KEY,
with_genres: genreId.toString(),