2008-05-24, 10:14 PM
I'm currently developing the dvbt radio plugin to maintain a 7 day radio EPG in a SQLite DB (that's the easy bit).
The problem I've got is I want to extract the Now/Next info from the DB, i.e., assuming I've got a full 7 days of EPG, as soon as I start the plugin, I can identify the Now/Next playing radio shows without having to scavenge the dvbt stream.
I can get the 'Now' info with the following (example) SQL statement
The start and end times are created usingThis works fine and I can pull all of the Now playing shows into a DataSet.
The problem is getting the Next shows. I get the DataSet to create a DataTableReader and step through the rows. For each row, I then query the DB with the following exampleIn this case, the service_id matches that of the row returned by the DataSet's DataTableReader and the start_time is the end_time of that show. In other words, the Next show is the one that starts at the end_time of a Now playing show (obviously).
The problem is, I don't get any results returned despite the fact that there are shows in the DB which match the service_id and start_time that I'm passing in the SQL statement.
Any ideas?
Cheers,
Brian
The problem I've got is I want to extract the Now/Next info from the DB, i.e., assuming I've got a full 7 days of EPG, as soon as I start the plugin, I can identify the Now/Next playing radio shows without having to scavenge the dvbt stream.
I can get the 'Now' info with the following (example) SQL statement
Code:
SELECT PROGRAMMES.service_id, PROGRAMMES.title, PROGRAMMES.description, PROGRAMMES.start_time, PROGRAMMES.end_time FROM PROGRAMMES WHERE (start_time <= '2008-05-24 22:50:40Z') AND (end_time > '2008-05-24 22:50:40Z')
The start and end times are created using
Code:
DateTime.Now.ToString("u")
The problem is getting the Next shows. I get the DataSet to create a DataTableReader and step through the rows. For each row, I then query the DB with the following example
Code:
SELECT PROGRAMMES.service_id, PROGRAMMES.title, PROGRAMMES.description, PROGRAMMES.start_time, PROGRAMMES.end_time FROM PROGRAMMES WHERE (service_id = '18496') AND (start_time = '2008-05-24 23:00:00Z')
The problem is, I don't get any results returned despite the fact that there are shows in the DB which match the service_id and start_time that I'm passing in the SQL statement.
Any ideas?
Cheers,
Brian