Enhanced Title Case Plugin

…and for my first attempt at a plugin.

Enhanced Title Case Plugin (Work in Progress)

What it does:

A new scripting command is added $titlecase.

All Words Not in the List of Exceptions Are Capitalized.

Existing CaPiTaLs are retained and various other rules are applied to text. Use of the new command is the same as $title, $upper, $lower…

$titlecase(%tag%) - $titlecase(text)

This Grammatically Atrocious Text String:

the traveling prayers at the small stadium in the woods near o'reilly forest by the lake feat billy joel and the beatles with the who plus devo and abba mocking PhoolishPhloyd at the US festival in the USA.

Becomes:

The Traveling Prayers at the Small Stadium in the Woods Near O'Reilly Forest by the Lake feat Billy Joel and the Beatles With the Who Plus DEVO and ABBA Mocking PhoolishPhloyd at the US Festival in the USA

To Be Done:

• Figure out how to make the configuration fields each be on a new line.
(Figure out how the Qt UI code stuff works)

        self.titlecase_small_words = QtWidgets.QLineEdit(self.groupBox)
        self.titlecase_small_words.setObjectName('titlecase_small_words')
        self.horizontalLayout.addWidget(self.titlecase_small_words)

• Add in Exception for Artist Intent Titles, ‘The Beatles’, ‘The Who’, ‘Ludwig van Beethoven’, etc.

Things like this will have to do for now:

$replace(%title%,the Beatles,The Beatles)

Use the [Install Plugin] Option to load this one.

6 Likes

Excellent. Proper English like wot I learnt at skool. Though that now makes three different Title Case Plugins to choose from. :smiley: Shows how much this confuses everyone.

With the exceptions list - I assume you started by borrowing the one from the previous plugin?

1 Like

Yes, I know. I would have preferred my first attempt at something to not be just another version of something else…

I just got sick of fixing certain words in certain occurrences.

Three Title Case plugins, but each has a slightly different approach.

A thread on here that contains
$set(title,$replace(%title%,A|An|And|As|At|But|By|En|For|If|In|Of|On|Or|The|To|Via|Vs.,a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|via|vs.)) got me thinking… what if…

One thing lead to another, which brought me to the Python Titlecase add-on:

Couple that with a desire to understand why $mul, $div are limited to non-integers, I had created $mul2 & $div2 that do support floating point values.

“Is that really all there is to adding a script command? No way!”

My whole workflow there was aimed at dealing with all those straggling random leftover tracks that I have no interests at all in the rest of the album release.

I had cobbled together a cross between Load as Non-Album Track and several tagger scripts to do most of the work.

"Hmmm… "

The Remove Specific Release Information plugin is a simple no-frills approach to “It has a list configurable tags” … it’s pretty drop dead straight forward. It was the perfect template. :slight_smile:

Much to my surprise, on my first attempt at running it after changing out “everything” ‘no-release’ to ‘titlecase’ and shoving in that titlecase code it actually worked!

Well then, what about putting this list of ‘SMALL WORDS’ into that field where No Release had the tags you wanted to drop…

I tend to learn things by jumping from ‘A,B,C to H, I, J’ and then going back and figuring out why in between.

1 Like

But this one does the same thing and provides a scripting function instead of applying the change to a fixed number of tags :slight_smile:

And don’t forget Picard’s built-in $title function. Even though this is intentionally more basic. Let’s leave the more complex and more opinionated implementations to plugins :slight_smile:

3 Likes