Add a generalized %unique
#5110
Replies: 1 comment 1 reply
-
@eternaleye : Within 'latest' there is Singleton Disambiguation:
I'd love, however for it to be able to use an autoincrement to make unique paths: |
Beta Was this translation helpful? Give feedback.
-
One thing I've found myself wanting is to be able to conditionally add disambiguators in paths at granularities other than the album or singleton level. I think a generalized
%unique
path format function would be helpful for this; it could work like so:Given
%unique{<keys>,<fields>,<disambiguators>,<brackets>}
, it will resolve to nothing if the values ofkeys
are sufficient to resolve the tuple offields
to a unique value. If not, it will add fields fromdisambiguators
, enclosed inbrackets
, until that condition holds.This is strictly more expressive than the existing
%aunique
and%sunique
functions, as (IIUC) they can be implemented atop it:%aunique{<keys>,<disambiguators>,<brackets>}
=>%unique{<keys>,album_id,<disambiguators> album_id,<brackets>}
%sunique{<keys>,<disambiguators>,<brakcets>}
=>%unique{<keys> album_id singleton,id,<disambiguators> id,<brackets>}
In my particular case, I want to separate distinct artists with a common name, so I want
%unique{albumartist,mb_albumartistid,mb_albumartistid}
in my album paths and%unique{artist,mb_artistid,mb_artistid}
in my singleton paths.I also nest releases under folders for the release group, so I further want my album paths to have:
${original_fulldate} -- $album %unique{albumartist original_fulldate release_group_title,mb_releasegroupid,mb_releasegroupid}
(Given this, it may also be good for
disambiguators
to default tofields
if not present, simplifying the above to%unique{albumartist,mb_albumartistid}
and%unique{artist,mb_artistid}
)Beta Was this translation helpful? Give feedback.
All reactions