NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 11 12 13 14 15 … 93 Next »
Way of telling if a scheduled recording has been added/deleted

 
  • 0 Vote(s) - 0 Average
Way of telling if a scheduled recording has been added/deleted
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#1
2011-10-18, 11:28 PM
Clutching at straws here but is there an 'external' way to tell if a new recording has been scheduled (or an existing one cancelled)? By 'external' I mean not using a plugin within NextPVR.

Cheers,
Brian
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,705
Threads: 767
Joined: Nov 2003
#2
2011-10-18, 11:38 PM
No. You'd probably have to poll the database, comparing with the results last time you polled.
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#3
2011-10-19, 12:13 AM
sub Wrote:No. You'd probably have to poll the database, comparing with the results last time you polled.
I had a feeling you might say that. Big Grin

Querying the sqlite_sequence table for the 'seq' value will be light-weight enough for checking for new recordings but checking for deletions will be a bit heavier. Oh well, thanks as ever for the response.

Cheers,
Brian
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#4
2011-12-06, 02:32 PM
Just to revisit this... Smile

As there's no external way of telling if a recording has been scheduled / cancelled - is there an 'internal' way? In other words, is there an event which plugins can listen for so they receive schedule/cancel notifications?

Cheers,
Brian
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,926
Threads: 956
Joined: May 2006
#5
2011-12-07, 01:23 AM
Certainly not sub approved, but if you created a new table you could add a trigger to keep a list of deleted oid's that you could manage externally.

Code:
create table [bgowland] (
    [scheduled_recording_oid] integer NOT NULL
);

Code:
create trigger deleteRecording after delete on scheduled_recording
begin
insert into bgowland (scheduled_recording_oid) values (old.oid);
end

Martin
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#6
2011-12-07, 09:57 AM
Thanks Martin. Something to think about but obviously not ideal and, as you say, not an approved approach.

Ideally I was hoping that I could create a 'dummy' plugin for ndroid (ideally without UI but I can't remember if that's possible). If there are events that plugins can register for I could pass data through to the ndroid service. Just running through possible approaches for syncing actions across devices.

Cheers,
Brian
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,705
Threads: 767
Joined: Nov 2003
#7
2011-12-07, 11:10 AM
bgowland Wrote:As there's no external way of telling if a recording has been scheduled / cancelled - is there an 'internal' way? In other words, is there an event which plugins can listen for so they receive schedule/cancel notifications?
No. The event system only works for events in the local process. If I used it to notify of new recordings being scheduled, you'd only hear about some of the recordings, since some would be scheduled by the recording service, and possibly other instances of the client.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,926
Threads: 956
Joined: May 2006
#8
2011-12-07, 12:50 PM
bgowland Wrote:Thanks Martin. Something to think about but obviously not ideal and, as you say, not an approved approach.

I woke up thinking that the solution was like overkill anyway. Just use "Attach" to link your database and npvr.db3 and then it is a simple matter of doing this when necessary

select * from myscheduled_recordings where myoid not in (select oid from npvr.scheduled_recording)

Martin
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#9
2011-12-07, 05:06 PM
sub Wrote:you'd only hear about some of the recordings, since some would be scheduled by the recording service, and possibly other instances of the client.
Of course, thanks. It had occurred to me that it wouldn't work for activity via NEWA, but I hadn't considered npvr clients or recordings generated by the service as part of a recurring recording, for example.

mvallevand Wrote:Just use "Attach" to link your database and npvr.db3 and then it is a simple matter of doing this when necessary

select * from myscheduled_recordings where myoid not in (select oid from npvr.scheduled_recording)
Actually that's a nice approach - I hadn't thought of that, thanks.

I was really just clutching at straws again to try to avoid polling for DB changes but I realise it's my only option. My dev versions of ndroid and the service are C2DM enabled which I intend to use to sync ndroid clients. For it to be of use, the service needs to push messages out ASAP after a schedule/cancel action and I'm just slightly worried that polling too frequently might have a detrimental effect. Guess I'll just have to try it. Smile

Cheers,
Brian
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Custom recording tomx 2 539 2025-02-07, 09:14 AM
Last Post: tomx
  API call for Recording Complete linustorvalds 1 363 2025-01-19, 02:11 PM
Last Post: mvallevand
  Manual recording API mvallevand 2 1,001 2023-11-09, 02:14 PM
Last Post: mvallevand
  Recording direct to GPhotos API rgonzalez 0 1,456 2020-06-29, 04:45 AM
Last Post: rgonzalez
  Recurring Recording URL Parameters jcole998 2 2,976 2019-09-19, 01:08 PM
Last Post: jcole998
  Get recording length from stream skogl 46 13,906 2019-08-15, 09:34 PM
Last Post: sub
  Unexpected result when deleting a pending recording scJohn 5 3,758 2018-05-06, 10:09 PM
Last Post: sub
  How to best verify success when adding a recurring recording drmargarit 1 2,810 2017-03-02, 03:13 PM
Last Post: mvallevand
  How to move recordings without them getting deleted from db drmargarit 4 3,897 2015-09-27, 05:33 PM
Last Post: sub
  Change recording filename programmatically immediately before recording starts? craigrs84 5 6,089 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