Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: New component: Text Tools (Read 53539 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

New component: Text Tools

Reply #25
That is actually amazingly useful

Moderation: Removed unnecessary full quote of the preceding post.

New component: Text Tools

Reply #26
just the thing i was looking for.
thanks!

New component: Text Tools

Reply #27
Thanks garbanzo.bean, that was really useful. Now I can copy album information a lot more easily

New component: Text Tools

Reply #28
@ garbanzo.bean small notice,
the second part of this: $if2(%album artist%,%artist%) never gets evaluated,  there is no need for $if.

New component: Text Tools

Reply #29
Slight edit of garbanzo.bean's code:

Code: [Select]
Track Pattern:
%track%. %title%[' ['%track artist%']']

Group header pattern:
$crlf()Artist: %album artist%$crlf()Album: %album%$crlf()Year: %date%$crlf()Quality: $ifequal($strcmp(%codec_profile%,CBR),1,%bitrate% ,)%codec_profile%$crlf()
Eliminates need for group footer pattern. Also removed first $if validation (not necessary).

Sample output:
Code: [Select]
Artist: U2
Album: How To Dismantle An Atomic Bomb
Year: 2004
Quality: VBR V4

01. Vertigo
02. Miracle Drug
03. Sometimes You Can't Make It On Your Own
04. Love And Peace Or Else
05. City Of Blinding Lights
06. All Because Of You
07. A Man And A Woman
08. Crumbs From Your Table
09. One Step Closer
10. Original Of The Species
11. Yahweh
12. Fast Cars

New component: Text Tools

Reply #30
@ thecircusfreak - can you explain why? i put it there because i only add album artist if two or more tracks have different artists. otherwise the tag is empty. if %album artist% is empty, does foobar automatically look for %artist%?

@ Rain - thanks for tidying things up


New component: Text Tools

Reply #32
i use this for copying the content of my entire library (just albums:)

Track List:
Code: [Select]
'['%date%']'%album% // $ifequal($strcmp(%codec_profile%,CBR),1,%bitrate% ,)%codec_profile%

Group Header:
Code: [Select]
%album artist%

This will result in a list like this:
Code: [Select]
Audioslave
[2002]Audioslave // VBR V0
[2005]Out Of Exile // VBR V0
[2006]Revelations // VBR V0

Autechre
[1993]Incunabula // VBR V0
[1994]Amber // VBR V0
[2001]Confield // VBR V0
[2003]Draft 7.30 // VBR V0

Autumn's Grey Solace
[2006]Shades Of Grey // VBR V0

Band Of Horses
[2006]Everything All The Time // VBR V0
[2007]Cease To Begin // VBR V2

New component: Text Tools

Reply #33
Found a strange behaviour:
%list_index% is not treated the same in «Quick Copy Commands» (i.e. presets) and «Advanced...»  when called up from within a playlist. IMO the Advanced settings do better.

New component: Text Tools

Reply #34
Hi Peter,
very useful plugin, thank you.
also thanks to garbanzo.bean & Rain for their code. helpful!

i too would like to see the ability to save advanced queries.

me to :-)

for the quick copy command i'd like to know, if its possible to have all information in one single line (without crlf, space instead).

i mostly copy tracktitles to the clipboard and then want to paste them into a search field of a website in an internet-browser.
that searchfield, of course, needs the search-query in a single line.
so i need to copy the text to notepad, remove the line breaks by hand ...

this might be a "let the user change the separator" feature request if this isnt possible :-)

anybody an idea, on how i could accomplish this?

New component: Text Tools

Reply #35
HI!

If I'm not mistaken this is the only etension for fb2k having reporting capabilities. It would be very useful to extend it for more than one level of grouping, ie. allow one group for global header and it's closing footer (no grouping capabilities), then on lower level a custom header/closing footer for %album artist% / %album% group, and on another level a custom header/closing footer for [%discnumber%] (if present). If discnumber not present, this header/footer wouldnot be inserted. On lovest level individual tracks. Also the closing footer wouldnot have grouping capabilities, ie. it would just close the related header on the same level (if inserted)

So I'd like the global header could contain any user defined text, header on album level could be this:

Artist: %album artist%
Album: %album%
Release date: $if2(%releasedate%,%date%)
Genre: %genre%
Total tracks: %totaltracks%
...

header on Disc level could be

Disc %discnumber%

It would be also very useful to enable on each level define set of grouping tags, ie. enable not to handle all tags used in header text as unique group.

New component: Text Tools

Reply #36
Made some more generic script concerning Codec, Album Artist/Track Artist and Total Disc Info (based on garbanzo.bean's/Rain's code):

Code: [Select]
Group header pattern:

$crlf()%album artist%/%album%$ifgreater(%totaldiscs%,1, - CD %discnumber%,)/%date% '('%codec%[ %codec_profile%$ifequal($strcmp(%codec_profile%,CBR),1, %bitrate% kbps,)]')'$crlf()

Track pattern:

%track%  $if($meta(album artist),%artist%: ,)%title% - %length%

results in:

Code: [Select]
Air/Premiers Symptomes/1999 (MP3 CBR 128 kbps)

01  Modular Mix - 6:00
02  Casanova 70 - 5:54
03  Les Professionnels - 4:33
04  J'Ai Dormi Sous l'Eau - 5:42
05  Le Soleil Est Pres de Moi - 4:52
06  Californie - 2:28
07  Brakes On - 4:23


The Hellacopters/Payin' The Dues/1999 (FLAC)

01  You Are Nothin' - 2:39
02  Like No Other Man - 3:15
03  Looking At Me - 2:04
04  Riot On The Rocks - 1:23
05  Hey! - 3:21
06  Soulseller - 3:13
07  Where The Action Is - 2:41
08  Twist Action - 2:04
09  Colapso Nervioso - 4:04
10  Psyched Out And Furious - 4:14


LTJ Bukem/Progression Sessions 003/2000 (MP3 VBR V2)

01  Control: Control - 8:07
02  Big Bud: Pure - 7:00
03  Big Bud: State Of Mind - 7:03
04  Future Engineers: Time Shift - 6:39
05  Voyager: Apollo - 4:52
06  Second Vision: Italian Job - 6:15
07  Blu Mar Ten: Santur - 6:00
08  Big Bud: Transmission - 7:23
09  Intense: Solar - 7:30
10  Big Bud: Emotionography (Remix) - 6:49
11  Blu Mar Ten: B.R.O. - 7:29


120 Days/120 Days - CD 1/2006 (MP3 VBR V2)

01  Come Out (Come Down, Fade Out, Be Gone) - 8:51
02  Be Mine - 4:15
03  C-Musik - 7:22
04  Sleepwalking - 3:28
05  Get Away - 4:41
06  Keep on Smiling - 5:30
07  Lazy Eyes - 4:40
08  Sleepless Nights #3 - 3:04
09  I've Lost My Vision (Kraut nr1) - 11:26


120 days/120 days - CD 2/2006 (MP3 VBR V2)

01  120 days / Sleepwalking 120 days Remix - 8:00
02  120 days / Come Out, Come Down, Fade Out, Be Gone (T.A.Kaukolampi remix) - 9:33
03  Come Out, Come Down, Fade Out, Be Gone (Reconstructed by Secret Machines) - 6:07
04  120 days / Come Out, Come Down, Fade Out, Be Gone (Mental Overdrive remix) - 9:14


New component: Text Tools

Reply #37
Yes that's right I can do this with Text Tools, but much more I liked the report in following format.
Demonstrate it on a playlist of one 1disc album and one 2disc album.

This is what I get with Text Tools actually:

Code: [Select]
The BEATLES/Rubber Soul (2009 Mono Remaster)/1965 (TAK 4 max)

01. Drive My Car                                                      [2:34]
...
28. Run for Your Life (stereo)                                        [2:22]

The BEATLES/White Album (2009 Mono Remaster) - CD 1/1968 (TAK 4 max)

01. Back In The U.S.S.R.                                              [2:44]
...
17. Julia                                                             [2:54]

The BEATLES/White Album (2009 Mono Remaster) - CD 2/1968 (TAK 4 max)

18. Birthday                                                          [2:43]
...
30. Good Night                                                        [3:13]


And this is what I have asked for in my previous post, ie. more hiarerchic grouping:

Code: [Select]
[size=16px][b]Tracklist:[/b][/size]

[size=14px][b]The BEATLES/Rubber Soul (2009 Mono Remaster)/1965 (TAK 4 max)[/b]

[font=Courier]01. Drive My Car                                                      [2:34]
...
28. Run for Your Life (stereo)                                        [2:22][/font]

[b]The BEATLES/White Album (2009 Mono Remaster)/1968 (TAK 4 max)[/b]

[b]Disc 1:[/b]
[font=Courier]01. Back In The U.S.S.R.                                              [2:44]
...
17. Julia                                                             [2:54][/font]

[b]Disc 2:[/b]
[font=Courier]18. Birthday                                                          [2:43]
...
30. Good Night                                                        [3:13][/font][/size]

New component: Text Tools

Reply #38
^^ jfi my post was NOT a reply to your request

New component: Text Tools

Reply #39
Too bad. Anyone else can fullfill my request?

New component: Text Tools

Reply #40
nice puzzle, here you go (adjust the line breaks to your liking):

Code: [Select]
Group header:
$ifgreater(%totaldiscs%,1,$ifgreater(%discnumber%,1,,$crlf()%album artist%/%album%/%date% '('%codec%[ %codec_profile%$ifequal($strcmp(%codec_profile%,CBR),1, %bitrate% kbps,)]')'$crlf()),$crlf()%album artist%/%album%/%date% '('%codec%[ %codec_profile%$ifequal($strcmp(%codec_profile%,CBR),1, %bitrate% kbps,)]')'$crlf())$ifgreater(%totaldiscs%,1,$crlf()disc %discnumber%,)

gives for a multi disc album:

Code: [Select]
120 Days/120 Days/2006 (MP3 VBR V2)

disc 1
01  Come Out (Come Down, Fade Out, Be Gone) - 8:51
02  Be Mine - 4:15
03  C-Musik - 7:22
04  Sleepwalking - 3:28
05  Get Away - 4:41
06  Keep on Smiling - 5:30
07  Lazy Eyes - 4:40
08  Sleepless Nights #3 - 3:04
09  I've Lost My Vision (Kraut nr1) - 11:26

disc 2
01  120 days / Sleepwalking 120 days Remix - 8:00
02  120 days / Come Out, Come Down, Fade Out, Be Gone (T.A.Kaukolampi remix) - 9:33
03  Come Out, Come Down, Fade Out, Be Gone (Reconstructed by Secret Machines) - 6:07
04  120 days / Come Out, Come Down, Fade Out, Be Gone (Mental Overdrive remix) - 9:14

and for all others the usual output

Code: [Select]
Johnny Cash/American IV: The Man Comes Around/2002 (MP3 VBR V2)

01  The Man Comes Around - 4:27
02  Hurt - 3:39
03  Give My Love To Rose - 3:29
04  Bridge Over Troubled Water - 3:55

 

New component: Text Tools

Reply #41
I'm bumping this thread to see if anyone has a technique for splitting the output into multiple files and saving each file to a unique path.

For example:

I use text tools to create a master file with a basic XML format such as:

<file>
<path>directory path/filename</path>

album info

</file>
...

I would now like to split the info between <file></file> and save each block as the address in <path>

any tips?

New component: Text Tools

Reply #42
I would now like to split the info between <file></file>

Chopping List (don't let the software's name annoy you) is capable of "splitting the content of text files into multiple new files based on a user-provided delimiter."

Quote
and save each block as the address in <path>

Not possible with that software.
This is HA. Not the Jerry Springer Show.

New component: Text Tools

Reply #43
Not possible with that software.


I'm aware it is not directly possible - I'm just wondering if any of the great minds here might have an idea on how to achieve this (win7).

Splitting the file is not so difficult - it is saving the pieces to correct directories that I'm stuck on.

Also the general format is completely flexible - I could write out anything to fit a solution.

Re: New component: Text Tools

Reply #44
Really wish this component would be updated. It's super useful, but it's got some serious bugs and missing features. There was a legacy Text Tools add-on that I've been using for probably 6 years now, went to install it on a new foobar install and found this one instead. I decided to copy over my formatting scripts and found some problems with it.

Bugs/Improvements needed:
  • Advanced settings can't be accessed except from a playlist, not the component settings itself which makes it hard to find initially
  • Inside Advanced settings, you can't paste more than one line at a time. If you try nothing is output.
  • Your advanced settings code can ONLY take up two lines maximum. This means my incredibly involved titleformatting stuff has to be done on one line. Like my code for pasting album info to music forums: Spoiler (click to show/hide)
    Obviously that's completely unreadable. To edit it, I have to have a copy saved in a text editor with line breaks, and then strip them out for editing here.
  • You can't select all in the Advanced Settings
  • It'd be nice if you could actually "Copy" the Advanced Settings output without actually having to open the page. It should be an entry just like Album/Artist/Filename, etc.
  • As a follow up the previous, you ought to be able to store different versions of advanced settings

If the source code for this plugin were available I'd happily update it. But starting from scratch seems a little daunting, especially for such a rarely used plugin.

Re: New component: Text Tools

Reply #45
Bump. Please consider what MordredKLB said, this tool is quite lacking compared to the old foo_utils one.

Re: New component: Text Tools

Reply #46
Would it be possible to copy the text and then send it to the search bar automatically, in facets for instance?
Yes, the avatar it is the cover of «The City» by Vangelis.

Re: New component: Text Tools

Reply #47
Hi Peter, could you read it here?
https://hydrogenaud.io/index.php/topic,117962.msg973844/topicseen.html#new

The substitution of CR/LF has it's weaknesses. Firstly different line ending sequences lead to different count of _s, and secondly backward conversion is ambiguous. I'd appreciate a smarter sequence, or possibility of user-defined sequences.

More generally, I'd appreciate yet more if foobar was able to copy all available info (%metadata% + $info(...)) about selected tracks in some more standardized format, like XML or JSON scheme.