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

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

Kostarena
Posts: 58
Joined: Thu Jun 09, 2011 11:41 am

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

Post 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
Last edited by Kostarena on Tue Aug 07, 2012 2:59 pm, edited 1 time in total.
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

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

Post 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?
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

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

Post 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. :)
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Kostarena
Posts: 58
Joined: Thu Jun 09, 2011 11:41 am

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

Post 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
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

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

Post 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
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Kostarena
Posts: 58
Joined: Thu Jun 09, 2011 11:41 am

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

Post 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
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

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

Post 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.
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Kostarena
Posts: 58
Joined: Thu Jun 09, 2011 11:41 am

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

Post 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
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

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

Post 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
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Kostarena
Posts: 58
Joined: Thu Jun 09, 2011 11:41 am

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

Post 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.
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

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

Post 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.)
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Kostarena
Posts: 58
Joined: Thu Jun 09, 2011 11:41 am

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

Post 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
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

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

Post by Bex »

Yes, it's all explained in the information including a tip on how to do it faster!
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
wutzin
Posts: 72
Joined: Thu Jul 03, 2008 9:18 am

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

Post 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!
Tikshadow

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

Post by Tikshadow »

Awesome Script! Thanks!
Post Reply