Commit 53448e46 authored by Max Kellermann's avatar Max Kellermann

tag/Fallback: add tag fallbacks for AlbumArtistSort, ArtistSort

Just like AlbumArtist falls back to Artist, AlbumArtistSort should fall back tom AlbumArtist, ArtistSort and finally Artist. Closes #355
parent 21adc787
ver 0.20.22 (not yet released)
* protocol
- add tag fallbacks for AlbumArtistSort, ArtistSort
* storage
- curl: URL-encode paths
* Android
......
......@@ -26,8 +26,18 @@ template<typename F>
bool
ApplyTagFallback(TagType type, F &&f) noexcept
{
if (type == TAG_ALBUM_ARTIST)
/* fall back to "Artist" if no "AlbumArtist" was found */
if (type == TAG_ALBUM_ARTIST_SORT) {
/* fall back to "AlbumArtist", "ArtistSort" and
"Artist" if no "AlbumArtistSort" was found */
if (f(TAG_ALBUM_ARTIST))
return true;
return ApplyTagFallback(TAG_ARTIST_SORT, std::forward<F>(f));
}
if (type == TAG_ALBUM_ARTIST || type == TAG_ARTIST_SORT)
/* fall back to "Artist" if no
"AlbumArtist"/"ArtistSort" was found */
return f(TAG_ARTIST);
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment