IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How to align track length during nfo export
thetie
post Aug 29 2009, 22:23
Post #1


Member


Group: Full Members
Posts: 5
Joined: 29-August 09
Member No.: 10821
Mp3tag Version: 2.43



Hi, if anyone could help me with this little coding problem Id be extremly greatful...

When exporting to nfo Id like the track length info (%_length%) to be alligned vertically.

Ive been looking into how Dano does this in his nfo code, but i cant figure it out. Dano's script lacks artist info (there is only "track no. - track title - track length"). I really need artist (%artist%) to be included since I have alot of VA albums.

This is the standard code i use: (Currently I always need to manually allign all the %_length% after export...)
CODE
$loop(%_path%)%track%.  %artist% - %title%  %_length%
$loopend()


This is how i want it to look:
CODE
Tracklisting:                                        Time:
01.  Artist A - Track A                              01:00
02.  Artist B - Track B                              02:37
03.  Artist C - Track C                              05:26
04.  Artist D - Track D                              05:31
05.  Artist E - Track E                              02:58
06.  Artist F - Track F                              07:31
07.  Artist G - Track G                              03:30
08.  Artist H - Track H                              07:40

                                           Total: 00:42:31


Thanks for any help! (sorry for my lack of knowledge how to do this)
Go to the top of the page
 
+Quote Post
newser
post Aug 29 2009, 23:03
Post #2


Member


Group: Full Members
Posts: 199
Joined: 30-January 09
Member No.: 8442
Mp3tag Version: 2.48c



Try this:
QUELLTEXT
$loop(%_path%)%track%.  %artist% - %title%$repeat( ,$sub(60,$len(%artist% - %title%)))%_length%
$loopend()



Go to the top of the page
 
+Quote Post
thetie
post Aug 29 2009, 23:18
Post #3


Member


Group: Full Members
Posts: 5
Joined: 29-August 09
Member No.: 10821
Mp3tag Version: 2.43



Ah! Thx a million! biggrin.gif
Go to the top of the page
 
+Quote Post
thetie
post Aug 30 2009, 02:04
Post #4


Member


Group: Full Members
Posts: 5
Joined: 29-August 09
Member No.: 10821
Mp3tag Version: 2.43



Sorry if Im pushing my luck here (please forgive me)...
but is it possible to add a line break when the number of character in %artist% plus %title% reaches the defined placement of %_length%? So that the rest of the track title continues on the next line?

(On second thought that probably would be difficult, both because it would need the the correct spacing on next line as well as track title needs to break at a whole word not just the number of characters that reaches the limit...) Is it possible? :S

CODE
Tracklisting:                                        Time:
01.  Artist A - Track A                              01:00
02.  Artist B - Track B with a Really Really Really  02:37
     Long Track Name
03.  Artist C - Track C                              05:26
Go to the top of the page
 
+Quote Post
newser
post Aug 30 2009, 08:43
Post #5


Member


Group: Full Members
Posts: 199
Joined: 30-January 09
Member No.: 8442
Mp3tag Version: 2.48c



v1:
QUELLTEXT
$loop(%_path%)$num(%track%,2).  $left(%artist% - %title%,60)  $repeat( ,$sub(60,$len($left(%artist% - %title%,60))))
     $mid(%artist% - %title%,61,60)  $repeat( ,$sub(60,$len($mid(%artist% - %title%,61,60))))
$loopend()


v2 (No empty lines):
QUELLTEXT
$loop(%_path%)$loop(%_path%)$num(%track%,2).  $iflonger(%artist% - %title%,60,$left(%artist% - %title%,60)  $repeat( ,$sub(60,$len($left(%artist% - %title%,60))))
     $mid(%artist% - %title%,61,60)  $repeat( ,$sub(60,$len($mid(%artist% - %title%,61,60)))),$left(%artist% - %title%,60)  $repeat( ,$sub(60,$len($left(%artist% - %title%,60)))))
$loopend()
Go to the top of the page
 
+Quote Post
thetie
post Aug 30 2009, 11:45
Post #6


Member


Group: Full Members
Posts: 5
Joined: 29-August 09
Member No.: 10821
Mp3tag Version: 2.43



Wow thank you smile.gif

One problem though, i get non-matching no. of loop/loopends on both versions...

I just cannot get my head around how to close them. Final help? smile.gif
Go to the top of the page
 
+Quote Post
newser
post Aug 30 2009, 13:40
Post #7


Member


Group: Full Members
Posts: 199
Joined: 30-January 09
Member No.: 8442
Mp3tag Version: 2.48c



Sorry. Now it should work.

v1:
QUELLTEXT
$loop(%_path%)$num(%track%,2).  $left(%artist% - %title%,60)  $repeat( ,$sub(60,$len($left(%artist% - %title%,60))))%_length%
     $mid(%artist% - %title%,61,60)  $repeat( ,$sub(60,$len($mid(%artist% - %title%,61,60))))
$loopend()


v2 (No empty lines):
QUELLTEXT
$loop(%_path%)$num(%track%,2).  $iflonger(%artist% - %title%,60,$left(%artist% - %title%,60)  $repeat( ,$sub(60,$len($left(%artist% - %title%,60))))%_length%
     $mid(%artist% - %title%,61,60)  $repeat( ,$sub(60,$len($mid(%artist% - %title%,61,60)))),$left(%artist% - %title%,60)  $repeat( ,$sub(60,$len($left(%artist% - %title%,60))))%_length%)
$loopend()

Go to the top of the page
 
+Quote Post
thetie
post Aug 30 2009, 14:19
Post #8


Member


Group: Full Members
Posts: 5
Joined: 29-August 09
Member No.: 10821
Mp3tag Version: 2.43



Perfect!!! Thank you so much newser! smile.gif smile.gif This will same me so much time in the future! Thank you again!
Go to the top of the page
 
+Quote Post
painorozi
post Nov 23 2010, 00:00
Post #9


Member


Group: Members
Posts: 1
Joined: 22-November 10
Member No.: 13273
Mp3tag Version: v2.47



book.gif book.gif

Thank you so much rolleyes.gif laugh.gif
Go to the top of the page
 
+Quote Post
KrissO
post Dec 10 2015, 01:33
Post #10


Member


Group: Full Members
Posts: 11
Joined: 24-March 10
Member No.: 12134
Mp3tag Version: 2.46a



Replying to an old topic here.

Does anyone know how I can align the %_total_time% with the individual track %_length%'s? That wasn't included in the code above.

And a second question, how can I remove leading zeros from %_length% and %_total_time%?
e.g. 00:05:23 -> 5:23 or 01:19:59 -> 1:19:59
Go to the top of the page
 
+Quote Post
DetlevD
post Dec 10 2015, 18:35
Post #11


Member


Group: Full Members
Posts: 6296
Joined: 26-May 06
From: Wuppertal, Germany, Planet Earth
Member No.: 3194
Mp3tag Version: 2.76



QUOTE (KrissO @ Dec 10 2015, 01:33) *
... how can I remove leading zeros from %_length% and %_total_time%? e.g. 00:05:23 -> 5:23 or 01:19:59 -> 1:19:59

'00:05:23' ==> $trimLeft('00:05:23','0:') ==> '5:23'

'01:19:59' ==> $trimLeft('01:19:59','0:') ==> '1:19:59'


DD.20151210.1835.CET


--------------------
* Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥
Go to the top of the page
 
+Quote Post
DetlevD
post Dec 10 2015, 19:00
Post #12


Member


Group: Full Members
Posts: 6296
Joined: 26-May 06
From: Wuppertal, Germany, Planet Earth
Member No.: 3194
Mp3tag Version: 2.76



QUOTE (KrissO @ Dec 10 2015, 01:33) *
... how I can align the %_total_time% with the individual track %_length%'s? ...
right aligned ...
'-->'$right($repeat($char(32),$len(%_total_time%))%_length%,$len(%_total_time%))'<--'

'-->'$right($repeat($char(32),$len(%_total_time%))%_total_time%,$len(%_total_time%))'<--'


-->   00:01<--
-->00:00:01<--


DD.20151210.1904.CET

This post has been edited by DetlevD: Dec 10 2015, 19:04


--------------------
* Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 26th June 2016 - 20:07