Case & Leading Zero Fixer 1.4.2 (2008-04-15)

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

Moderators: Peke, Gurus

tooone7
Posts: 39
Joined: Tue Jan 04, 2011 7:17 am

Re: Case & Leading Zero Fixer 1.4.2 (2008-04-15)

Post by tooone7 »

tommycrock wrote:
tooone7 wrote:Or perhaps show the SQL you use to do the leading zero checking :)
With a bit of help I'd be happy to try modifying this script.
Hi Tommycrock,
I found a temporary solution if you're interested.

Get the SQLViewerScript created by Bex.

Go to Tools->Scripts->SqlViewer
Then you can paste the following SQL Query in the textfield and click the "Execute DDL/DML Statement" button.

Here's the SQL for changing the SeasonNumber:
UPDATE Songs SET SeasonNumber = "0"||SeasonNumber WHERE (SeasonNumber != "" AND SeasonNumber NOT LIKE "0%" AND SeasonNumber < 10);

And for the EpisodeNumber:
UPDATE Songs SET EpisodeNumber = "0"||EpisodeNumber WHERE (EpisodeNumber != "" AND EpisodeNumber NOT LIKE "0%" AND EpisodeNumber < 10);

It worked for updating my Episode numbers (a few were skipped) but it moslty failed when running it on the Season numbers. I guess it is because it is not a number field but a text field so you cannot check for something "less than 10" (< 10).

I guess you can run the following query:
UPDATE Songs SET EpisodeNumber = "01" WHERE EpisodeNumber = "1";

and repeat that 9 times, each time incrementing the number. So "01" becomes "02" and = "1" becomes "2".

I think I'm going to do that now, it's faster than selecting everythin in the viewer and updating it.

Please make a backup of your database first! :)
Here's a nice script by Trixmoto: Backup
tommycrock
Posts: 215
Joined: Sat May 21, 2011 9:13 am

Re: Case & Leading Zero Fixer 1.4.2 (2008-04-15)

Post by tommycrock »

Thanks for that, although looking at it it's to add a leading zero, I'm wanting to delete them. Got any SQL for that?
tooone7
Posts: 39
Joined: Tue Jan 04, 2011 7:17 am

Re: Case & Leading Zero Fixer 1.4.2 (2008-04-15)

Post by tooone7 »

Will figure something out when I get home. :)
Vyper
Posts: 845
Joined: Tue May 23, 2006 5:53 pm

Re: Case & Leading Zero Fixer 1.4.2 (2008-04-15)

Post by Vyper »

The options for this script allows you to remove the leading zero instead of adding it. Will that do what you want?

I don't have MM4 installed yet so I don't have a way of checking it myself.
Stop Button Freak
tooone7
Posts: 39
Joined: Tue Jan 04, 2011 7:17 am

Re: Case & Leading Zero Fixer 1.4.2 (2008-04-15)

Post by tooone7 »

tommycrock wrote:Thanks for that, although looking at it it's to add a leading zero, I'm wanting to delete them. Got any SQL for that?
Sorry to get back only now.

I have a solution for you! To remove the leading zero you can use the following SQL for SeasonNumber:
UPDATE Songs SET SeasonNumber = replace(SeasonNumber, 0, "") WHERE SeasonNumber = "01" OR SeasonNumber = "02" OR SeasonNumber = "03" OR SeasonNumber = "04" OR SeasonNumber = "05" OR SeasonNumber = "06" OR SeasonNumber = "07" OR SeasonNumber = "08" OR SeasonNumber = "09";

and for EpisodeNumber use:
UPDATE Songs SET EpisodeNumber = replace(EpisodeNumber, 0, "") WHERE EpisodeNumber = "01" OR EpisodeNumber = "02" OR EpisodeNumber = "03" OR EpisodeNumber = "04" OR EpisodeNumber = "05" OR EpisodeNumber = "06" OR EpisodeNumber = "07" OR EpisodeNumber = "08" OR EpisodeNumber = "09;

Thats all i can think off for now.

I hope Bex will update the script soon :D
Last edited by tooone7 on Wed Oct 19, 2011 11:41 am, edited 1 time in total.
tooone7
Posts: 39
Joined: Tue Jan 04, 2011 7:17 am

Re: Case & Leading Zero Fixer 1.4.2 (2008-04-15)

Post by tooone7 »

Vyper wrote:The options for this script allows you to remove the leading zero instead of adding it. Will that do what you want?

I don't have MM4 installed yet so I don't have a way of checking it myself.
Hi Vyper the problem is that me and Tommy want this script to also add/remove leading zeros on Episode and Season numbers for our series and the current version of the script does not yet cater for that. :)
tommycrock
Posts: 215
Joined: Sat May 21, 2011 9:13 am

Re: Case & Leading Zero Fixer 1.4.2 (2008-04-15)

Post by tommycrock »

tooone7 wrote:Sorry to get back only now.
Ditto...
tooone7 wrote:I have a solution for you!
Worked perfectly :D , well almost, little tweak needed, a final " for the episode numbers

Thanks very much
tooone7
Posts: 39
Joined: Tue Jan 04, 2011 7:17 am

Re: Case & Leading Zero Fixer 1.4.2 (2008-04-15)

Post by tooone7 »

tommycrock wrote:Worked perfectly :D , well almost, little tweak needed, a final " for the episode numbers

Thanks very much
Oh i see at the end there was a missing qoute :roll:

No problem glad i could help :)
Harlequin123

Re: Case & Leading Zero Fixer 1.4.2 (2008-04-15)

Post by Harlequin123 »

Any way to get this working in MM 4.x? Doesn't seem to show up in the application anymore.
gpzbc
Posts: 1226
Joined: Sat Sep 13, 2008 12:02 am
Location: Colorado, USA

Re: Case & Leading Zero Fixer 1.4.2 (2008-04-15)

Post by gpzbc »

I know it doesn't help you at all, but it is working for me in MM4.
--
The gpzbc
AnteBios
Posts: 3
Joined: Sun May 29, 2011 6:01 am

Re: Case & Leading Zero Fixer 1.4.2 (2008-04-15)

Post by AnteBios »

Hello,


Bex thank you for this script.

Using MM 3.2.5.1306 however, no changes are made to the filename. I don't find the option to do that. Do I need to do a "auto-organize files" after running your script?


Thanks.
TrueHarlequin124

Re: Case & Leading Zero Fixer 1.4.2 (2008-04-15)

Post by TrueHarlequin124 »

@gpzbc You're right, I see it now. It seems it doesn't show up in the main menu anywhere anymore, just in the right-click context menu.
tommycrock
Posts: 215
Joined: Sat May 21, 2011 9:13 am

Re: Case & Leading Zero Fixer 1.4.2 (2008-04-15)

Post by tommycrock »

AnteBios wrote:no changes are made to the filename. I don't find the option to do that.
I'm using MM4 but it works for me without doing anything else. Do you have filename ticked in Tools-> Options | Library > Case & Leading Zero Fixer?
mlr
Posts: 24
Joined: Sat Jun 14, 2008 7:50 pm
Location: South Africa

Re: Case & Leading Zero Fixer 1.4.2 (2008-04-15)

Post by mlr »

Is there a way to mark “The” not to change to “the” in the following?
Adam and The Ants, Adele & The Raconteurs, Diana Ross & The Supremes…

Nice to Have Request:
1. An Option add the Disc # (1) to Track # (24) making the Track # (124)
2. The ability to Tick the Tracks or\and Columns to be changed…

Besides the q & N2Hs, THANK YOU for this excellent add-on, it took care of about 98% of my tweaking needs.
MediaMonkey Gold-Lifetime user since 2007
System: Windows 7 Ultimate SP 1
Vyper
Posts: 845
Joined: Tue May 23, 2006 5:53 pm

Re: Case & Leading Zero Fixer 1.4.2 (2008-04-15)

Post by Vyper »

mlr wrote:Is there a way to mark “The” not to change to “the” in the following?
Adam and The Ants, Adele & The Raconteurs, Diana Ross & The Supremes…
Tools -> Options -> Case & Leading Zero Fixer ... taking 'the' out of the little words list and putting 'The' in the forced case list should work ...
Stop Button Freak
Post Reply