2012-10-08, 07:02 PM
Where the would that go? I've never used user-defined functions in SQLite. I also wonder if it's possible using the ADO.NET layer I'm using.
|
2012-10-08, 07:02 PM
Where the would that go? I've never used user-defined functions in SQLite. I also wonder if it's possible using the ADO.NET layer I'm using.
2012-10-08, 07:06 PM
I have that as as standalone class as is. To test it I used
Code: SQLiteConnection conn = new SQLiteConnection("URI=file:"+DataDirectory + "npvr.db3");
conn.Open();
SQLiteCommand selectCommand = new SQLiteCommand();
selectCommand.Connection = conn;
selectCommand.CommandText = "select SubTitle(event_details) as subtitle from scheduled_recording";
Debug.WriteLine(selectCommand.CommandText);
SQLiteDataReader selectReader = selectCommand.ExecuteReader();
Debug.WriteLine(selectReader.HasRows);
while (selectReader.Read())
{
Debug.WriteLine(selectReader["subtitle"]);
}Martin
2012-10-08, 08:03 PM
(This post was last modified: 2012-10-08, 08:14 PM by mvallevand.)
Thinking about that field will need to be decoded so maybe simple xml is even easier
Code: try
{
string input = Convert.ToString(args[0]);
if (input.Length > 0)
{
XmlDocument doc = new XmlDocument();
doc.LoadXml(input);
XmlNode node = doc.SelectSingleNode("/Event/SubTitle");
if (node != null)
{
return node.InnerText;
}
}
}
catch (Exception e)
{
//Handle bad xml but that will break NPVR anyway
}
return "";Martin
2012-10-08, 09:01 PM
I have no idea if it works or not, but this updated NUtility.dll adds a class pretty much like what you posted. You'd need to pass two paramaters though. The xml and the xpath of the attribute you're interested in.
select XmlLookup(event_details, "/Event/SubTitle") as subtitle from SCHEDULED_RECORDING
2012-10-08, 09:07 PM
Thanks, now I have to contrive a rule that might test this.
Martin
2012-10-08, 11:14 PM
Does this NShared have the recording date patches I'm play around with Rules and haven't tried the new feature yet but this time
<StartTime>2012-10-14T23:00:00.0000000Z</StartTime> <EndTime>2012-10-15T01:00:00.0000000Z</EndTime> recorded a days worth of programming not close to the zone Code: 2012-10-08 18:19:45.892 [DEBUG][7] Requesting wake up for 'RecordingOID2346' at 14/10/2012 12:02 AM
2012-10-08 18:19:45.892 [DEBUG][7] Requesting wake up for 'RecordingOID2347' at 14/10/2012 2:02 AM
2012-10-08 18:19:45.892 [DEBUG][7] Requesting wake up for 'RecordingOID2348' at 14/10/2012 3:02 AM
2012-10-08 18:19:45.892 [DEBUG][7] Requesting wake up for 'RecordingOID2349' at 14/10/2012 3:27 AM
2012-10-08 18:19:45.892 [DEBUG][7] Requesting wake up for 'RecordingOID2350' at 14/10/2012 3:57 AM
2012-10-08 18:19:45.892 [DEBUG][7] Requesting wake up for 'RecordingOID2351' at 14/10/2012 4:27 AM
2012-10-08 18:19:45.892 [DEBUG][7] Requesting wake up for 'RecordingOID2352' at 14/10/2012 4:57 AM
2012-10-08 18:19:45.892 [DEBUG][7] Requesting wake up for 'RecordingOID2353' at 14/10/2012 5:27 AM
2012-10-08 18:19:45.892 [DEBUG][7] Requesting wake up for 'RecordingOID2354' at 14/10/2012 5:57 AM
2012-10-08 18:19:45.892 [DEBUG][7] Requesting wake up for 'RecordingOID2355' at 14/10/2012 6:27 AM
2012-10-08 18:19:45.892 [DEBUG][7] Requesting wake up for 'RecordingOID2356' at 14/10/2012 6:57 AM
2012-10-08 18:19:45.892 [DEBUG][7] Requesting wake up for 'RecordingOID2357' at 14/10/2012 7:27 AM
2012-10-08 18:19:45.893 [DEBUG][7] Requesting wake up for 'RecordingOID2358' at 14/10/2012 7:57 AM
2012-10-08 18:19:45.893 [DEBUG][7] Requesting wake up for 'RecordingOID2359' at 14/10/2012 8:27 AM
2012-10-08 18:19:45.893 [DEBUG][7] Requesting wake up for 'RecordingOID2360' at 14/10/2012 9:57 AM
2012-10-08 18:19:45.893 [DEBUG][7] Requesting wake up for 'RecordingOID2361' at 14/10/2012 10:57 AM
2012-10-08 18:19:45.893 [DEBUG][7] Requesting wake up for 'RecordingOID2362' at 14/10/2012 11:57 AM
2012-10-08 18:19:45.893 [DEBUG][7] Requesting wake up for 'RecordingOID2363' at 14/10/2012 12:57 PM
2012-10-08 18:19:45.893 [DEBUG][7] Requesting wake up for 'RecordingOID2364' at 14/10/2012 3:57 PM
2012-10-08 18:19:45.893 [DEBUG][7] Requesting wake up for 'RecordingOID2365' at 14/10/2012 4:57 PM
2012-10-08 18:19:45.893 [DEBUG][7] Requesting wake up for 'RecordingOID2366' at 14/10/2012 5:57 PM
2012-10-08 18:19:45.893 [DEBUG][7] Requesting wake up for 'RecordingOID2367' at 14/10/2012 6:57 PM
2012-10-08 18:19:45.893 [DEBUG][7] Requesting wake up for 'RecordingOID2368' at 14/10/2012 7:57 PM
2012-10-08 18:19:45.893 [DEBUG][7] Requesting wake up for 'RecordingOID2369' at 14/10/2012 8:57 PM
2012-10-08 18:19:45.893 [DEBUG][7] Requesting wake up for 'RecordingOID2370' at 14/10/2012 9:57 PM
2012-10-08 18:19:45.893 [DEBUG][7] Requesting wake up for 'RecordingOID2371' at 14/10/2012 10:57 PM
2012-10-08 18:19:45.893 [DEBUG][7] Requesting wake up for 'RecordingOID2372' at 14/10/2012 11:27 PMWhen you schedule could you log the sql too, so I can see what is used? Thanks this is quite promising. Martin
2012-10-09, 09:57 PM
Sub any ideas? I am gun shy to try this again.
Martin
2012-10-09, 10:04 PM
mvallevand Wrote:Does this NShared have the recording date patches I'm play around with Rules and haven't tried the new feature yet but this timeI don't understand the question. What patches? Quote:When you schedule could you log the sql too, so I can see what is used?The attached patch will log this sql statement if you got extended logging enabled in the config.xml
2012-10-09, 10:06 PM
sub Wrote:I don't understand the question. What patches? The patch that had the scheduled recording date and time screwed up. Martin
2012-10-09, 10:08 PM
Sorry, I still dont know what patch you're talking about. Keep in mind that I have a memory like swiss cheese. I blame it on juggling too much stuff and not getting enough sleep.
|
|
|