NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Information Community Announcements v
« Previous 1 8 9 10 11 12 56 Next »
MpegImport utility added to wiki

 
  • 0 Vote(s) - 0 Average
MpegImport utility added to wiki
ubu
Offline

Posting Freak

Posts: 792
Threads: 54
Joined: Jan 2006
#31
2006-05-08, 11:32 PM
sixgun Wrote:Currently, it assumes (always bad to do, i know!) that the path ends with a \ character.
Seems like a reasonable assumption. I do the same thing in my code:

Code:
String gbpvrHomeDir = null;
  String gbpvrDataSource = null;
  // Get the GBPVR install dir from registry or default to local for debugging
  try
  {
      RegistryKey rk = Registry.LocalMachine.OpenSubKey("Software\\devnz");    
      gbpvrHomeDir = (String)rk.GetValue("GBPVR InstallDir");
  }
  catch { gbpvrHomeDir = "..\\..\\"; }
  gbpvrDataSource = gbpvrHomeDir + "gbpvr.mdb";
So, if UncleJohnsBand is using the "correct" approach, I'm making even more assumptions. Wink
Quote: Then it sticks gbpvr.exe on the end, and then runs it with a parameter of "-import".
Your code does seem to run the GBPVR import. It just didn't import the new mpegs. Is there a way of checking if it is passing in the correct xml file?
[SIZE=1]GBPVR v1.3.11 [/SIZE][SIZE=1]HVR-1250, [/SIZE][SIZE=1]ES7300[/SIZE][SIZE=1], 4GB, GeForce 9300, LianLi, Vista.[/SIZE]
[SIZE=1]GBPVR v1.0.08 [/SIZE][SIZE=1]PVR-150, [/SIZE][SIZE=1]P4 2.26GHz, [/SIZE][SIZE=1]1GB,[/SIZE][SIZE=1] GeForce 6200, [/SIZE]Coupden, XP[SIZE=1]
[/SIZE]

Author: UbuStream plugin, UbuRadio plugin, EPGExtra utility.
sixgun
Offline

Member

Posts: 197
Threads: 35
Joined: Sep 2004
#32
2006-05-09, 07:31 AM
ubu Wrote:Your code does seem to run the GBPVR import. It just didn't import the new mpegs. Is there a way of checking if it is passing in the correct xml file?

It doesn't "pass" the file. It assumes that you (the user) will have generated the recordings-dump.xml file in the folder that gbpvr picks it up from.

I just tried passing the filename of the xml file that MpegImport generates and GBPVR didn't take it.

Am i correct in assuming your generated import file is not in the gbpvr folder?

I do a check for the recording-dump.xml file in the gbpvr folder, but i don't check if that's the one that was just generated. I could take a number of approaches here.

  1. Leave it as is, and mod the instructions to indicate what assumptions it makes
  2. Add a check to see if the generated file is the correct one for GBPVR to use
  3. Temporarily copy the generated file to the correct place (restoring what was there, if anything, afterwards)

But, i'm not really sure which is best, as i don't know how people use it. My guess is that 3 would be best as it's totally transparent to the user and leaves everything as it was before. Unfortunately, it's also the most work Smile

Regards.
GBPVR: v0.99.5
Server: Athlon64 X2 3800+, 2GB Memory, 1480GB Storage, 6 DVB-T Tuners (2 x Nova-T 500 PCI, 2 x Nova-T PCI)
HTPC: Athlon64 3000+, 1GB Memory, 80GB Storage, Blackgold GDI DVB-T Tuner, Ahanix MCE-302 Case, MSI K8NGM2-FID motherboard
Main TV: Toshiba 42WLT66 LCD
Media Playback: 2 x MVP (wired)
Homepage: http://www.sixgun.co.uk/
Author of MpegImport utility
GoodGuys
Offline

Senior Member

Posts: 433
Threads: 41
Joined: Jun 2005
#33
2006-05-09, 07:38 AM
I vote #3 also, unless you can talk to sub and find out if it's possible to provide a filename somehow...

GGF
AMD64 3000+, MSI-Neo4F, 1GB, 1.5TB WD-SATA, PVR350+150 34btn remote, ATI 2460HD TVOut, 1.4.7: VMR9fse, CS3 skin
sixgun
Offline

Member

Posts: 197
Threads: 35
Joined: Sep 2004
#34
2006-05-09, 07:48 AM
UncleJohnsBand Wrote:You can use this code to find where GBPVR is installed:

static string DATABASE_FILE = "gbpvr.mdb";

RegistryKey SUBKEY;
RegistryKey TAWKAY = RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine,"");
string subkey = "Software\\devnz";
SUBKEY = TAWKAY.OpenSubKey(subkey);
strPath = (string) SUBKEY.GetValue("GBPVR InstallDir");
Console.WriteLine("Using Path " + strPath );

if ( File.Exists(strPath + DATABASE_FILE) == false )
{
Console.WriteLine("File not found");
return ( false );
}
return ( true );


I did it like this :-

Code:
[color=MediumTurquoise]RegistryKey[/color] regKey = [color=MediumTurquoise]Registry[/color].LocalMachine.OpenSubKey([color=DarkRed]@"Software\Devnz"[/color]);
if (regKey != [color=Blue]null[/color])
    [color=Blue]return [/color]([color=Blue]string[/color])regKey.GetValue([color=DarkRed]"GBPVR InstallDir"[/color]);

Then i added "gbpvr.exe" to the string, then if that file exists (via File.Exists call) i run it with a parameter of "-import"

I think what is happening is that the generated xml file isn't in the gbpvr program folder and/or it isn't called recording-dump.xml. Which is what GBPVR -import reads in. I tried passing the actual filename and deleting the recording-dump.xml file, and i got "recording-dump.xml not found" back as an error.

Thanks for the effort, but i don't think my code is the problem (based on what info i have so far Smile)

Regards.
GBPVR: v0.99.5
Server: Athlon64 X2 3800+, 2GB Memory, 1480GB Storage, 6 DVB-T Tuners (2 x Nova-T 500 PCI, 2 x Nova-T PCI)
HTPC: Athlon64 3000+, 1GB Memory, 80GB Storage, Blackgold GDI DVB-T Tuner, Ahanix MCE-302 Case, MSI K8NGM2-FID motherboard
Main TV: Toshiba 42WLT66 LCD
Media Playback: 2 x MVP (wired)
Homepage: http://www.sixgun.co.uk/
Author of MpegImport utility
ubu
Offline

Posting Freak

Posts: 792
Threads: 54
Joined: Jan 2006
#35
2006-05-09, 08:41 AM
OK - I see what happened. That's not real intuitive. Since MpegImport lets the user choose an output file for the mpegs to import (I entered "C:\Program Files\devnz\gbpvr\oldmpgs.xml") it is implied that the Import button will use that file for the GBPVR import.

In my case, I had done an export from GBPVR (just in case anything went wrong with the import from MpegImport) before I started, so I guess when I used the Import button GBPVR simply imported from the recordings-dump.xml file and, therefore, did not pick up the new recordings. When I imported using the button in GBPVR config, it let me choose a file so I selected oldmpgs.xml and the import picked up the new stuff.

sixgun Wrote:I just tried passing the filename of the xml file that MpegImport generates and GBPVR didn't take it.
Maybe there's a non-obvious way to pass the file as a parameter.
Quote:3. Temporarily copy the generated file to the correct place (restoring what was there, if anything, afterwards)
But, i'm not really sure which is best, as i don't know how people use it. My guess is that 3 would be best as it's totally transparent to the user and leaves everything as it was before. Unfortunately, it's also the most work.
Not necessarily. Can't you just use the System.IO.File class to do something like:

Code:
String gbpvrHomeDir = //<my earlier code snippet>
String gbpvrDumpFile = gbpvrHomeDir + recording-dump.xml";
String mpegImportFile = "blah\\blah\\blah.xml";
if (File.Exists(gbpvrDumpFile ))              
     File.Move(gbpvrDumpFile , gbpvrDumpFile + "temp");
File.Copy(mpegImportFile, gbpvrDumpFile);
// do the GBPVR import here
File.Delete(gbpvrDumpFile);
if (File.Exists(gbpvrDumpFile + "temp"))
     File.Move(gbpvrDumpFile + "temp", gbpvrDumpFile);
Cheers!
[SIZE=1]GBPVR v1.3.11 [/SIZE][SIZE=1]HVR-1250, [/SIZE][SIZE=1]ES7300[/SIZE][SIZE=1], 4GB, GeForce 9300, LianLi, Vista.[/SIZE]
[SIZE=1]GBPVR v1.0.08 [/SIZE][SIZE=1]PVR-150, [/SIZE][SIZE=1]P4 2.26GHz, [/SIZE][SIZE=1]1GB,[/SIZE][SIZE=1] GeForce 6200, [/SIZE]Coupden, XP[SIZE=1]
[/SIZE]

Author: UbuStream plugin, UbuRadio plugin, EPGExtra utility.
sixgun
Offline

Member

Posts: 197
Threads: 35
Joined: Sep 2004
#36
2006-05-09, 08:50 AM
ubu Wrote:OK - I see what happened. That's not real intuitive. Since MpegImport lets the user choose an output file for the mpegs to import (I entered "C:\Program Files\devnz\gbpvr\oldmpgs.xml") it is implied that the Import button will use that file for the GBPVR import.

In my case, I had done an export from GBPVR (just in case anything went wrong with the import from MpegImport) before I started, so I guess when I used the Import button GBPVR simply imported from the recordings-dump.xml file and, therefore, did not pick up the new recordings. When I imported using the button in GBPVR config, it let me choose a file so I selected oldmpgs.xml and the import picked up the new stuff.

Maybe there's a non-obvious way to pass the file as a parameter.
Not necessarily. Can't you just use the System.IO.File class to do something like:

Code:
String gbpvrHomeDir = //<my earlier code snippet>
String gbpvrDumpFile = gbpvrHomeDir + recording-dump.xml";
String mpegImportFile = "blah\\blah\\blah.xml";
if (File.Exists(gbpvrDumpFile ))              
     File.Move(gbpvrDumpFile , gbpvrDumpFile + "temp");
File.Copy(mpegImportFile, gbpvrDumpFile);
// do the GBPVR import here
File.Delete(gbpvrDumpFile);
if (File.Exists(gbpvrDumpFile + "temp"))
     File.Move(gbpvrDumpFile + "temp", gbpvrDumpFile);
Cheers!

Glad you understood me. Sometimes i have to re-explain myself a few times until i find the right level for someone. Most people i deal with on things of this nature are not "programmer" level.

As for that last code snippet, that's pretty much what i would have done, and what i meant by the most work !! (Aren't all programmers inherently lazy?!)

I think i'll use the built in windows temp file stuff though, as that guarantees a unique filename.

I'll get a release done sometime this week hopefully. I'm waiting for GoodGuys to send me an example filename with some hebrew characters in it, in order to support 16-bit characters in the filenames. So, i'll get that fixed too.

Thanks.
GBPVR: v0.99.5
Server: Athlon64 X2 3800+, 2GB Memory, 1480GB Storage, 6 DVB-T Tuners (2 x Nova-T 500 PCI, 2 x Nova-T PCI)
HTPC: Athlon64 3000+, 1GB Memory, 80GB Storage, Blackgold GDI DVB-T Tuner, Ahanix MCE-302 Case, MSI K8NGM2-FID motherboard
Main TV: Toshiba 42WLT66 LCD
Media Playback: 2 x MVP (wired)
Homepage: http://www.sixgun.co.uk/
Author of MpegImport utility
ubu
Offline

Posting Freak

Posts: 792
Threads: 54
Joined: Jan 2006
#37
2006-05-09, 09:18 AM
sixgun Wrote:As for that last code snippet, that's pretty much what i would have done, and what i meant by the most work !! (Aren't all programmers inherently lazy?!)
Didn't mean to teach my grandmother to suck eggs (or "preach to the choir" for US readers).Smile Larry Wahl (the inventor of Perl) said that the most important qualities of a good programmer are "laziness, impatience and hubris". Spot on, in my experience.

Quote:I think i'll use the built in windows temp file stuff though, as that guarantees a unique filename.
Am I missing something? Is this a built in .Net capability?

Quote:I'll get a release done sometime this week hopefully.
At least it's raining there. Easier to write code when its raining. Here in California its sunny and in the high 70s (mid 20s in centigrade, I guess) so my productivity is suffering. (I know its raining in the UK from the GBPVR Weather plugin which I have set to show the weather both here and in Shropshire where my family lives).
[SIZE=1]GBPVR v1.3.11 [/SIZE][SIZE=1]HVR-1250, [/SIZE][SIZE=1]ES7300[/SIZE][SIZE=1], 4GB, GeForce 9300, LianLi, Vista.[/SIZE]
[SIZE=1]GBPVR v1.0.08 [/SIZE][SIZE=1]PVR-150, [/SIZE][SIZE=1]P4 2.26GHz, [/SIZE][SIZE=1]1GB,[/SIZE][SIZE=1] GeForce 6200, [/SIZE]Coupden, XP[SIZE=1]
[/SIZE]

Author: UbuStream plugin, UbuRadio plugin, EPGExtra utility.
sixgun
Offline

Member

Posts: 197
Threads: 35
Joined: Sep 2004
#38
2006-05-09, 09:23 AM
ubu Wrote:Am I missing something? Is this a built in .Net capability?

Don't know if it's built in to .NET, but i'm sure i've used it before. When i "find" it again, i'll pass on what i find.

Quote:At least it's raining there. Easier to write code when its raining. Here in California its sunny and in the high 70s (mid 20s in centigrade, I guess) so my productivity is suffering. (I know its raining in the UK from the GBPVR Weather plugin which I have set to show the weather both here and in Shropshire where my family lives).

A typical summer day! It was great at the weekend and late last week. Took the long drive home with the top down on friday. Paintballing on saturday was a bit sweaty though. It was supposed to rain, but ended up being a scorcher (for early may). Sunday was rubbish though, rained pretty much all day long. Still didn't stop me wearing my shorts though Smile
GBPVR: v0.99.5
Server: Athlon64 X2 3800+, 2GB Memory, 1480GB Storage, 6 DVB-T Tuners (2 x Nova-T 500 PCI, 2 x Nova-T PCI)
HTPC: Athlon64 3000+, 1GB Memory, 80GB Storage, Blackgold GDI DVB-T Tuner, Ahanix MCE-302 Case, MSI K8NGM2-FID motherboard
Main TV: Toshiba 42WLT66 LCD
Media Playback: 2 x MVP (wired)
Homepage: http://www.sixgun.co.uk/
Author of MpegImport utility
sixgun
Offline

Member

Posts: 197
Threads: 35
Joined: Sep 2004
#39
2006-05-09, 12:30 PM
ubu Wrote:
Quote:I think i'll use the built in windows temp file stuff though, as that guarantees a unique filename.
Am I missing something? Is this a built in .Net capability?

The call is :-

Code:
System.IO.Path.GetTempFileName()

I've written the code that will temporarily copy the generated xml file to the right place for GBPVR.EXE to pick it up properly.

Just waiting on GoodGuys now for those files. Smile

Regards.
GBPVR: v0.99.5
Server: Athlon64 X2 3800+, 2GB Memory, 1480GB Storage, 6 DVB-T Tuners (2 x Nova-T 500 PCI, 2 x Nova-T PCI)
HTPC: Athlon64 3000+, 1GB Memory, 80GB Storage, Blackgold GDI DVB-T Tuner, Ahanix MCE-302 Case, MSI K8NGM2-FID motherboard
Main TV: Toshiba 42WLT66 LCD
Media Playback: 2 x MVP (wired)
Homepage: http://www.sixgun.co.uk/
Author of MpegImport utility
GoodGuys
Offline

Senior Member

Posts: 433
Threads: 41
Joined: Jun 2005
#40
2006-05-09, 08:50 PM
OK. First file was sent 10 minutes ago in a zip file.
Here's the sample filename:

שתים עשר הממלכות_20060410_23002330.mpg

Sixgun - I am in the process of creating another zip file with multiple other filenames.

Specifically, I will include files with both Hebrew and English in them.

GGF
AMD64 3000+, MSI-Neo4F, 1GB, 1.5TB WD-SATA, PVR350+150 34btn remote, ATI 2460HD TVOut, 1.4.7: VMR9fse, CS3 skin
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (7): « Previous 1 2 3 4 5 6 7 Next »
Jump to page 


Possibly Related Threads…
Thread Author Replies Views Last Post
  Wiki updates for NextPVR 2.3.6 McBainUK 3 2,804 2012-02-19, 10:18 AM
Last Post: Grampz
  New wiki entry: RecoverRecordings pBS 11 4,263 2010-01-29, 08:16 AM
Last Post: pBS
  Auto restart recording service utility gEd 79 30,691 2010-01-13, 05:16 PM
Last Post: liteswap
  Showname - Rename utility for GBPVR recordings Anthony 0 1,584 2009-03-05, 05:40 PM
Last Post: Anthony
  WIKI Status fhmanas 3 2,036 2009-03-04, 02:06 PM
Last Post: McBainUK
  Utility to help with Channel Scanning timh 8 4,215 2009-02-09, 12:49 PM
Last Post: timh
  BurndvdX2 Version 1.0.1.8 posted to wiki pastro 1 1,563 2009-02-04, 03:50 AM
Last Post: pbb
  Wiki Plugin/Skin housekeeping. Fatman_do 14 4,849 2008-12-11, 02:46 AM
Last Post: Fatman_do
  BitTorrent client added to the 'Ten Foot' products Andy Henderson 2 2,330 2007-10-16, 05:43 PM
Last Post: Andy Henderson
  I-xmltv: TV Guide customization & Zap2It EPG utility. Jim_ 304 103,412 2007-09-18, 02:20 PM
Last Post: lrf2005

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

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

Linear Mode
Threaded Mode