-
Notifications
You must be signed in to change notification settings - Fork 212
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
Combine VAudioDetails
and VImageDetails
into VMediaDetails
component
#2846
Conversation
Size Change: +1.44 kB (0%) Total Size: 880 kB
ℹ️ View Unchanged
|
45d6b80
to
cbe8fa3
Compare
VAudioDetails
and VImageDetails
into VMediaDetails
component
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.
I'm all for merging as many components into one as possible so I support this PR.
I have some non-blocking suggestions and a request to add some stories for the new VMetadata.vue
component.
return [...uniqueFormats].join(", ") | ||
} | ||
|
||
export const getMediaMetadata = ( |
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.
If this function is branched over image and audio it might be clearer if it called one of two separate functions depending on the media type.
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.
I've just converted what we were doing in the VAudioDetails
and VImageDetails
components to a util function here. It's improved (and synced between image and audio metadata) in the follow-up PR.
7d98bf7
to
9042719
Compare
Full-stack documentation: https://docs.openverse.org/_preview/2846 Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again. You can check the GitHub pages deployment action list to see the current status of the deployments. |
Based on the medium urgency of this PR, the following reviewers are being gently reminded to review this PR: @AetherUnbound Excluding weekend1 days, this PR was ready for review 4 day(s) ago. PRs labelled with medium urgency are expected to be reviewed within 4 weekday(s)2. @obulat, if this PR is not ready for a review, please draft it to prevent reviewers from getting further unnecessary pings. Footnotes
|
11d8e17
to
75b9bb5
Compare
75b9bb5
to
29744f6
Compare
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.
Looks good to me, and the pages render as I would expect them to! Just one note about language for an attribute, but nothing to block a merge.
type: Object as PropType<AudioDetail | ImageDetail>, | ||
required: true, | ||
}, | ||
imageWidth: { |
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.
image
here makes me think that this might be specific to image media, although I know that the album art is likely used here for audio records. Does maybe previewWidth
or mediaWidth
make more sense, to make this as generic as possible? Or should we stick with the image
prefix?
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.
It's actually the property that's specific for the images. All of the audio thumbnails are square. Some images, on the other hand, don't have the values for width, height and image type in the API result. So, we send a head request to the provider, and update these values before displaying them. This is why the values are set separately here.
Fixes
Related to #2731 by @fcoveram
Description
To make the updates to the metadata section of the single result page easier, this PR replaces the separate
VAudioDetails
andVImageDetails
components with a singleVMediaDetails
component. The metadata (source, provider, dimensions for images and sample rates etc for audio) are prepared in a new utility function inmetadata.ts
. This function creates a list of the title i18n keys, values and urls (if available) for the media metadata such as source/creator/file size/file format etc.This PR also moves the tag filtering (to filter out empty tags) from the components to the
decodeMediaData
function that prepares each media item from the API response to be displayed on the frontend.Some changes to the
metadata.ts
andVMetadata
in this PR will be improved on in #2851. Here, the effort was made to extract the components without affecting the snapshots, as much as possibleTesting Instructions
Run the app and see that the single result metadata looks correct, and works both on the audio and image pages.
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin