HydrogenAudio

Hosted Forums => foobar2000 => Support - (fb2k) => Topic started by: Anakunda on 2021-07-19 08:32:58

Title: Tags importing => Auto fill values pre-processing
Post by: Anakunda on 2021-07-19 08:32:58
Hi, I'm needing to somehow remap textual input written to tags by import pattern after it's components are assigned to tag names.
Now some of the extracted components are not in final form, for example have newlines mapped to specific sequence and it's necessary to interpolate the text before it's written to assigned tag, by a foobar func, like $replace(...).
For example if the input scheme is %tracknumber%. %artist% - %title% (%comment%), I would need something like
%tracknumber%. %artist% - %title% ($replace(%comment%,$chr(30),$chr(13))), but it apparently doesn't make sense neither it works.

Is there a way to apply the conversion directly into parsing pattern, or perhaps using a different function, or plugin? I've checked masstager which has something similar but again it does work on principle of direct mapping.
Title: Re: Tags importing => Auto fill values pre-processing
Post by: j7n on 2021-07-19 11:17:10
Write the $replace() function in Source: Other. It's $char(). Don't write functions in the pattern, it can only take a series of field names. Output a unique delimiter between parts of the Source: Other that are to become fields to make the Pattern unambiguous. The same can be done in Masstagger using Guess value from other fields, or Format value from other fields one field at a time.
Title: Re: Tags importing => Auto fill values pre-processing
Post by: Anakunda on 2021-07-19 11:29:29
Write the $replace() function in Source: Other. It's $char(). Don't write functions in the pattern

Oh yeah, writing any functions in the pattern makes mess. But what if the source is clipboard, not in metadata. Looks to me like it needs to run in two passes, first raw import then secondly extrapolate/postprocess by whatever of the two methods. That's bearable but would it be possible doing in single step or single saveable batch, eg. in MassTagger? I'm afraid MT doesn't provide clipboard as direct source.
Title: Re: Tags importing => Auto fill values pre-processing
Post by: j7n on 2021-07-19 11:46:27
You should save the data into a temporary field and delete it later.

In Masstagger you can use "Input data" to paste from the clipboard and direct it to a field. Then add more actions to operate on it. And then delete the field. By stacking multiple actions you can create more complex scripts that are still understandable. The temporary field will only exist in memory if it is deleted in the same script. But there isn't much difference compared to deleting it by hand. Most of the time will be spent writing the script, or making sure the clipboard lines match the files.