blackfyre / wga

Jumping forward ~30 years
https://wga-uat.blackfyre.ninja/
MIT License
117 stars 10 forks source link

Modifying image loading strategy #72

Closed blackfyre closed 8 months ago

blackfyre commented 8 months ago

Images are loaded through PB APIs instead of directly from the storage

Also, fixes #71

Summary by CodeRabbit

coderabbitai[bot] commented 8 months ago

Walkthrough

The changes across multiple files in the codebase revolve around updating the URL generation for images and thumbnails. The GenerateFileUrl and GenerateThumbUrl functions in the url package have been refactored to remove dependencies on external packages and to include a token for authentication. Additionally, the way these functions are called has been adjusted in various handlers, and the data structure for the art table has been updated to include thumbnail sizes and a maximum file size.

Changes

File Path Change Summary
handlers/artist.go Updated image and thumbnail URL generation using modified url.GenerateFileUrl and url.GenerateThumbUrl functions.
handlers/postcard.go Changed url.GenerateFileUrl function calls to pass different arguments for URL generation.
handlers/search/main.go Adjusted JSON-LD content generation with updated URL generation functions.
migrations/.../add_art_table.go Added "Thumbs" field and "MaxSize" to the art table data structure.
utils/url/main.go Refactored GenerateFileUrl and GenerateThumbUrl to remove pocketbase.PocketBase dependency and include a token parameter.

Assessment against linked issues

Objective Addressed Explanation
Local dev images don't show (#71) The changes suggest an update in the way URLs are generated, which could affect how images are served locally. However, without specific information on how the previous URL generation was causing issues, it's unclear if this directly resolves the problem of local dev images not showing.

Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - If you reply to a *review comment* from CodeRabbit, the bot will automatically respond. - To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment - Note: Review comments are made on code diffs or files, not on the PR overview. - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Note: For conversation with the bot, please use the review comments on code diffs or files. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - The JSON schema for the configuration file is available [here](https://coderabbit.ai/integrations/coderabbit-overrides.v2.json). - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json`
what-the-diff[bot] commented 8 months ago

PR Summary