Page 3 of 4

Re: Combine Albums 3.0 - Updated 11/01/2010

Posted: Thu May 12, 2011 11:21 am
by pietzke
I used that script quite a while ago and found it very useful. But since my library was growing I got a question:

Is it possible to convert AbumName (CD1) into AbumName and Disk="CD1" ?
I like to have the CD1 in the Disc# field instead of just the number, what gives a better overviev in gig Track lists with many columns.
Is the script working with MM4?

Thanks
pietzke

Re: Combine Albums 3.0 - Updated 11/01/2010

Posted: Thu May 12, 2011 10:18 pm
by trixmoto
I can't see any reason why this script wouldn't work in MM4, but I haven't explicitly tested it. Please let me know if you have any problems.

You could easily modify the script to add "CD" in front of the disk number if you wanted to.

Re: Combine Albums 3.0 - Updated 11/01/2010

Posted: Fri May 13, 2011 8:56 am
by pietzke
Ok, it seems to work in MM4.
trixmoto wrote:You could easily modify the script to add "CD" in front of the disk number if you wanted to.
Well, good to know that it's easily possible, but actually I haven't got a clue of coding and scripting at all. I had a quick look through the code but I wouldn't really know what to change in there :-?. So if you plan to release another version of the script, maybe you could add that to the whishlist. Would be great to see that implemented. Thanks alot!

Re: Combine Albums 3.0 - Updated 11/01/2010

Posted: Fri May 13, 2011 2:41 pm
by trixmoto
Open the script file in a text editor. Replace line 147...

Code: Select all

itm.DiscNumber = disc
...with...

Code: Select all

itm.DiscNumberStr = "CD"&disc
Then replace line 155...

Code: Select all

itm.DiscNumber = Int(Left(s,1))
...with...

Code: Select all

itm.DiscNumberStr = "CD"&Int(Left(s,1))
That should do it.

Re: Combine Albums 3.0 - Updated 11/01/2010

Posted: Mon May 16, 2011 4:59 pm
by pietzke
Thank you very much, that modification does exactly what I was looking for. Great work, makes me happy :)

Re: Combine Albums 3.0 - Updated 11/01/2010

Posted: Thu Aug 23, 2012 6:30 am
by andig
Hello Trixmoto, hello all,

I've made yet a few more enhancements to the CombineAlbums script in a way that it now supports disc numbers > 9 as well.

As development seems to have slowed down a little I was wondering if it wasn't time to start hosting all the interesting scripts at GitHub. Should anybody be interested- especially Trixmoto- I've started a repository at https://github.com/andig/mediamonkey and would be happy to contribute.

Kind regards,
Andreas

Re: Combine Albums 3.0 - Updated 11/01/2010

Posted: Thu Aug 23, 2012 8:46 am
by trixmoto
If you want to send me the modifications you've made, I'll take a look at adding them into the next version.

Re: Combine Albums 3.0 - Updated 11/01/2010

Posted: Fri Sep 14, 2012 12:11 am
by trixmoto
andig wrote:I've made yet a few more enhancements to the CombineAlbums script in a way that it now supports disc numbers > 9 as well.
I've taken a look at this, and can see that you've also taken out the code that attempts to handle discs as letters as well (A,B,C...) - was that deliberate?

Re: Combine Albums 3.0 - Updated 11/01/2010

Posted: Fri Sep 14, 2012 1:11 am
by andig
No- I probably didn't recognize this.

Kind regards,
Andreas

Re: Combine Albums 3.0 - Updated 11/01/2010

Posted: Fri Sep 14, 2012 4:32 am
by trixmoto
Ok, I'll see if I can combine the two :) Also, you've changed the regular expressions, but these aren't really my strong suit - do you remember what you changed and why?

Re: Combine Albums 3.0 - Updated 11/01/2010

Posted: Sat Sep 15, 2012 6:49 am
by andig
trixmoto wrote:Ok, I'll see if I can combine the two :) Also, you've changed the regular expressions, but these aren't really my strong suit - do you remember what you changed and why?
Honestly they didn't match my local version and I had no clue where those changes came from (looked like artifacts). Feel free to change them back but please check if the matching brackets where moved and different array indexes of the matches are used further on.

Re: Combine Albums 3.0 - Updated 11/01/2010

Posted: Sat Sep 15, 2012 8:34 pm
by trixmoto
Ok, cheers.

Re: Combine Albums 3.1 - Updated 16/09/2012

Posted: Sat Sep 15, 2012 9:51 pm
by trixmoto
New version (3.1) is now available to download from my website. I have fixed disc numbers larger than 9, thanks to andig.

Re: Combine Albums 3.1 - Updated 16/09/2012

Posted: Sun Sep 16, 2012 4:14 am
by andig
Will check asap- thank you!

Re: Combine Albums 3.1 - Updated 16/09/2012

Posted: Sun Oct 14, 2012 4:13 am
by andig
Hi Trixmoto,

unfortunately you're updated 3.1 doesn't seem to contain the necessary changes and gives me errors. Only did a quick check but process1..3 need to look like this:

Code: Select all

' 1. AlbumName (CD 1) -> AlbumName and Track=1##

Sub process1(itm, albumname, disc)
'	msgbox("proc1 "&albumname&" "&disc)
  disc = CInt(disc) * 100

  Do While itm.TrackOrder > 100
    itm.TrackOrder = itm.TrackOrder - 100
  Loop

  itm.AlbumName = albumname
  itm.TrackOrder = disc + itm.TrackOrder
End Sub


' 2. AlbumName (CD 1) -> AlbumName and Disc=1

Sub process2(itm, albumname, disc)
'	msgbox("proc2 "&albumname&" "&disc)
  disc = CInt(Left(disc,Len(disc)-2))

  itm.AlbumName = albumname
  itm.DiscNumber = disc
End Sub


' 3. Track=1## -> Disc=1 and Track=##

Sub process3(itm,c)
  Dim s : s = itm.TrackOrderStr
  If Len(s) > 2 Then
    c = c + 1
    itm.DiscNumber = Int(Left(s,Len(s)-2))
    itm.TrackOrder = Int(Mid(s,2))
  End If
End Sub