Page 4 of 5

Re: Playlist in Main Window 2.0.0 (2012-08-05)

Posted: Tue Aug 07, 2012 2:53 pm
by Kostarena
Bex,

Thank you for your answer.

I am however, interested in the "Composer" field (TCOM).

This is not on the table you reference, so it must mean I cannot/should not use the "Composer" field
in Media Monkey with your script ?

I have successfully copied via script (RegEx Find/Replace) all the 'Custom1' fields to
the 'Composer' fields.

The player I'm using "Clementine" has limited choices available, so I had to use the Composer field
since it's emplty.

Regarding breaking MM ????

I'm unfamiliar with breaking MM by using the Composer field as a copy of the Custom1 field.
MM is functioning perfectly... you are probably referencing that I should 'not' change the code
to try and use the 'Composer field' ?

If so, understood not to.

Best Regards,
Kostarena

Re: Playlist in Main Window 2.0.0 (2012-08-05)

Posted: Tue Aug 07, 2012 2:58 pm
by Bex
No you can not use the Composer field for this within this script since it is a field which allows for multiple entries. It would break or even corrupt your database.

Why can't you use another field?

Re: Playlist in Main Window 2.0.0 (2012-08-05)

Posted: Tue Aug 07, 2012 3:18 pm
by Bex
Well, you can't change this script to write to the composer field - that would break/corrupt your database!
The reason for that is that I the script can only write to non-multiple fields.

However, If you use this script e.g. custom1 and then copy the data to the composer field it will work just fine. :)

Re: Playlist in Main Window 2.0.0 (2012-08-05)

Posted: Tue Aug 07, 2012 7:50 pm
by Kostarena
Thanks again Bex,

I'll avoid the Composer field with your script.

By the way... can I make the playlist delimiter anything other than a semi-colon ; ?

Best regards,
Kostarena

Re: Playlist in Main Window 2.0.0 (2012-08-05)

Posted: Wed Aug 08, 2012 3:01 am
by Bex
Yes, Change line 400.
From:

Code: Select all

Function GetSELECTSql(NameOrCount)
  If NameOrCount=1 Then GetSELECTSql="GROUP_CONCAT(tmpPlaylistName,'; ')" 'Name
  If NameOrCount=2 Then GetSELECTSql="COUNT(*)" 'Count
  If NameOrCount=3 Then GetSELECTSql="'('||COUNT(*)||') '||GROUP_CONCAT(tmpPlaylistName,'; ')" 'Both
End Function
To:

Code: Select all

Function GetSELECTSql(NameOrCount)
  If NameOrCount=1 Then GetSELECTSql="GROUP_CONCAT(tmpPlaylistName,'DELIMITER ')" 'Name <----------------
  If NameOrCount=2 Then GetSELECTSql="COUNT(*)" 'Count
  If NameOrCount=3 Then GetSELECTSql="'('||COUNT(*)||') '||GROUP_CONCAT(tmpPlaylistName,'DELIMITER ')" 'Both <----------------------
End Function

Re: Playlist in Main Window 2.0.0 (2012-08-05)

Posted: Wed Aug 08, 2012 9:13 am
by Kostarena
Thanks again Bex.

Your script has saved me many hours of mucking about with having to do this
in a linux bash script for each file..., worrying about commas, punctuation, encodings that
choke filenames/paths. Thank you for enabling me to escape awk/grep/sed hell!

Lastly,
1. Could there be related problems that might occur if I change the delimiter from
a semi-colon to a space ? I'm trying to seperate multiple playlists entries with a space only.

2. Are the playlist entries always going to be sorted alphabetically ?

3. if I've accidentally done this twice, they will appear twice with the same playlist name.
Is it possible to disallow duplicate entries ?

Best Regards,
Kostarena

Re: Playlist in Main Window 2.0.0 (2012-08-05)

Posted: Wed Aug 08, 2012 4:54 pm
by Bex
1. Not from the scripts point of view but if you want to split up the playlists in another program or similar, it can be impossible if your playlists names contan spaces.

2. Yes

3. Not sure what you've done here. The script should definitely not create duplicates, unless a track exists multiple times within a playlist.

Re: Playlist in Main Window 2.0.0 (2012-08-05)

Posted: Tue Aug 14, 2012 10:55 pm
by Kostarena
Hi Bex,

I've copied and pasted the changes exactly at line 400.
I've substituted the DELIMITER with a space.
I've restarted MM and updated the playlists.

No effect.

Could I have done something different ?

Thank you.
Kostarena

Bex wrote:Yes, Change line 400.
From:

Code: Select all

Function GetSELECTSql(NameOrCount)
  If NameOrCount=1 Then GetSELECTSql="GROUP_CONCAT(tmpPlaylistName,'; ')" 'Name
  If NameOrCount=2 Then GetSELECTSql="COUNT(*)" 'Count
  If NameOrCount=3 Then GetSELECTSql="'('||COUNT(*)||') '||GROUP_CONCAT(tmpPlaylistName,'; ')" 'Both
End Function
To:

Code: Select all

Function GetSELECTSql(NameOrCount)
  If NameOrCount=1 Then GetSELECTSql="GROUP_CONCAT(tmpPlaylistName,'DELIMITER ')" 'Name <----------------
  If NameOrCount=2 Then GetSELECTSql="COUNT(*)" 'Count
  If NameOrCount=3 Then GetSELECTSql="'('||COUNT(*)||') '||GROUP_CONCAT(tmpPlaylistName,'DELIMITER ')" 'Both <----------------------
End Function

Re: Playlist in Main Window 2.0.0 (2012-08-05)

Posted: Wed Aug 15, 2012 2:43 am
by Bex
The function should look like this to only get a space as delimiter.

Code: Select all

Function GetSELECTSql(NameOrCount)
  If NameOrCount=1 Then GetSELECTSql="GROUP_CONCAT(tmpPlaylistName,' ')" 'Name
  If NameOrCount=2 Then GetSELECTSql="COUNT(*)" 'Count
  If NameOrCount=3 Then GetSELECTSql="'('||COUNT(*)||') '||GROUP_CONCAT(tmpPlaylistName,' ')" 'Both
End Function
You also need to Activate/Update the script. I.e. press that button in the options

Re: Playlist in Main Window 2.0.0 (2012-08-05)

Posted: Wed Aug 15, 2012 5:26 am
by Kostarena
Thank you Bex.

Is there a way to 'undo' the tags your script has created (COMM) via the
script itself ? It seems once the Custom1 is populated, updating with all
playlists 'checked' doesn't remove all entries from the Custom1 field.

Regards,
Kostarena.

Re: Playlist in Main Window 2.0.0 (2012-08-05)

Posted: Wed Aug 15, 2012 6:41 am
by Bex
Well, if you change which playlists are excluded the script certainly reflect that in the chosen column. The key here though is to press the Activate/Update button. But you are not allowed to exclude all playlists. Btw, did you read the information within the options? (I.e. press the information button.)

Re: Playlist in Main Window 2.0.0 (2012-08-05)

Posted: Wed Aug 15, 2012 6:55 am
by Kostarena
Thank you Bex.

Your script has worked fantastically so far... there hasn't been a need yet
to view the help file. I will take a look.

If I understand your answer above, there is no way to remove entries in
a Custom1 field after your script is activate/updated, and must be done
in MM via another method ?

Take care.

Best regards,
Kostarena

Re: Playlist in Main Window 2.0.0 (2012-08-05)

Posted: Wed Aug 15, 2012 8:19 am
by Bex
Yes, it's all explained in the information including a tip on how to do it faster!

Re: Playlist in Main Window 2.0.0 (2012-08-05)

Posted: Thu Sep 20, 2012 6:56 am
by wutzin
Bex - thanks again for this wonderful script!

I'm reverting to MM3 (runs better in a virtual machine - which is what I have to do since I'm on OSX) and saw that this gem received an update - and that you even included my suggested feature... Wow!

Re: Playlist in Main Window 2.0.0 (2012-08-05)

Posted: Sun Oct 07, 2012 9:28 pm
by Tikshadow
Awesome Script! Thanks!