Kodi Community Forum

Full Version: Guide to cXX column names in the database?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there some place I could learn the meaning of cXX columns in db? Some are obvious, some not at all.
In the code. For movies you can find it at https://github.com/xbmc/xbmc/blob/master...ase.h#L176. The other video types are covered further down in the same header file. And yes, it's ugly Wink
Cool, thanks. And yes, the cXX idea is... audacious Wink
Shouldn't this be fixed? Code obfuscation is bad.
(2017-06-05, 23:39)nickr Wrote: [ -> ]Shouldn't this be fixed? Code obfuscation is bad.
Not really. It just requires a complete database and interface layer rewrite
(2017-06-05, 23:59)Martijn Wrote: [ -> ]
(2017-06-05, 23:39)nickr Wrote: [ -> ]Shouldn't this be fixed? Code obfuscation is bad.
Not really. It just requires a complete database and interface layer rewrite
which is currently WIP
it has worked for 10 years, allowing multiple redesigns without completely rewriting the db. sorry, i do not agree that it's ugly.
I tend to think that field names should in same way reflect the data within. c01 means nothing.
Its called generalisation - i even tend to say that this is a db pattern
some details:

we use the same structure for all kinds of contents (movies, episodes, shows, mvideos)

in the code we map from these columns directly to struct members, https://github.com/xbmc/xbmc/blob/master...ase.h#L176 and https://github.com/xbmc/xbmc/blob/master...ase.h#L206

this way we can easily read from db directly into the info structs, https://github.com/xbmc/xbmc/blob/master....cpp#L2199
and we can change the contents of a column as we see fit, removing/adding info without rewriting the entire db.

the price is small on the code side, and it grants flexibility and less code. the displayed names in a db viewer is irrelevant compared to the code advantages.
(2017-06-08, 09:15)ironic_monkey Wrote: [ -> ]the displayed names in a db viewer is irrelevant compared to the code advantages.

This would be true if they had never been used by humans.

I see it as old dev fallacy - easier code equals to better code.