NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Legacy (v4.x and earlier) v
« Previous 1 … 132 133 134 135 136 … 433 Next »
Database update issues and changing priorities

Database update issues and changing priorities
johnsta
Offline

Member

Posts: 62
Threads: 7
Joined: May 2016
#11
2016-05-22, 02:23 PM
Once again, I'm providing this information for other people who might
find it useful.

I've been doing a lot of playing around with changing priorities
because I want to understand how they work in NextPVR, and what the
quirks are.

Just as an experiment, I used the following sql to change
all the priorities:

Code:
update recurring_recording set priority =
   2 * (oid - (select min(oid) from recurring_recording) ) + 100 ;


This sets the priorities to 100, 102, 104, 106, etc., but leaving them
in their default ordering (i.e., same ordering as oid). This could be
useful because it leaves a "blank" space between consecutive
priorities, so that there's room to move a new recording's priority
into that space.

Once you've change priorities, then you have to use

> NextPVR.exe -recurring

to have the system recompute all the scheduled recordings. This
takes one to two minutes.

You have to do the same after you've inserted a new recurring
recording or deleted the old one. If you make the change through the
GUI, then the recomputation takes place automatically. Otherwise, you
have to force it with the command above.

Here's an example of some SQL that inserts a new recurring
recording:

Code:
INSERT INTO "RECURRING_RECORDING"
(name, match_rules, priority)
VALUES ("CNN-6-7pm","<Rules>
  <ChannelOID>8947</ChannelOID>
  <ChannelName>CNN</ChannelName>
  <StartTime>2016-05-21T22:00:00.0000000Z</StartTime>
  <EndTime>2016-05-21T23:00:00.0000000Z</EndTime>
  <PrePadding>0</PrePadding>
  <PostPadding>0</PostPadding>
  <Quality>0</Quality>
  <Keep>99</Keep>
  <Days>SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY</Days>
</Rules>
",
(select max(priority)+2 from recurring_recording)
);


The tricky thing is to get the GMT times right without screwing
them up, which is very easy to do.

Note the line at the end: "(select max(priority)+2 from
recurring_recording)". This sets the priority of the next recording
to the maximum priority so far, plus 2, to guarantee that priorities
will be unique.

After you do this, (or you delete an existing recurring recording),
then you have to:

> NextPVR.exe -recurring

I've found two bugs in this process. One is that any existing
recordings are duplicated (I'll discuss this below).

The other is that if npvr has previously scheduled a recording as a
"Conflict Alternative Airing," then the conflicting recording is
sometimes, but not always, deleted, so this has to be handled
manually.
johnsta
Offline

Member

Posts: 62
Threads: 7
Joined: May 2016
#12
2016-05-22, 02:24 PM
The main quirk is that whenever you run

> NextPVR.exe -recurring

then any existing recordings are duplicated. By this I mean the
following:
  • If a program is being recorded, then it continues recording.

  • However, npvr then starts a second recording of the same program,
    so you end up with the full program in one file, and a duplicate of
    the last part of the same program in another file.

This is not a big problem and is easy to work around, just by deleting
the duplicate copy, but it does require vigilance.

However, something really startling happened yesterday as I was
playing around. I added and deleted recordings two or three times
using sqlite. I did a check of active file handles, and found that
there were eight recording files being created! This was a shock,
because there are only four tuners in my Comcast cablecard.

So I checked the NPVR|Settings|Status screen, and saw the following:

Code:
Devices
    :0
    Recording: D:\Recorded TV\Manual Recordings\FNC-6-7pm_20160521_18001900.ts
    Recording: D:\Recorded TV\Manual Recordings\FNC-6-7pm_20160521_18001900-0.ts
    Recording: D:\Recorded TV\Manual Recordings\FNC-6-7pm_20160521_18001900-1.ts
    Recording: D:\Recorded TV\Manual Recordings\FNC-6-7pm_20160521_18001900-2.ts
    Recording: D:\Recorded TV\Manual Recordings\FNC-6-7pm_20160521_18001900-3.ts
    :0
    Recording: D:\Recorded TV\Manual Recordings\CNN-6-7pm_20160521_18001900.ts
    Recording: D:\Recorded TV\Manual Recordings\CNN-6-7pm_20160521_18001900-0.ts
    Recording: D:\Recorded TV\Manual Recordings\CNN-6-7pm_20160521_18001900-1.ts
    :0
    :0
    IPTV
    Pending Recordings


So it was making several duplicate recordings, but they were all using
just two tuners, since only two different channels were involved.

This is a vast improvement over WMC. If you accidentally schedule two
recordings at the same time on the same channel, WMC used two tuners.
NextPVR is clever enough to use the same tuner for both recordings.

Once again, I hope that this information will be useful to other people.
Graham
Offline

Posting Freak

UK
Posts: 4,058
Threads: 102
Joined: Dec 2005
#13
2016-05-22, 04:10 PM
johnsta Wrote:NextPVR is clever enough to use the same tuner for both recordings.

For completeness, NextPVR attempts to use a single digital tuner for all simultaneous recordings that are on the same frequency (mux). This is useful in the UK where we have six or eight channels on a single mux. Not so much in the US where there are fewer channels on each mux.
BrettB
Offline

Posting Freak

Saint Paul, MN, USA
Posts: 2,666
Threads: 170
Joined: Jun 2007
#14
2016-05-22, 06:42 PM
Graham Wrote:For completeness, NextPVR attempts to use a single digital tuner for all simultaneous recordings that are on the same frequency (mux). This is useful in the UK where we have six or eight channels on a single mux. Not so much in the US where there are fewer channels on each mux.

This statement isn't correct in johnsta's case because he is using an HDHR Prime with a CableCard. With CableCard devices, a single tuner can only receive a single virtual channel even if there are other virtual channels on the same physical frequency on the cable. This is a limitation of the CableCard encryption. If the channels where in ClearQAM (i.e. not using a CableCard), the NextPVR would be able to record all of the logical channels on the same physical frequency/channel simultaneously with a single tuner.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,707
Threads: 767
Joined: Nov 2003
#15
2016-05-22, 07:38 PM
johnsta Wrote:However, since I have something recording 24 hours a day, I would
never get an EPG update. So I'm just going to leave it the way it is
for now, and live with the dual recording.
Are you sure this isn't for commercial use? It's looking awefully like commercial use. If that is the case, please contact me to get the correct sort of license arranged.
johnsta
Offline

Member

Posts: 62
Threads: 7
Joined: May 2016
#16
2016-05-22, 08:24 PM
sub Wrote:> Are you sure this isn't for commercial use? It's looking awfully
> like commercial use. If that is the case, please contact me to get
> the correct sort of license arranged.

Yes, I'm sure it isn't for commercial use. I record news channels 24
hours a day because I write a news/history blog, and go back to the
recordings later if needed. I delete the news recordings within 2-3
days if they're not needed. I make no money whatsoever from the blog.

Since you apparently consider me to be some sort of crook:

I write daily "World View" articles for GenerationalDynamics.com. I
make no money, since the project is a personal obsession. My articles
get cross-posted on other sites, but nobody pays me for anything.

Nor do I run any ads. I don't get paid anything by anybody.

Anybody who would like more information is welcome to visit:

Web site: http://www.GenerationalDynamics.com
Forum: http://www.gdxforum.com/forum
Subscribe to World View: http://generationaldynamics.com/subscribe


As long as I've been forced to go this far, I might as well
add more information:

Since I started my web site in 2003, I've posted about 4,000 articles
containing hundreds of predictions, all of which have either come true
or are trending true. There is no analyst, web site, politician or
journalist in the world greater predictive success than my web site.
This is possible because of the generational methodology, which uses
MIT's System Dynamics, applied to to generational flows, to determine
what can be predicted (like large social trends), and uses Chaos
Theory to determine what cannot be predicted (like election results).

System Dynamics was developed by Jay Forrester at MIT in the 1960s.
Generational Dynamics is the most significant and most successful
application of MIT's System Dynamics that's been developed, simply
because it works.

When I explain Generational Dynamics to someone, I often start with
mothers in the 1950s. That decade is described as a time when
controlling men refused to let their wives out of the kitchen, and
forced them to stay home and have babies, with no freedom at all.
This caricature is totally absurd and bears absolutely no resemblance
whatsoever to what actually happened in the 1950s.

The truth is as follows: A mother in the 1950s would have grown up in
the 1930s, where she and her family may have been forced to live under
a bridge and depend on soup kitchens to survive. If that wasn't true
for her, then it was certainly true for any number of her friends.

Then, as the Great Depression began to ease, World War II began, and
she watched from afar as her father, brother and uncle, and those of
her friends, were tortured, mutilated and killed on the Bataan Death
March. As the war progressed, she was forced to take "Rosie the
Riveter" type jobs that she hated. And if her father, brother or
uncle even survived until 1944, she could read how thousands of
American men were killed like fish in a barrel as they landed on the
beaches of Normandy.

And by the way, I know that there are a lot of European users
who read this forum, and you don't have to tell me how much
your parents and grandparents suffered in the Great Depression
and World War II. I have readers from around the world, though
I usually write from an American point of view.

By the time the 1950s arrived, America had beaten the Great
Depression, had beaten the Nazis, and had beaten the Imperial
Japanese. And now America could enjoy the rewards they had earned.
And for a mother, this meant a home with a white picket fence where
she could stay home, safe and dry and warm, and take care of the kids
with her husband bringing home a paycheck. Institutions would be put
in place to make sure nothing like the Great Depression or WW II would
ever happen again. And these rewards would be passed on to her
children, so that her children and grandchildren would never have to
go through what she went through. America had won the war, and now
Americans could enjoy the American Dream.

In the 1960s, the Boomer generation rejected these rewards, and
rebelled against the restrictions that had been designed to prevent a
new world war. By the 1990s, Generation-X not only rejected these
restrictions, but were so contemptuous of the Boomers that they became
(as a generation) destructive and self-destructive. The same thing is
happening in countries around the world, as the survivors of World War
II die off. People in country after country are going deeper and
deeper into debt, and are becoming increasingly nationalistic, racist
and xenophobic. As I write this, a far-right politician will probably
be the new president of Austria, when the final election results are
announced on Monday. This already resulted in the 2007-2009 financial
crisis, but the worst is yet to come as we're headed for a new global
financial panic and crisis, and new world war.

This is the kind of generational analysis that I've been doing.

When I started writing about these things in 2003, most people thought
that I was a harmless kook. Today, as one prediction after another
has come true, and we see what's happening in Ukraine, Europe, the
Mideast, the South China Sea and elsewhere, while country after
country is going into astronomical debt, many people shun my web site
because they can't stand the bad news, while tens of thousands are
regular readers because they know it's the only web site anywhere that
tells them what's actually going on in the world in a non-ideological
fashion, as opposed to crap from the politicians on the left and
right.

So there you go. I hope that by this time you believe that I make
absolutely no money from using your product. I use it for my personal
obsession, and I make no money from it.

Furthermore, I am like you that I provide my work as a public service,
at no cost. I make no money from it. I welcome everyone reading this
to subscribe to my FREE daily World View articles.

John J. Xenakis
100 Memorial Drive Apt 8-13A
Cambridge, MA 02142
Phone: 617-864-0010
E-mail: john@GenerationalDynamics.com
Web site: http://www.GenerationalDynamics.com
Forum: http://www.gdxforum.com/forum
Subscribe to World View: http://generationaldynamics.com/subscribe
johnsta
Offline

Member

Posts: 62
Threads: 7
Joined: May 2016
#17
2016-05-22, 08:52 PM
As long as I'm writing all this stuff, there are two feature requests
that I'd like to make, if possible:
  • I really prefer having all my recording files in a single
    directory, rather than multiple subdirectories. It would be great if
    this were an option.

  • I really wish that the filename contained the channel name, as I
    have a script that moves files around and uses the channel name as
    part of the logic. Some files are deleted after two days, some are
    deleted after seven days, and some are kept until I have a chance to
    watch them, which might be months later. I guess the full request
    would be to allow the user to type a format string in the settings
    dialog. For example, "%n.%e.%c.%t" would stand for "name, episode,
    channel, time".

Thanks.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,707
Threads: 767
Joined: Nov 2003
#18
2016-05-22, 09:00 PM
I don't mean any offence by asking, but you can see how your usage would look unusual, and I'm sure you can imagine we regularly have people trying to the software for commerical use.

The usage you describe is still very gray though. ie, the criteria is not about whether you're making money off it's use. It's license states "personal, non-commercial use", which also rules out the use by non-profit organizations like schools, or other businesses using it for a non-profit generating activity. It's solely intended for use by people in their own home's watching and recording tv shows they enjoy, not for archiving footage, reporting stats, etc. ie not for any activity by companies or other business organizations. "Generational Dynamics" is sounding very much like a company.

You can set <AutoCreateFolders>false</AutoCreateFolders> in config.xml to stop it creating sub directories.
BrettB
Offline

Posting Freak

Saint Paul, MN, USA
Posts: 2,666
Threads: 170
Joined: Jun 2007
#19
2016-05-22, 09:13 PM
johnsta Wrote:As long as I'm writing all this stuff, there are two feature requests
that I'd like to make, if possible:

First off, this thread isn't really the appropriate place to make feature requests. There is separate Wishlist forum for those. Additionally, both of the things that you are requesting can already be done fairly simply and have been addressed in forum posts which are pretty easy to find by searching the forums.

johnsta Wrote:I really prefer having all my recording files in a single
directory, rather than multiple subdirectories. It would be great if
this were an option.

If you set
Code:
<AutoCreateFolders>false</AutoCreateFolders>
in your config.xml file, then NextPVR will put all of the recordings in directory specified by the recording folder.

johnsta Wrote:I really wish that the filename contained the channel name, as I
have a script that moves files around and uses the channel name as
part of the logic. Some files are deleted after two days, some are
deleted after seven days, and some are kept until I have a chance to
watch them, which might be months later. I guess the full request
would be to allow the user to type a format string in the settings
dialog. For example, "%n.%e.%c.%t" would stand for "name, episode,
channel, time".

The PostProcessing.bat file is passed a set of parameters giving info about the recording. One of those (%2) is the channel number that the recording came from. You can use that info along with "nscripthelper.exe -rename <oldfile> <newfile>" to rename the recording file(s) and update the NextPVR database to point to the renamed recording file.
johnsta
Offline

Member

Posts: 62
Threads: 7
Joined: May 2016
#20
2016-05-22, 09:21 PM
Thanks.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): « Previous 1 2


Possibly Related Threads…
Thread Author Replies Views Last Post
  EPG Update Errors jcole998 23 1,164 2025-05-11, 06:03 PM
Last Post: mvallevand
  Device Update - Channel Mapping chezmorris 10 4,682 2022-07-01, 01:59 PM
Last Post: mvallevand
  tsreader4 skipping issues dlindyds 63 14,181 2021-09-05, 03:23 AM
Last Post: rizarefaldi
  ITV/BBC HD and EPG missing from scan and update angelisle 16 4,119 2021-08-26, 11:45 AM
Last Post: NumberFive
  Fast-forward and comskip issues manic_biker 11 3,831 2021-07-12, 02:17 AM
Last Post: Robazz
  Issues with Signal? Tularis 6 2,362 2021-05-01, 11:09 AM
Last Post: shspvr
  Auto Update EPG not running as scheduled? BairStrokes 2 1,722 2021-03-26, 12:02 PM
Last Post: NumberFive
  automatic EPG update virtualpaul 18 12,759 2021-01-29, 12:40 PM
Last Post: virtualpaul
  Auto Update EPG not running as scheduled Bobbybear 10 3,587 2020-10-24, 09:24 AM
Last Post: Bobbybear
  Microsoft update Brucek2839 2 1,496 2020-09-12, 03:29 AM
Last Post: Brucek2839

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

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

Linear Mode
Threaded Mode