NextPVR Forums

Full Version: Advanced Rules Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey sub or anyone who can answer this one.

From everything I could gather, if I create a manual recording and then add the below SQL statement to the advanced rules, the below statement should allow me to record all first run episodes that are a series premier. Is that correct? I can only hope it's that simple!

SELECT * FROM EPG_EVENT WHERE ((Season=1 AND Episode = 1 AND first_run = True) AND start_time BETWEEN 19:00 and 21:00)
Try your statement above in a tool like SQLiteSpy to see if it returns what you expect.

In NextPVR you'd only use the clause bit, ie not the "SELECT * FROM EPG_EVENT WHERE" bit. Also, times are in UTC, so your clause would need to account for that. I'm aware of the "BETWEEN" operator, but I guess it might exist.
Season=1 AND Episode = 1 AND first_run = "Y"

This returned 4 shows, one in particular that I was hoping to see. If I used this with a manual record, daily and any channel, NPVR would record four separate shows then? Could I use the start and end time fields in the manual recording to constrain the time frame instead of having to worry about UTC and the BETWEEN clause?
cbgifford Wrote:Season=1 AND Episode = 1 AND first_run = "Y"

This returned 4 shows, one in particular that I was hoping to see. If I used this with a manual record, daily and any channel, NPVR would record four separate shows then?
If that's what the SQL query returns, then yes.

Quote:Could I use the start and end time fields in the manual recording to constrain the time frame instead of having to worry about UTC and the BETWEEN clause?
Yes you can and SQLite has functions for doing the UTC conversion for you. Sorry I don't have any SQL handy that I can provide you.
After seeing the result set in this log, http://forums.nextpvr.com/showthread.php...post483313 I'd be worried using the time, the sqlite commands sure look correct to me.

Martin
mvallevand Wrote:After seeing the result set in this log, http://forums.nextpvr.com/showthread.php...post483313 I'd be worried using the time, the sqlite commands sure look correct to me.

Martin

I'm using SQLite Browser and the clause works fine. I'm not using the time clause in the advanced command. I'm specifying the time frame, 19:00 to 22:00 in the the manual record settings. There's a show that meets the criteria tomorrow so the manual recording should pick it up. We'll see what happens and I will post the results.

I also just ran the below clause and it worked as well. Being a DB Programmer/Analyst, I've always used the between clause when working with date/time fields instead of the < and > operators. It makes for a simpler syntax. Perhaps he could rework the clause to use BETWEEN instead and see what happens

Code:
(season=1 and episode=1 and first_run = "Y") AND time(start_time,'localtime') BETWEEN time('19:00:00') and time('22:00:00')
Ok, now that I have my quotes correct, I'm starting simple

season=1 and episode=1 and first_run='Y'

This clause picks up two shows when I run it using SQLite Browser. However, when I enter the command into recurring recordings, it doesn't pick anything up when I select Find All. I updated the EPG and when I checked the recurring recordings list for the time the show is supposed to air, there was nothing scheduled during that time frame. Any ideas?
Any ideas why this does not appear to be working?
cbgifford Wrote:Any ideas why this does not appear to be working?

Logs, plus set extended logging. http://forums.nextpvr.com/showthread.php...post483356 so we can see the select call

Martn
cbgifford Wrote:This clause picks up two shows when I run it using SQLite Browser. However, when I enter the command into recurring recordings, it doesn't pick anything up when I select Find All. I updated the EPG and when I checked the recurring recordings list for the time the show is supposed to air, there was nothing scheduled during that time frame. Any ideas?

I created a manual recording with the same parameters you specified on the next post (except my default post-padding is 5 minutes). When I clicked OK, NPVR immediately scheduled all of the matching shows for me as expected. I didn't have to do an EPG update. Overnight, it would have then done the automatic EPG update, too. Now, if I go into Recurring Recordings and select that recording and click Find All, I get the same "error" you're seeing saying "No other matching shows found." But, I presume that's because it has already scheduled all of the shows which match the rule.
Pages: 1 2