fetzerch/xbmc-pvr-addons — pull request #126 by fetzerch (2013-07-28 13:40:12+00:00)
Title: Improve channel loading performance 

In the current code, it is necessary to trigger one SQL query for every channel in order to get the is_audio_service flag (cmyth_mysql_isradio).

This PR removes the function cmyth_mysql_isradio and queries the is_audio_service flag directly in cmyth_mysql_get_chanlist. The flag is stored in the field radio within cmyth_channel and can be accessed by cmyth_channel_radio.

This reduces drastically the number of SQL queries and improves performance especially for users with a huge amount of channels.

I've quickly tested this with 58 channels. Before this change, the loading takes 770ms; with this patch, it takes only 340ms (less than half).

@janbar: Can you have a look at this and especially at the SQL query?