Closed blackfyre closed 8 months ago
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.
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. |
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. |
Enabled Anonymous File Downloads
The command /usr/bin/mc anonymous set download
was added in the configuration settings, permitting anonymous file downloads.
Updated file URL Generation Across Multiple Components
Changes were made in multiple files (artist.go
, postcard.go
, search/main.go
) that shifted to using url.GenerateFileUrl()
and url.GenerateThumbUrl()
functions for URL generation of images and thumbnails. This provides more consistency and control over how URLs are generated in the system.
Enhanced Database Structure
In migrations/1696479790_add_art_table.go
file, Thumbs
and MaxSize
properties were added to the AssetsConfig
struct. These improvements provide more information about the stored assets and enable more configurability.
Refined URL Generation Function
In the utils/url/main.go
file, changes were made to the GenerateFileUrl()
and GenerateThumbUrl()
functions to return a formatted URL string instead of a full URL, which is more efficient and manageable in handling URLs within the system.
Images are loaded through PB APIs instead of directly from the storage
Also, fixes #71
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Documentation