Kodi Community Forum

Full Version: Max length of Album Names
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Here comes trouble. Big Grin  I am re-ripping my CDs (EAC) and using Picard to TAG them all to perfection.  Scanning covers for local artwork for my own CDs.  Sticking to Musicbrainz, whilst also updating the site as I go along to better identify my specific releases.

This is causing a few oddities to appear.  And I can see a few items that don't fit KODI as well as they could.

Easy one first - what is the max length of an album name?  And what happens when that name breaks the lengths?

Here is an example from my shelf

https://musicbrainz.org/release/7eb39200...c7c96049a6

The Boy Bands Have Won, and All the Copyists and the Tribute Bands and the TV Talent Show Producers Have Won, If We Allow Our Culture to Be Shaped by Mimicry, Whether from Lack of Ideas or From Exaggerated Respect. You Should Never Try to Freeze Culture. What You Can Do Is Recycle That Culture. Take Your Older Brother's Hand-Me-Down Jacket and Re-Style It, Re-Fashion It to the Point Where It Becomes Your Own. But Don't Just Regurgitate Creative History, or Hold Art and Music and Literature as Fixed, Untouchable and Kept Under Glass. The People Who Try to 'Guard' Any Particular Form of Music Are, Like the Copyists and Manufactured Bands, Doing It the Worst Disservice, Because the Only Thing That You Can Do to Music That Will Damage It Is Not Change It, Not Make It Your Own. Because Then It Dies, Then It's Over, Then It's Done, and the Boy Bands Have Won.


Yeah, that really is the official name of the album.  They broke a record for it.

Ideally I want to leave this in my tag as it is "correct".  Just curious how it then gets handled in the rest of KODI.
Don't think there is a maximum, and from a quick check with a fake song tagged with that title what kodi does is when item is not selected it will just display the beginning of however many characters that fits the relevant part in the GUI, then when item is selected it Kodi scrolls through the full title.
(2017-12-07, 17:29)jjd-uk Wrote: [ -> ]Don't think there is a maximum, and from a quick check with a fake song tagged with that title what kodi does is when item is not selected it will just display the beginning of however many characters that fits the relevant part in the GUI, then when item is selected it Kodi scrolls through the full title.
 Haha - clever KODI.  I will now go and scan those albums in to KODI and see how she behaves.

Just thought I'd mention it as I am a good one for causing "edge cases" in testing.  I didn't want to see smoke coming out of KODI when I added that album.
Perfect.  Now added to KODI.  I am using the Metropolis skin at the current time.  That means the title is on the top of the screen when looking at an album.

This title takes 5 minutes and 30 seconds to scroll past.  Big Grin
Well that is an edge case if ever there was one Smile

The album table allows for 256 char title. This is historic and IIRC helps MySQL with indexing, but many other (non indexed) text fields are unlimited. I was going to say that is the DB limit, but I don't know what skins will do with such a long title, however I see you have already discovered.
Its great when titles like this just go to show that there is some good solid thought in how KODI is built.  So it's not just held together by sticky plaster and gaffa tape. Wink

To be honest, I was expecting truncation.  So when I saw the title starting to scroll!!  Brilliant.  Big Grin

156 words, or 865 characters.

On the hard disk the folder is using the short version of the album name as Windows would have a seizure if it saw that in a file name.  (Especially as there are also single quotes in there for that extra curve ball)


Now I need to go find that album released by Little Bobby Tables and check that works as well....
Image
(2017-12-07, 19:15)BatterPudding Wrote: [ -> ]156 words, or 865 characters.
Hummm.... Using a local SQLite DB? I'm not sure MySQL would be so happy.

The column in the album table is defined as varchar(256), but SQLite treats that as TEXT (so any length, grows to fit). I am not so sure about MySQL, at very least it would probably reject another album with the same first 256 chars. Sticky tape showing a little now? Smile
Yep - still a stand alone PC here with SQLite DB.

So this now scuppers a plan to move to a centralized MySQL.  Central database or comically long album names....

And by the sounds of it, KODI is not the one with the failing.  It's the database that can't keep up.

KODI clearly has a better source of Gaffa tape.
As far as skinning, I think Kodi stores byte-strings of UTF-8 encoded text but has to decode that into "unicode" or wchar_t strings for sorting and the like.  Skins just specify a label width with optional scrolling, and Kodi truncates the rendered text (in specified font dimensions) as needed to fit in the skin width (with ... when scrolling is off).  Alternative is textbox where Kodi will assemble long strings into justified lines of text to fit the textbox width dimension (again with scrolling possible).

There's a slight wrinkle where Kodi has something called the "label2" for a listitem, intended to be rendered right-justified in a label control.  I have often seen in Estuary where that right "label2" is long and overwrites the left justified "label".

scott s.
.