quintodrome/ui/src/album
Deluan Quintão d021289279
fix: enable multi-valued releasetype in smart playlists (#4621)
* fix: prevent infinite loop in Type filter autocomplete

Fixed an infinite loop issue in the album Type filter caused by an inline
arrow function in the optionText prop. The inline function created a new
reference on every render, causing React-Admin's AutocompleteInput to
continuously re-fetch data from the /api/tag endpoint.

The solution extracts the formatting function outside the component scope
as formatReleaseType, ensuring a stable function reference across renders.
This prevents unnecessary re-renders and API calls while maintaining the
humanized display format for release type values.

* fix: enable multi-valued releasetype in smart playlists

Smart playlists can now match all values in multi-valued releasetype tags.
Previously, the albumtype field was mapped to the single-valued mbz_album_type
database field, which only stored the first value from tags like album; soundtrack.
This prevented smart playlists from matching albums with secondary release types
like soundtrack, live, or compilation when tagged by MusicBrainz Picard.

The fix removes the direct database field mapping and allows both albumtype and
releasetype to use the multi-valued tag system. The albumtype field is now an
alias that points to the releasetype tag field, ensuring both query the same
JSON path in the tags column. This maintains backward compatibility with the
documented albumtype field while enabling proper multi-value tag matching.

Added tests to verify both releasetype and albumtype correctly generate
multi-valued tag queries.

Fixes #4616

* fix: resolve albumtype alias for all operators and sorting

Codex correctly identified that the initial fix only worked for Contains/StartsWith/EndsWith operators. The alias resolution was happening too late in the code path.

Fixed by resolving the alias in two places:
1. tagCond.ToSql() - now uses the actual field name (releasetype) in the JSON path
2. Criteria.OrderBy() - now uses the actual field name when building sort expressions

Added tests for Is/IsNot operators and sorting to ensure complete coverage.
2025-10-26 19:36:44 -04:00
..
__snapshots__ fix(ui): update artist link rendering and improve button styles 2025-05-23 17:42:19 -04:00
AlbumActions.jsx fix(ui): skip missing files in bulk operations (#3807) 2025-03-11 20:19:46 -04:00
AlbumDatesField.jsx fix(ui): don't show year "0" 2025-07-15 19:12:25 -04:00
AlbumDatesField.test.jsx fix(ui): don't show year "0" 2025-07-15 19:12:25 -04:00
AlbumDetails.jsx feat(ui): add smooth image transitions to album and artist artwork (#4120) 2025-05-26 08:57:37 -04:00
AlbumDetails.test.jsx fix: restore old date display/sort behaviour (#3862) 2025-03-30 17:06:58 -04:00
AlbumExternalLinks.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
AlbumGridView.jsx feat(ui): add smooth image transitions to album and artist artwork (#4120) 2025-05-26 08:57:37 -04:00
AlbumInfo.jsx feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
AlbumList.jsx fix: enable multi-valued releasetype in smart playlists (#4621) 2025-10-26 19:36:44 -04:00
AlbumListActions.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
albumLists.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
AlbumShow.jsx fix(ui): update titles for radios, shares and show pages (#4128) 2025-05-27 09:01:52 -04:00
AlbumSongs.jsx fix(ui): always order album tracks by disc and track number (fixes #3720) (#3975) 2025-04-17 19:23:53 -04:00
AlbumTableView.jsx feat(ui): add mood column to Album and Song list views (#3925) 2025-04-05 08:23:52 -03:00
index.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
utils.js build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
utils.test.js build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00