[mythtv] [patch] MythGame improvements

Barney Barumba b004908 at bsxl.com
Sat Apr 9 13:51:13 UTC 2005


Barney Barumba wrote:

> Kristian Kalweit wrote:
>
>> Kristian Kalweit schrieb:
>>
>>> Barney Barumba schrieb:
>>>
>>>>
>>>> Strange! What do you have set up for your levels? I currently have 
>>>> "system genre gamename" for all games and just "gamename" for 
>>>> favourites, although I tried quite a few other combinations as well.
>>>>
>> I found the problem. I made recently a new scan of my mame games 
>> (after the patch and there were also some changes in cvs). This 
>> resulting in bad data in the genre field of table gamemetadata. 
>> Something must be changed in the scan for games code, because the 
>> genre field was filled with whitespaces after the scan. So the query 
>> from getFillSQL in gametree.cpp got no results, if genre was in where 
>> clause.
>>
>> So, yesterday I changed the setGenre method in rominfo.h:
>>
>> genre = lgenre.stripWhiteSpace();
>>
>> After this I made a new scan and now it works. :-) Maybe it is 
>> recommed to trim also the other metadata fields.
>>
>> Kristian.
>> _______________________________________________
>> mythtv-dev mailing list
>> mythtv-dev at mythtv.org
>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>
>
> Hi Kristian,
>
> Thanks heaps for checking this out - really appreciated!
>
> The quick fix for this appears to be fix up the game tree code to 
> strip the search variables, and then use "trim(...)" in the getFillSQL 
> code. Not very neat, but easy as the changes are all within gametree.cpp.
>
> The proper fix would seem to be fixing up the scan for games code to 
> strip the whitespace on loading, along with a conversion script to 
> trim all whitespace currently in the database.
>
> I'll have a look this weekend, and definitely do the quick option, and 
> hopefully do the full fix as well.
>
> Thanks again,
>
> Barney
>
>
Ok, here is a new patch that includes the quick fix outlined above. If 
we can get this into 0.18 then I'll have a look at the correct method 
next week.

Just out of interest, what version of mysql are you running? Looking at 
the doco, it seems only the latest beta actually stores trailing 
whitespace for varchar fields, which is probably why I never got the error.

To help it get in, here's a quick description for the changelog:

Changed the way favourites are processed in mythgame. Game tree now has 
two top level nodes - "All Games" and "Favourites" - each with it's own 
level configuration option. This allows swapping between the favourites 
tree and the main tree without having to jump all the way out to the 
settings pages.

Thanks again for your help,

Barney


-------------- next part --------------
A non-text attachment was scrubbed...
Name: mythgame.diff.gz
Type: application/x-gzip
Size: 6257 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20050409/be42dc24/mythgame.diff.bin


More information about the mythtv-dev mailing list