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
This commit is contained in:
parent
21adc78713
commit
53448e4633
2
NEWS
2
NEWS
|
@ -1,4 +1,6 @@
|
||||||
ver 0.20.22 (not yet released)
|
ver 0.20.22 (not yet released)
|
||||||
|
* protocol
|
||||||
|
- add tag fallbacks for AlbumArtistSort, ArtistSort
|
||||||
* storage
|
* storage
|
||||||
- curl: URL-encode paths
|
- curl: URL-encode paths
|
||||||
* Android
|
* Android
|
||||||
|
|
|
@ -26,8 +26,18 @@ template<typename F>
|
||||||
bool
|
bool
|
||||||
ApplyTagFallback(TagType type, F &&f) noexcept
|
ApplyTagFallback(TagType type, F &&f) noexcept
|
||||||
{
|
{
|
||||||
if (type == TAG_ALBUM_ARTIST)
|
if (type == TAG_ALBUM_ARTIST_SORT) {
|
||||||
/* fall back to "Artist" if no "AlbumArtist" was found */
|
/* 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 f(TAG_ARTIST);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue