IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Track length on search results window?
anil
post Apr 22 2017, 07:08
Post #1


Member


Group: Full Members
Posts: 7
Joined: 29-March 13
Member No.: 17771
Mp3tag Version: 2.54



Hi.
Is it possible to show track length on search results window?
%_length% doesn't work as it does for ParserScriptAlbum part.
I thought I could use arithmetic functions ($add,$div etc) but failed. Hope you can help me.
Go to the top of the page
 
+Quote Post
Florian
post Apr 22 2017, 18:06
Post #2


Developer


Group: Admin
Posts: 8041
Joined: 12-December 01
From: Germany, Dresden
Member No.: 203
Mp3tag Version: 2.84a



Hi anil,

you can output almost anything on the search results window, as long as you put the field name in the [IndexFormat] specification and emit the expected output in the [ParserScriptIndex].

Scripting functions like $add or $div are not supported within the output, so you can only emit what's already available on the resource you're processing.

Kind regards
– Florian


--------------------
♫ If you like using Mp3tag please donate to support further development.

Go to the top of the page
 
+Quote Post
anil
post Apr 22 2017, 22:04
Post #3


Member


Group: Full Members
Posts: 7
Joined: 29-March 13
Member No.: 17771
Mp3tag Version: 2.54



iTunes gives only milliseconds info so I expected %_length% to convert milliseconds to X:XX format. Because %length% doesn't convert it.
Since scripting functions don't work either, i have to wait until that feature is added.
Thank you very much, Florian.
Go to the top of the page
 
+Quote Post
pone
post Jul 26 2017, 01:45
Post #4


Member


Group: Full Members
Posts: 1692
Joined: 15-March 09
From: Germany
Member No.: 9103
Mp3tag Version: 2.59b



ZITAT(anil @ Apr 22 2017, 23:04) *
iTunes gives only milliseconds info so I expected %_length% to convert milliseconds to X:XX format. Because %length% doesn't convert it.
Since scripting functions don't work either, i have to wait until that feature is added.
Thank you very much, Florian.


Just for the fun of it. I had this in a script I wrote for dj sets on soundcloud. The scripts itself isn't working, but the math worked:

QUELLTEXT
# deleting milliseconds
regexpreplace "(timestamp\"):\d{1,3}," "$1:0<<-I->><<-end->>"
regexpreplace "(timestamp\":\d+)\d\d\d," "$1<<-I->><<-end->>"

# splitting seconds
replace "0<<-I->>" "<<-X->>"
replace "1<<-I->>" "<<-X->><<I>>"
replace "2<<-I->>" "<<-X->><<I>><<I>>"
replace "3<<-I->>" "<<-X->><<I>><<I>><<I>>"
replace "4<<-I->>" "<<-X->><<I>><<I>><<I>><<I>>"
replace "5<<-I->>" "<<-X->><<I>><<I>><<I>><<I>><<I>>"
replace "6<<-I->>" "<<-X->><<I>><<I>><<I>><<I>><<I>><<I>>"
replace "7<<-I->>" "<<-X->><<I>><<I>><<I>><<I>><<I>><<I>><<I>>"
replace "8<<-I->>" "<<-X->><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>>"
replace "9<<-I->>" "<<-X->><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>>"

# splitting 10 seconds
replace "0<<-X->>" "<<-C->>"
replace "1<<-X->>" "<<-C->><<X>>"
replace "2<<-X->>" "<<-C->><<X>><<X>>"
replace "3<<-X->>" "<<-C->><<X>><<X>><<X>>"
replace "4<<-X->>" "<<-C->><<X>><<X>><<X>><<X>>"
replace "5<<-X->>" "<<-C->><<X>><<X>><<X>><<X>><<X>>"
replace "6<<-X->>" "<<-C->><<X>><<X>><<X>><<X>><<X>><<X>>"
replace "7<<-X->>" "<<-C->><<X>><<X>><<X>><<X>><<X>><<X>><<X>>"
replace "8<<-X->>" "<<-C->><<X>><<X>><<X>><<X>><<X>><<X>><<X>><<X>>"
replace "9<<-X->>" "<<-C->><<X>><<X>><<X>><<X>><<X>><<X>><<X>><<X>><<X>>"

# splitting 100 seconds
replace "0<<-C->>" "<<-M->>"
replace "1<<-C->>" "<<-M->><<C>>"
replace "2<<-C->>" "<<-M->><<C>><<C>>"
replace "3<<-C->>" "<<-M->><<C>><<C>><<C>>"
replace "4<<-C->>" "<<-M->><<C>><<C>><<C>><<C>>"
replace "5<<-C->>" "<<-M->><<C>><<C>><<C>><<C>><<C>>"
replace "6<<-C->>" "<<-M->><<C>><<C>><<C>><<C>><<C>><<C>>"
replace "7<<-C->>" "<<-M->><<C>><<C>><<C>><<C>><<C>><<C>><<C>>"
replace "8<<-C->>" "<<-M->><<C>><<C>><<C>><<C>><<C>><<C>><<C>><<C>>"
replace "9<<-C->>" "<<-M->><<C>><<C>><<C>><<C>><<C>><<C>><<C>><<C>><<C>>"

# splitting 1000 seconds
replace "0<<-M->>" "<<-XM->>"
replace "1<<-M->>" "<<-XM->><<M>>"
replace "2<<-M->>" "<<-XM->><<M>><<M>>"
replace "3<<-M->>" "<<-XM->><<M>><<M>><<M>>"
replace "4<<-M->>" "<<-XM->><<M>><<M>><<M>><<M>>"
replace "5<<-M->>" "<<-XM->><<M>><<M>><<M>><<M>><<M>>"
replace "6<<-M->>" "<<-XM->><<M>><<M>><<M>><<M>><<M>><<M>>"
replace "7<<-M->>" "<<-XM->><<M>><<M>><<M>><<M>><<M>><<M>><<M>>"
replace "8<<-M->>" "<<-XM->><<M>><<M>><<M>><<M>><<M>><<M>><<M>><<M>>"
replace "9<<-M->>" "<<-XM->><<M>><<M>><<M>><<M>><<M>><<M>><<M>><<M>><<M>>"

# splitting 10000 seconds
replace "0<<-XM->>" ""
replace "1<<-XM->>" "<<XM>>"
replace "2<<-XM->>" "<<XM>><<XM>>"
replace "3<<-XM->>" "<<XM>><<XM>><<XM>>"
replace "4<<-XM->>" "<<XM>><<XM>><<XM>><<XM>>"
replace "5<<-XM->>" "<<XM>><<XM>><<XM>><<XM>><<XM>>"
replace "6<<-XM->>" "<<XM>><<XM>><<XM>><<XM>><<XM>><<XM>>"
replace "7<<-XM->>" "<<XM>><<XM>><<XM>><<XM>><<XM>><<XM>><<XM>>"
replace "8<<-XM->>" "<<XM>><<XM>><<XM>><<XM>><<XM>><<XM>><<XM>><<XM>>"
replace "9<<-XM->>" "<<XM>><<XM>><<XM>><<XM>><<XM>><<XM>><<XM>><<XM>><<XM>>"


replace "<<-I->>" ""
replace "<<-X->>" ""
replace "<<-C->>" ""
replace "<<-M->>" ""
replace "<<-XM->>" ""

# break it down to single seconds
replace "<<XM>>" "<<M>><<M>><<M>><<M>><<M>><<M>><<M>><<M>><<M>><<M>>"
replace "<<M>>" "<<C>><<C>><<C>><<C>><<C>><<C>><<C>><<C>><<C>><<C>>"
replace "<<C>>" "<<X>><<X>><<X>><<X>><<X>><<X>><<X>><<X>><<X>><<X>>"
replace "<<X>>" "<<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>>"

# bundle seconds to minutes and hours
replace "<<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>>" "<<m>>"
replace "<<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>>" "<<h>>"

# adding hours
replace "<<h>><<h>><<h>><<h>><<h>><<h>><<h>><<h>><<h>>" "9:"
replace "<<h>><<h>><<h>><<h>><<h>><<h>><<h>><<h>>" "8:"
replace "<<h>><<h>><<h>><<h>><<h>><<h>><<h>>" "7:"
replace "<<h>><<h>><<h>><<h>><<h>><<h>>" "6:"
replace "<<h>><<h>><<h>><<h>><<h>>" "5:"
replace "<<h>><<h>><<h>><<h>>" "4:"
replace "<<h>><<h>><<h>>" "3:"
replace "<<h>><<h>>" "2:"
replace "<<h>>" "1:"
replace "timestamp\":<<" "timestamp\":0:<<"

# adding ten minutes
replace "<<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>>" "5"
replace "<<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>>" "4"
replace "<<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>>" "3"
replace "<<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>>" "2"
replace "<<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>>" "1"
regexpreplace "(timestamp\":\d):<<" "$1:0<<"

# adding minutes
replace "<<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>>" "9:"
replace "<<m>><<m>><<m>><<m>><<m>><<m>><<m>><<m>>" "8:"
replace "<<m>><<m>><<m>><<m>><<m>><<m>><<m>>" "7:"
replace "<<m>><<m>><<m>><<m>><<m>><<m>>" "6:"
replace "<<m>><<m>><<m>><<m>><<m>>" "5:"
replace "<<m>><<m>><<m>><<m>>" "4:"
replace "<<m>><<m>><<m>>" "3:"
replace "<<m>><<m>>" "2:"
replace "<<m>>" "1:"
regexpreplace "(timestamp\":\d:\d)<<" "$1<<zero>>:<<"
replace "<<zero>>" "0"

# adding ten seconds
replace "<<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>>" "5"
replace "<<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>>" "4"
replace "<<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>>" "3"
replace "<<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>>" "2"
replace "<<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>>" "1"
regexpreplace "(timestamp\":\d:\d\d):<<" "$1:0<<"

# adding seconds
replace "<<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>>" "9"
replace "<<I>><<I>><<I>><<I>><<I>><<I>><<I>><<I>>" "8"
replace "<<I>><<I>><<I>><<I>><<I>><<I>><<I>>" "7"
replace "<<I>><<I>><<I>><<I>><<I>><<I>>" "6"
replace "<<I>><<I>><<I>><<I>><<I>>" "5"
replace "<<I>><<I>><<I>><<I>>" "4"
replace "<<I>><<I>><<I>>" "3"
replace "<<I>><<I>>" "2"
replace "<<I>>" "1"
regexpreplace "(timestamp\":\d:\d\d:\d)<<" "$1<<zero>><<"
replace "<<zero>>" "0"

# delete html tags
regexpreplace "@\\\\u003Ca href=.+?\\\\u003C/a\\\\u003E:" ""
regexpreplace "\\\\u003C.+?\\\\u003E" ""

do
    findinline "timestamp\":" 1 1
    say "["
    sayuntil "<<-end->>"
    say "]  "
    findinline "\"body\":\"" -1 1
    movechar 9
    sayuntil "\",\"timestamp\""
    saynewline
    findinline "\"track_id\":" 1 1
    findinline "}" 1 1
while ",{\"id\":"
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: 20th September 2017 - 04:57