[Logo] Jaikoz and SongKong Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
audio-encoder  XML
Forum Index -> SongKong Questions
Author Message
Tim Blup


[Avatar]

Joined: 31/10/2017 16:37:32
Messages: 4
Offline

Hello,

I have recently bought SongKong and it looks like a very powerfull application to sort out my music collection. My compliments!
I have a question though.
I am trying to get my collection organized into the following format:
AlbumArtist =/AlbumArtist - [Year] Album (Audio Encoder)/Tracknumber - Title
with:
ifnotempty(albumartist,' =/')
+ ifnotempty(albumartist,' - [')
+ (year.length>4 ? year.substring(0,4):year) + '] '
+ ifnotempty(album,' (')
+ ifnotempty(audioencoder,')/')
+ ifnotempty(pad(trackno,2),' - ')
+ title

The example shows: "U2 =/U2 - [1980] Boy (mp3)/02 - Twilight"
There all seems to be okay, but sorting out my music in flac format the result shows: "U2 =/U2 - [1980] Boy (Flac) (FLAC 16 bits)/02 - Twilight"
Where I would have expected "U2 =/U2 - [1980] Boy (Flac)/02 - Twilight"!
Is this a flaw or a feature?
When it is a feature, how can I correct it into the expected (flac) format?

With regards.
paultaylor

Pro
[Avatar]

Joined: 21/08/2006 09:21:27
Messages: 7486
Offline

Hi, that is possibly a bug that is the value returned by the audio header, but not consistent over different audio formats.

But you could get round it by deriving encoder from filename suffix instead

i.e.

Code:
 ifnotempty(albumartist,' =/')
 + ifnotempty(albumartist,' - [')
 + (year.length>4 ? year.substring(0,4):year) + '] '
 + ifnotempty(album,' (')
 + ifnotempty(filename.substring(filename.indexOf('.') + 1, filename.length),')/')
 + ifnotempty(pad(trackno,2),' - ')
 + title 
 

thanks Paul (Administrator)
Tim Blup


[Avatar]

Joined: 31/10/2017 16:37:32
Messages: 4
Offline

Hi Paul,

In SongKong your solution looks good, it shows the example "U2 =/U2 - [1980] Boy (mp3)/02 - Twilight", but using it on:
Cosmic Smokers - [2004] On Another Planet\01 - Part 01.flac
I got:
Cosmic Smokers =\Cosmic Smokers - [2004] On Another Planet (Flac) (01 - Part 01)\01 - Part 01.flac
(not what I am looking for)
Then I changed "filename.indexOf" into "filename.lastIndexOf" the example didn't change, still "U2 =/U2 - [1980] Boy (mp3)/02 - Twilight"
but using it again on:
Cosmic Smokers - [2004] On Another Planet\01 - Part 01.flac
Again I got:
Cosmic Smokers =\Cosmic Smokers - [2004] On Another Planet (Flac) (01 - Part 01)\01 - Part 01.flac

The workaround didn't help that much....
Have you any idea to solve this?
paultaylor

Pro
[Avatar]

Joined: 21/08/2006 09:21:27
Messages: 7486
Offline

Are you sure you are using the amended mask, i cant see what the issue is but it would help if you could run Help:Create Support Files

thanks Paul (Administrator)
Tim Blup


[Avatar]

Joined: 31/10/2017 16:37:32
Messages: 4
Offline

Hi Paul,

I specially downloaded your example album in both flac and mp3 for the check on amended mask.
The result on the origin:
Song changes - E:\SongKong\Corrected_SK\U2 =\U2 - [1980] Boy (2) (01 - I Will Follow)

result:
E:\SongKong\Corrected_SK\U2 =\U2 - [1980] Boy (2) (01 - I Will Follow)\01 - I Will Follow.flac (MusicBrainz & Discogs)

I also ran Help:Create Support Files

with kind regards
paultaylor

Pro
[Avatar]

Joined: 21/08/2006 09:21:27
Messages: 7486
Offline

Sorry for the delay Tim

I have just realized the problem. Although the filename field contains the '.flac' part in the example mask, when actually used the actual filename field doesn't contain the suffix part so that is why you cannot get it.

So the only solution I can think of for now is to filter the value returned by audioencoder field

Code:
 ifnotempty(albumartist,' =/')
 + ifnotempty(albumartist,' - [')
 + (year.length>4 ? year.substring(0,4):year) + '] '
 + ifnotempty(album,' (')
 + ifnotempty(audioencoder.replace('16 bits',''),')/')
 + ifnotempty(pad(trackno,2),' - ')
 + title 
 


You could chain multiple replace functions together to deal with each case.

And I will do a fix for a later release.

thanks Paul (Administrator)
paultaylor

Pro
[Avatar]

Joined: 21/08/2006 09:21:27
Messages: 7486
Offline

So I am looking at this in more detail, now SongKong provides audioencoder and audioformat fields, but apart from Mp3s the values are the same for both !

I am going to modify audioformat to store the generic encoder, the value that you want. In most cases would be synonymous with file suffix (i.e .mp3 - Mp3, .flac - Flac), however since is only a container format .mp4 could store Apple Lossless or AAC, so not always going to be a one-one correspondance, perhaps I need to add audiocontainerformat as well, or something a bit snappier ?

thanks Paul (Administrator)
paultaylor

Pro
[Avatar]

Joined: 21/08/2006 09:21:27
Messages: 7486
Offline

Tim, this is now all done in SongKong 4.13 - http://blog.jthink.net/2017/11/songkong-413-high-definition-release.html

thanks Paul (Administrator)
Tim Blup


[Avatar]

Joined: 31/10/2017 16:37:32
Messages: 4
Offline

Hi Paul,
Before you came up with the new version 4.13 of SongKong, I may have overdone the experiments of tagging masks.
Starting ip SongKong and trying to edit the masks, I don't see the examples anymore. Adding a new mask gives me the constantly the message "Mask is invalid, it must be a valid javascript expression".
My question: How can I uninstall SongKong best to get a new fresh SongKong installed again?
with kind regards.
paultaylor

Pro
[Avatar]

Joined: 21/08/2006 09:21:27
Messages: 7486
Offline

Hi Tim

You just need to delete the songkong.properties file in your user folder (not install folder) then on next start SongKong will copy over a fresh copy. Details of where it is for different operating systems can be found in this blog post - http://blog.jthink.net/2017/07/songkong-another-way-to-install-license.html

thanks Paul (Administrator)
 
Forum Index -> SongKong Questions
Go to:   
Powered by JForum 2.1.6 © JForum Team