NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 18 19 20 21 22 … 93 Next »
NPVR - temporary solution to lack of searchable fields after event is gone from guide

 
  • 0 Vote(s) - 0 Average
NPVR - temporary solution to lack of searchable fields after event is gone from guide
carpeVideo
Offline

Posting Freak

Posts: 824
Threads: 23
Joined: Dec 2006
#1
2010-09-28, 09:59 PM
I needed some data to be searchable for guidePlus and vidImport that isn't possible if a recording is no longer in the EPG table, Sub plans to make some the fields available in the future but in the mean time I created an un-official work around - a combination of a new table that is a copy of the fields in the EPG_Event table and a trigger that inserts the data when a recording is scheduled. Once again very unofficial and may eventually break due to official database changes but it will allow you to do queries on the full set of available fields after the epg_event is gone.


Basically when a scheduled_recording is inserted a trigger is used to make exact copy of the epg_event in a new table called recorded_event. It may make sense to have another trigger that deletes it if the scheduled_recording is deleted (or a foreign key)


It is good for reading data but if you want to write changes you will need to write the XML to the "cached" event in the scheduled_recordings. Join with that table via title=name, channel_oid=channel_oid and start_time = start_time.


I will use it to search the unique ID to tell if an event is a TV series and if so augment any incoming EPG event on that series without require a user to tell me what series are important to them.


Once again - unofficial and not meant to step on Sub's toes, for experts only, may cause cancer and do not use if you are pregnant or have a heart condition or if your head does not reach the height of this mark :-)


Code:
CREATE TABLE [RECORDED_EVENT] (
    [oid] integer NOT NULL,
    [title] varchar(50) NOT NULL,
    [subtitle] varchar(50) NOT NULL,
    [description] varchar(50) NOT NULL,
    [start_time] datetime NOT NULL,
    [end_time] datetime NOT NULL,
    [channel_oid] int NOT NULL,
    [unique_id] varchar(50) NOT NULL,
    [rating] varchar(50) NOT NULL,
    [original_air_date] datetime,
    [season] int NOT NULL,
    [episode] int NOT NULL
);

Code:
CREATE TRIGGER [recordingInserted]
AFTER INSERT ON [SCHEDULED_RECORDING]
FOR EACH ROW
BEGIN

insert into RECORDED_EVENT
(oid, title, subtitle, description, start_time, end_time,
channel_oid, unique_id, rating, original_air_date, season, episode)
select  *
from EPG_EVENT where new.name = EPG_EVENT.title and
EPG_EVENT.start_time = new.start_time and
EPG_EVENT.channel_oid = new.channel_oid;

END
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,837
Threads: 954
Joined: May 2006
#2
2010-09-28, 11:29 PM
carpeVideo, this is tremendous idea, for those that want to take the low risk and I certainly want to join in. Anything I contribute I could keep current with changes that sub makes.

To avoid duplication what are you planning? If you need help, I can see myself wanting and writing the following.

- a utility to import GBPVR recordings
- a post update batch utility to remove re-scheduled duplicates
- a post epg utility to correct information in the imported scheduled_recordings from tvrage, thetvdb and imdb
- updating SearchLite to populate relevant fields in EPG_EVENT and then check for duplicates before recording
- updating NEWA to not record duplicates

For consistency I'd like to NOT use channel_oid, plus I'd like to see a separate star-ratings field and genre added which can be populated (and possibly modified since it is often dynamic). Also description is a little short.

Martin
carpeVideo
Offline

Posting Freak

Posts: 824
Threads: 23
Joined: Dec 2006
#3
2010-09-29, 01:22 AM
Good ideas - here is my take -


- a utility to import GBPVR recordings --> vidImport should be able to do this - if not now with a few tweaks by creating an importable file as it does with gbpvr
- a post update batch utility to remove re-scheduled duplicates --> definitely would be handy - that would mean you would not want to delete anything from this table - which may bloat the database - GBPVR has a separate table with 1 field for that we could have the trigger do both but it should only do that upon successful completion of a recording which would be an additional different trigger
- a post epg utility to correct information in the imported scheduled_recordings from tvrage, thetvdb and imdb --> that is what guidePlus( and of course ultra and others which could be modified for NPVR) does - I have a version that is compatible with NPVR but it does not hunt for series info unless you specify the series in a file - currently it does put a * on new recordings and ratings and year first aired on movies
- updating SearchLite to populate relevant fields in EPG_EVENT and then check for duplicates before recording
- updating NEWA to not record duplicates
Quote:For consistency I'd like to NOT use channel_oid, plus I'd like to see a separate star-ratings field and genre added which can be populated (and possibly modified since it is often dynamic). Also description is a little short.
We could add the recording_OID to the table and trigger and use that for joins instead of the channel OID
As to the other fields they could be added but would not show anywhere in NPVR since it refers to the cached data (this is why changing the epg file before import is a good approach).

I think it needs to be kept simple since it is Sub's app and its best to add any functionality without affecting anything he does.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,837
Threads: 954
Joined: May 2006
#4
2010-09-29, 02:01 AM
My reason for this and yours sound different. I have no real desire to identify re-runs with the ® which the xml tv pre-processors do, I oly want to avoid duplicate recordings of shows I have recorded but still record re-runs and first runs of shows I haven't watched. With prime time shows in the guide repeated so many times daily (Canadian/US, East/West, HD/SD) that makes 8 corrections per episode which is way too may online searches.

I also don't mind the bloat, I want to keep a record because I delete files and I don't archive.

Martin
carpeVideo
Offline

Posting Freak

Posts: 824
Threads: 23
Joined: Dec 2006
#5
2010-09-29, 02:27 AM
I am not talking re-runs I am talking filtering previously recorded shows. GBPVR keeps a table of unique ID (schedules direct) of everything ever recorded even if it the files has been deleted. If don't record dups is set it looks in this table before scheduling any recording. So the same method would work here and take care of bloat since all you need is the unique program ID. So I think it is the same thing - as you mentioned with a first run happening on several channels over several days this becomes more even more important.

I also like to tag first runs with a * for visual and recording schedule ease - but I can do that now with no changes to the NPVR database since it is pre-processed.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,837
Threads: 954
Joined: May 2006
#6
2010-09-29, 03:08 AM
Yes, now that I think about it, only the post recording rename might need to go online to get S#E# either there will be enough in the new table or there wouldn't be enough to do a lookup anyway.

Martin
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Way to tell programmatically if channel load in from NPVR has finished... gdogg371 3 2,340 2021-03-11, 03:59 PM
Last Post: mvallevand
  Plugins and NPVR. Where do we start? sub 80 68,119 2020-11-26, 10:02 PM
Last Post: mandai
  Test/Development environment for npvr.db3 scJohn 10 4,225 2020-09-04, 09:14 PM
Last Post: scJohn
  Seeking explanation for recurring schedule fields timeslotStart and timeeslotEnd scJohn 4 2,039 2020-07-14, 10:13 PM
Last Post: scJohn
  How to extract M3U8 and get matching XMLTV guide data from NPVR almightyj 0 3,394 2018-10-23, 07:24 AM
Last Post: almightyj
  Getting more than 24 hours of Guide Data scJohn 4 3,564 2018-05-16, 04:20 AM
Last Post: sub
  ios app to control npvr ui idea jnbooker15 4 3,566 2015-09-21, 10:19 PM
Last Post: sub
  ios app to control npvr ui idea jnbooker15 0 2,447 2015-09-21, 06:39 PM
Last Post: jnbooker15
  Skin - view further into the future, scale the guide Vitenka 5 3,241 2014-11-26, 07:28 PM
Last Post: Vitenka
  Couple of questions about hacking npvr.db3 drmargarit 6 4,223 2014-09-08, 02:22 AM
Last Post: sub

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

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

Linear Mode
Threaded Mode