NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 4 5 6 7 8 93 Next »
Custom recording rules

 
  • 0 Vote(s) - 0 Average
Custom recording rules
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,785
Threads: 769
Joined: Nov 2003
#11
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.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,087
Threads: 957
Joined: May 2006
#12
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
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,087
Threads: 957
Joined: May 2006
#13
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
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,785
Threads: 769
Joined: Nov 2003
#14
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
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,087
Threads: 957
Joined: May 2006
#15
2012-10-08, 09:07 PM
Thanks, now I have to contrive a rule that might test this.

Martin
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,087
Threads: 957
Joined: May 2006
#16
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 PM

When you schedule could you log the sql too, so I can see what is used?

Thanks this is quite promising.

Martin
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,087
Threads: 957
Joined: May 2006
#17
2012-10-09, 09:57 PM
Sub any ideas? I am gun shy to try this again.

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,785
Threads: 769
Joined: Nov 2003
#18
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 time

<StartTime>2012-10-14T23:00:00.0000000Z</StartTime>
<EndTime>2012-10-15T01:00:00.0000000Z</EndTime>
I 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
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,087
Threads: 957
Joined: May 2006
#19
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
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,785
Threads: 769
Joined: Nov 2003
#20
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.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (6): « Previous 1 2 3 4 5 6 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Custom recording tomx 2 681 2025-02-07, 09:14 AM
Last Post: tomx
  API call for Recording Complete linustorvalds 1 451 2025-01-19, 02:11 PM
Last Post: mvallevand
  Manual recording API mvallevand 2 1,117 2023-11-09, 02:14 PM
Last Post: mvallevand
  Recording direct to GPhotos API rgonzalez 0 1,508 2020-06-29, 04:45 AM
Last Post: rgonzalez
  Recurring Recording URL Parameters jcole998 2 3,055 2019-09-19, 01:08 PM
Last Post: jcole998
  Get recording length from stream skogl 46 14,436 2019-08-15, 09:34 PM
Last Post: sub
  Unexpected result when deleting a pending recording scJohn 5 3,867 2018-05-06, 10:09 PM
Last Post: sub
  custom creation of a recurring error p37307 2 2,370 2017-12-19, 03:45 AM
Last Post: mvallevand
  How to best verify success when adding a recurring recording drmargarit 1 2,871 2017-03-02, 03:13 PM
Last Post: mvallevand
  Change recording filename programmatically immediately before recording starts? craigrs84 5 6,194 2015-07-13, 09:28 PM
Last Post: patco444

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode