Skip to main content
Topic: Dynamic data exchange of selection tracks metadata (Read 1109 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Dynamic data exchange of selection tracks metadata

Hi, what I'm missing in foobar is possibility to share complete tracks info in selection (metadata + technical info) for further processing (eg. making reports) in other applications.
There's already limited built-in functionality of selecting all fields in properties dialogue and copying them to clipboard as text, this however copies either only metadata or technical info but not everything. What I'm looking for is capturing or exporting complete description by one command, and rather in more standardized format like XML or JSON than internal; foobar's format.
Is there something to do it so, or could the command be added in future version?

Re: Dynamic data exchange of selection tracks metadata

Reply #1
foo_texttools can do this. You just need to create you own patterns.

Re: Dynamic data exchange of selection tracks metadata

Reply #2
Thanks, that could do the work. But I have made some attempts and notice that multiline fields, e.g. comments, are exported as a dot char (because the output format is 1 line / 1 track). Is there a possibility how to collapse multilines to single line text, having the line breaks encoded to special sequence? Even putting $replace(%comment%,$char(13),'\n') doesn't prevent the dot effect.

Re: Dynamic data exchange of selection tracks metadata

Reply #3
You need to increase the maximum cached length of Comment in LargeFieldsConfig.txt, which will increase the size of the media library database. Line breaks in multiline fields are output as two underscores. You can replace those with anything else, assuming two underscores do not occur in the data.

A disadvantage of the Text Tools method is that you need to list all possible fields, and exotic formats may have more fields.

Re: Dynamic data exchange of selection tracks metadata

Reply #4
Thank ya, so I added fieldBasic=comment and increased basicMetaMax to 1500, the multiline field is still copied as '.' (although the field size is far below 1000).

Re: Dynamic data exchange of selection tracks metadata

Reply #5
So, try to increase it even more.
Code: [Select]
Note, size limit values are in UTF-8 bytes, not characters!
Also, after editing LargeFieldsConfig.txt, don't forget to  restart fb2k and then use "Reload info from files" (or rescan library)

Re: Dynamic data exchange of selection tracks metadata

Reply #6
Also, after editing LargeFieldsConfig.txt, don't forget to  restart fb2k and then use "Reload info from files" (or rescan library)
That was it, comments are now copied. Yet I have a remaining problem:
Line breaks in multiline fields are output as two underscores. You can replace those with anything else, assuming two underscores do not occur in the data.
The Texttools plugin doesn't replace newlines as two but one underscore (possibly because the newlines in tested tag are stored as \x0A and not \x0D\x0A), which already is likely to occur in the multiline text. Can I do something for newlines to be mapped to different, more rare character sequence instead the underscore, eg. spare ASCII control char?
Trying to use expression
Code: [Select]
$replace($replace(%comment%,$char(13),$char(29)),$char(10),$char(28))
which interpolates in title formatting sandbox, but not in Texttools output. Maybe because the plugin substitutes all newlines yet before user's text pattern is interpolated? I need to remap yet before the plugin does.

Re: Dynamic data exchange of selection tracks metadata

Reply #7
Yes, cr-lf characters appear to be forcibly replaced by Foobar. I don't know how to work around this within Text Tools. Strange that Text Tools would do this if one of its advantages over previous methods is a big window with multiline display.

You can insert your script into the "Copy name" function if you don't use it for anything else. ( Advanced -> Display -> Legacy -> Copy command ). I tried a script of 10,000 symbols with newlines and it worked. Newlines are output as is, you can replace them with excape terms yourself. A downside is that your code needs to be all on one line and therefore hard to understand and modify later. Copy name needs to be added to the context menu.

Re: Dynamic data exchange of selection tracks metadata

Reply #8
I see, but I don't want to touch the default. As the TT plugin is made by Peter self, maybe could he add an option how to substitute linebreaks? The underscores substitution introduces other problem, either of CR LF are converted to _. This leads some multiline fields are divided by __ (CR,LF) and some _ (LF) depending of the source from which they were imported to metadata. There's no indice how to know how many underscores mean line break.

Re: Dynamic data exchange of selection tracks metadata

Reply #9
LargeFieldsConfig.txt is not helping to transfer larger tags to clipboard.

I have
basicMetaMax=16384
fieldBasic=comment

But still clipboard gets "."

I measured the size of the field in Notepad++, which shows me size 8095 as UTF-8. Even if the resulting size was twice as large, it wouldnot reach the new threshold 16384 bytes. Is there reason why?

 
SimplePortal 1.0.0 RC1 © 2008-2019