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

Post a reply

Visual Confirmation

To prevent automated access and spam, you are required to confirm that you are human. Please place a check mark next to all images of monkeys or apes. If you cannot see any images, please contact the Board Administrator.

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Topic review
   

Expand view Topic review: Playlist in Main Window 2.0.0 (2012-08-05)

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

Post by Tikshadow » Sun Oct 07, 2012 9:28 pm

Awesome Script! Thanks!

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

Post by wutzin » Thu Sep 20, 2012 6:56 am

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)

Post by Bex » Wed Aug 15, 2012 8:19 am

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)

Post by Kostarena » Wed Aug 15, 2012 6:55 am

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)

Post by Bex » Wed Aug 15, 2012 6:41 am

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)

Post by Kostarena » Wed Aug 15, 2012 5:26 am

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)

Post by Bex » Wed Aug 15, 2012 2:43 am

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)

Post by Kostarena » Tue Aug 14, 2012 10:55 pm

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)

Post by Bex » Wed Aug 08, 2012 4:54 pm

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)

Post by Kostarena » Wed Aug 08, 2012 9:13 am

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)

Post by Bex » Wed Aug 08, 2012 3:01 am

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)

Post by Kostarena » Tue Aug 07, 2012 7:50 pm

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)

Post by Bex » Tue Aug 07, 2012 3:18 pm

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)

Post by Bex » Tue Aug 07, 2012 2:58 pm

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)

Post by Kostarena » Tue Aug 07, 2012 2:53 pm

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

Top