Tracklist For Collection Of Many Album


#1

Hello friends,
I want to create a tracklist for the music albums:

My script:

$filename(%_folderpath%Tracklist.txt,utf-8)
$caps2(%artist% - %album%) (%year%) '['$upper(%_extension%)']'

Tracklist:
$loop(%track%)$num(%track%,2) - $caps2(%title%) ...%_length%
$loopend()

But has three problem and I don't know how to resolve them:

  • If %Artist% has two artists in album => export action: Artist 1 & Artist 2
    example: album "Guitare Latine" has 2 artists: Antonio De Lucena, Paco Nula
    Antonio De Lucena & Paco Nula - Guitare Latine (2014) [FLAC]

  • If %Artist% has three or more artists in album => export action: Various Artists
    example: album "Natural Sound" has 4 artists: Giovanni, David Sun, Kong Xiangdong, Motoyuki Kume
    Various Artists - Natural Sound (2018) [FLAC]

  • I want to sort the %Year% in collection of albums like this: minYear - maxYear
    example: Various Artists - Sounds Of The Earth (1996-2018) (40CD) [FLAC]

Can someone help please?
Thanks in advance!


#2

Here is a thread about a script that deals with the range of years:


Perhaps you find something useful.

With respect to the problem of a number of artists becoming various artists: are the artists all stored in the field ARTIST or as a multi-value field ARTIST?
Because: how do you cope with artists like "Earth, Wind & Fire", or (one of my favourites namewise) "Dave Dee, Dozy, Beaky, Mick & Tich" - these are hardly "Various Artists".

Anyway: here is an expression that counts the commas in a field:
"$add($len($regexp(%artist%,'[^,]',)),1)"
So if it adds up to more than 2 you can replace ARTIST with "Various Artists".


#3

Thank you!
This problem solved.

I tried: "$add($len($regexp(%artist%,'[^,]',)),1)"
but failed!

Thanks.


#4

You would have to use it as part of a $IF() statement.


#6

Probably more like
$ifgreater($add($len($regexp(%artist%,'[^,]',)),1),2,Various Artists,%artist%)


#8

So you have
ARTIST: Giovanni
ARTIST: David Sun
ARTIST: Kong Xiangdong
ARTIST: Motoyuki Kume
each in a separate field and not as a comma-separated list?
I think then you have to $meta_sep(ARTIST,, ) instead of %artist%


#9

In my music album, each track has one artist, not comma-separated.


#10

As I said:

See if this works:
$ifgreater($add($len($regexp( $meta_sep(ARTIST,, ),'[^,]',)),1),2,Various Artists, $meta_sep(ARTIST,, ))


#12

I was a little stingy with the apostrophes. Try
$ifgreater($add($len($regexp( $meta_sep(ARTIST,', '),'[^,]',)),1),2,Various Artists, $meta_sep(ARTIST,', '))


#13

I tried, It's still not successful...
Thank you so much for your kind supports!


#14

I don't understand: none of these files has several fields for ARTIST, there is always only one.

Looking at the initial post, I see that you loop by artist although you want to get first the album, then the artist.
And as you have to determine first how many different artists there are in list of files, you would have to loop several times the artist name, increase a counter, store it and then use the result to determine what you use as summary.


#16

Yeah, sorry: I was totally on the wrong trip.
You can cancel everything with $meta_sep() - this works only if you have several artists in a single file, each in a separate field (multi-value field).

So, in the part where you want to get the list of artists or "Various", try this code:
$loop(%artist%,1)$loopend()$put(my_art,%_max_counter%) $ifgreater($get(my_art),2,'Various',$loop(%artist%,1)%artist%, $loopend())


#18

This was a suggestion for you to play with - it should demonstrate if teh count was correct and the IF-condition worked correctly. That is why you saw the 4 (which led to "Various".
You can suppress the output of the counter with $puts() instead of $put().


#21

@ohrenkino:
I've combined your code with some tutorials of others in the forum...
And finally, I got a complete script to resolve all my problems.
Once again, thank you very much!

Here is the my full script and I hope this will be helpful to someone:
Tracklist For Collection Of Many Album

$filename(Tracklist.txt,utf-8)$puts(ListOfArtists,%_max_counter%)$loop(%ARTIST%)$loop(%ALBUM%)$puts(ListOfArtists,$get(ListOfArtists)%ARTIST%', ')$loopend()$loopend()$loop(%ALBUM%)$puts(ListOfArtists,$trim($regexp($get(ListOfArtists),'(?:(?<=,)|(?<=\A)|(?<=^))\s?([^,]),(?=.?(?<=,)\s?\1(?=,|\Z|$))(?#remove dups from comma- or comma+space- delimited list)',),', '))$loopend()$ifgreater($get(ListOfArtists),2,'Various Artists',$loop($get(ListOfArtists),1)$caps($get(ListOfArtists))$loopend())$loop(%_filename_ext%)$puts(ListOfExtension,$get(ListOfExtension)%_extension%', ')$loopend()$loop(%_extension%,1)$puts(ListOfExtension,$trim($regexp($get(ListOfExtension),'(?:(?<=,)|(?<=\A)|(?<=^))\s?([^,]),(?=.?(?<=,)\s?\1(?=,|\Z|$))(?#remove dups from comma- or comma+space- delimited list)',),', '))$loopend()$loop(%album%)$puts(ListOfGenre,$get(ListOfGenre)%genre%', ')$loopend()$loop(%genre%,1)$puts(ListOfGenre,$trim($regexp($get(ListOfGenre),'(?:(?<=,)|(?<=\A)|(?<=^))\s?([^,]),(?=.?(?<=,)\s?\1(?=,|\Z|$))(?#remove dups from comma- or comma+space- delimited list)',),', '))$loopend() $loop(%ALBUM%)$loop(%ALBUM%)$puts(YearMin,$if($or($less(%year%,$get(YearMin)),$less($get(YearMin),1)),%year%,$get(YearMin)))$puts(YearMax,$if($or($grtr(%year%,$get(YearMax)),$less($get(YearMax),1)),%year%,$get(YearMax)))$loopend()$loopend()- Collection ($get(YearMin)-$get(YearMax)$puts(YearMin,9999)$puts(YearMax,1)) $loop($num($regexp(%TRACK%,'^A',),1))$if($eql(1,$num($regexp(%TRACK%,'^A',),1)),$loop(%ALBUM%)$loopend()'('%_max_counter%'CD)',)$loopend() '['$loop($get(ListOfExtension),1)$upper($get(ListOfExtension))$loopend()']'
| $loop($get(ListOfExtension),1)$upper($get(ListOfExtension))$loopend() (Tracks+Cue) | %_total_size% | $loop($get(ListOfGenre),1)$if(%genre%,$caps($get(ListOfGenre))','$char(32)Instrumental,Instrumental)$loopend() | $loop($and($get(YearMin),$get(YearMax)),1)$get(YearMin)-$get(YearMax)$loopend() |

Albums:
$loop(%year%%album%,1)%year%' - '$caps(%artist%)' - '$caps2(%album%) $loop(%DISCNUMBER%,1)$ifgreater($num(%DISCNUMBER%,1),1,'('$num(%DISCNUMBER%,1)'CD)'$char(32),)$loopend()'['$upper(%_extension%)']'
$loopend()
Tracklist:
$loop(%year%%album%,1)%year%' - '$caps2(%album%)' | '$upper(%_extension%)' | '%_total_time%' |'$ifgreater($if2(%DISCTOTAL%,$cutLeft(%DISCNUMBER%,$strchr(%DISCNUMBER%,/))),1,
$loop(%DISCNUMBER%,1)'DISC '$num(%DISCNUMBER%,1)$char(13)$char(10)$loop(%track%)$num(%track%,2)' - '$caps(%artist%)' - '$caps2(%title%)' ...'%_length%
$loopend()$loopend(),
$loop(%track%)$num(%track%,2)' - '$caps(%artist%)' - '$caps2(%title%)' ...'%_length%
$loopend())
$loopend()'---------------'
'Total playing time: '%_total_time%
'Total size of '%_total_files% 'files: '%_total_size%

Example (All below information are complete automatically when export to tracklist):

Various Artists - Collection (2007-2014) (4CD) [FLAC, WAV]
| FLAC, WAV (Tracks+Cue) | 997.14 MB | Smooth Jazz, Easy Listening, Instrumental | 2007-2014 |

Albums:
2007 - Montgomery Smith - Dinner Music Vol. 1 & 2 (2CD) [FLAC]
2008 - Montgomery Smith - Careless Whisper [FLAC]
2014 - Antonio De Lucena - Alma De Guitarra [WAV]
 
Tracklist:
2007 - Dinner Music Vol. 1 & 2 | FLAC | 01:48:40 |
DISC 1
01 - Montgomery Smith - Killing Me Softly ...04:52
02 - Montgomery Smith - I'll Be There ...04:43
03 - Montgomery Smith - Let's Stay Together ...04:51
04 - Montgomery Smith - I'll Make Love To You ...04:44
05 - Montgomery Smith - For Your Love ...05:08
06 - Montgomery Smith - The First Time Ever I Saw Your Face ...04:47
07 - Montgomery Smith - How Deep Is Your Love? ...04:29
08 - Montgomery Smith - Endless Love ...05:35
09 - Montgomery Smith - Right Here Waiting ...04:28
10 - Montgomery Smith - Cherish ...04:46
11 - Montgomery Smith - The Lady In Red ...05:05
12 - Montgomery Smith - You Are So Beautiful ...03:53
DISC 2
01 - Montgomery Smith & Glendon Smith - Wonderful Tonight ...04:29
02 - Montgomery Smith & Glendon Smith - Because You Loved Me ...04:32
03 - Montgomery Smith & Glendon Smith - Love Will Keep Us Alive ...04:57
04 - Montgomery Smith & Glendon Smith - Have I Told You Lately ...04:28
05 - Montgomery Smith & Glendon Smith - Unbreak My Heart ...05:31
06 - Montgomery Smith & Glendon Smith - Whiter Shade Of Pale ...05:11
07 - Montgomery Smith & Glendon Smith - Crazy ...04:52
08 - Montgomery Smith & Glendon Smith - We're All Alone ...04:11
10 - Montgomery Smith & Glendon Smith - Suddenly ...04:53
11 - Montgomery Smith & Glendon Smith - You Don't Bring Me Flowers ...03:26
12 - Montgomery Smith & Glendon Smith - At Seventeen ...04:49

2008 - Careless Whisper | FLAC | 01:01:53 |
01 - Montgomery Smith - Crazy Love ...04:08
02 - Montgomery Smith - Do That To Me One More Time ...04:06
03 - Montgomery Smith - The Flame ...04:35
04 - Montgomery Smith - Careless Whisper ...04:53
05 - Montgomery Smith - Oh Girl ...04:33
06 - Montgomery Smith - Sailing ...04:34
07 - Montgomery Smith - How Am I Supposed To Live Without You ...04:23
08 - Montgomery Smith - Your Love Is King ...04:18
09 - Montgomery Smith - Caught Up In The Rapture ...04:59
10 - Montgomery Smith - The Power Of Love ...04:41
11 - Montgomery Smith - All I Need ...03:41
12 - Montgomery Smith - Saving All My Love For You ...03:59
13 - Montgomery Smith - I Don't Have The Heart ...04:45
14 - Montgomery Smith - The Only One For Me ...04:18

2014 - Alma De Guitarra | WAV | 00:11:40 |
01 - Antonio De Lucena - Entre Dos Aguas ...05:55
11 - Sergi Vicente - Al-Andalus ...02:30
33 - Paco Nula - Y Viva España ...03:15

--------------- 
Total playing time: 03:02:13
Total size of 40 files: 997.14 MB