Skip to content
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

MBS-13217: Fix displaying cover art edits #3001

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yvanzo
Copy link
Contributor

@yvanzo yvanzo commented Aug 7, 2023

Problem MBS-13217

Two glitches were affecting the display of cover art edits.

  1. When a release was merged, the release field was wrongly displayed as not existing anymore.
  2. When a release was merged or deleted, the cover art field was wrongly claimed as not displayable (but for "Add cover art" edits).

Solution

This patch loads two different releases instead, one for release link and the other for cover art image, and sets release MBID/GID if merged.

Work in progress

  • Fix ReorderCoverArt too
  • Test manually displaying

Notes

Adding CI tests is a separate ticket: MBS-11490.

Two glitches were affecting the display of cover art edits.

1. When a release was merged, the release field was wrongly displayed as
   not existing anymore.
2. When a release was merged or deleted, the cover art field was wrongly
   claimed as not displayable (but for "Add cover art" edits).

This patch loads two different releases instead, one for release link
and the other for cover art image, and sets release MBID/GID if merged.
Copy link
Member

@mwiencek mwiencek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still need further testing? The code looks good to me, though I believe it can be simplified by using the MBID in foreign_keys, if I am not mistaken.

name => $self->data->{entity}{name},
# Allow linking to release redirecting to still existing release.
$self->c->model('Release')->get_by_gid($self->data->{entity}{mbid}) ? (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remembered that the foreign_keys method also supports loading entities by MBID, IIRC. So I believe we can just replace the reference to $self->data->{entity}{id} in foreign_keys, and also in the $loaded_release assignment above, to point to the mbid property instead (unless I am missing something).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants