Page 20 of 22

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

Posted: Sun Oct 16, 2011 4:56 am
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

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

Posted: Mon Oct 17, 2011 6:29 am
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?

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

Posted: Mon Oct 17, 2011 9:30 am
by tooone7
Will figure something out when I get home. :)

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

Posted: Tue Oct 18, 2011 5:45 am
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.

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

Posted: Wed Oct 19, 2011 11:28 am
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

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

Posted: Wed Oct 19, 2011 11:30 am
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. :)

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

Posted: Fri Oct 28, 2011 12:42 pm
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

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

Posted: Sat Oct 29, 2011 7:54 am
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 :)

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

Posted: Sat Jan 07, 2012 7:42 pm
by Harlequin123
Any way to get this working in MM 4.x? Doesn't seem to show up in the application anymore.

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

Posted: Sat Jan 07, 2012 10:15 pm
by gpzbc
I know it doesn't help you at all, but it is working for me in MM4.

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

Posted: Sun Jan 08, 2012 7:24 am
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.

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

Posted: Tue Jan 10, 2012 8:09 pm
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.

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

Posted: Mon Jan 16, 2012 7:58 am
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?

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

Posted: Sat May 26, 2012 7:17 am
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.

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

Posted: Sun May 27, 2012 6:52 am
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 ...