-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Mod Search Database #852
base: main
Are you sure you want to change the base?
Conversation
-updates the local on-disk copy of the mod search database -only works in dev -no authentication
-untested -required info is provided during the existing mod api routes -the useDownloadUrl and useModImageUrls hooks use the mod search database info if available, otherwise they use the existing logic to fetch the info from GameBanana
various other minor tweaks
something about pino.transport not being a function
couldn't find 'fs/promises'. it's a server-only module.
…chDatabase add console logs
avoid confusion with nextjs app router
making progress. builds finish now, but the `mod.getAll` tRPC endpoint is taking WAY too long and is causing issues. potentially including the build issues.
only store Maps, and only store the parameters that we use.
- batch the mod prefetches - store a highly trimmed version of the mod search database instead of the full file
contains nextjs bundle analysis
5bdf9bb didn't quite fix the webpack error apparently
-ensure that the `logs` and `cache` directories exist -ensure outdated mod search database isn't used for builds
@ShouvikGhosh2048 Please review when you have a chance. #766 is higher-priority, but do this whenever. |
…axios-1.7.5 Bump axios from 1.7.2 to 1.7.5
scripts/helperFunctions/validateAllDirectories/validateDirectory.ts
Outdated
Show resolved
Hide resolved
scripts/helperFunctions/validateAllDirectories/validateLogDirectory.ts
Outdated
Show resolved
Hide resolved
scripts/helperFunctions/validateAllDirectories/validateCacheDirectory.ts
Outdated
Show resolved
Hide resolved
|
||
const cachedDownloadUrl = contextOrUndefined?.state[gamebananaModId]; | ||
|
||
const [downloadUrl, setDownloadUrl] = useState<string>(cachedDownloadUrl ?? ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this state? We update the context whenever we update the downloadUrl, so couldn't we just use the cachedDownloadUrl?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think we can. I'll take a stab at it once I fix the carousel
}; | ||
|
||
|
||
export const useModImageUrls = ( | ||
{ | ||
gamebananaModId, | ||
screenshotsFromModSearchDatabase, | ||
}: useModImageUrlsProps, | ||
): ModImageUrls => { | ||
const contextOrUndefined = useContext(modImageUrlsContext); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here - we update state and context together, so couldn't we use the context directly and remove the imageUrls state?
src/server/gamebananaMirror/yamlHandlers/utils/getFileSystemPath.ts
Outdated
Show resolved
Hide resolved
src/server/gamebananaMirror/yamlHandlers/modSearchDatabase/modSearchDatabase.ts
Show resolved
Hide resolved
src/server/gamebananaMirror/yamlHandlers/modSearchDatabase/modSearchDatabase.ts
Show resolved
Hide resolved
|
|
Looks like I broke the carousel at some point on this branch (the arrows don't do anything now). I'll fix that and then take a stab at those remaining comments. |
Closes #606.