NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 25 26 27 28 29 93 Next »
INI, Text File Reader...

 
  • 0 Vote(s) - 0 Average
INI, Text File Reader...
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#31
2009-02-11, 08:49 AM
zehd Wrote:I was able to iterate through the categories and compare to a string. I can then skip processing that record

Code:
If p.Categories.Count > 0 Then
                For i = 0 To p.Categories.Count - 1
                    If p.Categories.Item(i).Text = "Paid Programming" Then
                        If p.SecondaryTitle IsNot Nothing AndAlso p.SecondaryTitle.Count <> 0 Then
                            p.SecondaryTitle(0).Text = "Blah Blah"
                        End If
                        PaidAds = PaidAds + 1
                        'I want to skip querying this
                        GoTo GoAhead
                    End If
                Next
            End If

Do you think that if you caught this while deserialization it would be faster?
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#32
2009-02-11, 12:13 PM
zehd Wrote:Do you think that if you caught this while deserialization it would be faster?
If you are only doing it once, it should take the same amount of time but we can test it and see.
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#33
2009-02-12, 04:09 AM
whurlston Wrote:If you are only doing it once, it should take the same amount of time but we can test it and see.

Man is what I have so far fast...

So far I'm iterating the programs, counting and skipping the paid ads, quering TVDB.com for any match with Title and Sub_Title, using the cache extensively...

My XML Cache read routines are very fast, and if there are no downloads needed (like if its the second time I'm doing it today, and therefore it knows that nothing new is available) I can do 26000 records in a minute or so (I haven't put a timer on the whole process yet...)

[ATTACHMENT NOT FOUND]

Code:
=============
2009-02-11 8:58:56 PM :> Loading XMLTV file...
2009-02-11 8:59:00 PM :> 26239 records
2009-02-11 9:01:14 PM :> Writing File...
2009-02-11 9:01:17 PM :> Complete Parsing XMLTV file.

What I found cool was There were only 11000 valid potential queries, and I got 4000 actual responses from the xml cache. There were lots of 'No Data Existing' shows, that I efficiently skip. I've also built in a show a manager, that will help with the 'Wrong.Data' shows, that you just KNOW data exists...\

TV Guide say 'The Office', but we should really pulling xml for 'The Office (US)'

I'm using all variables and arraylists, and the whole thing works WITHOUT the RS interacting with Desktop

Now All I need is to be able to write new data to tags...
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#34
2009-02-14, 08:57 AM (This post was last modified: 2009-02-14, 09:17 AM by whurlston.)
Quick question:

Will this work for you?

Code:
If p.IsPaidProgramming Then
   p.AddSecondaryTitle("Blah Blah")
ElseIf
   'do stuff
EndIf

or

Code:
[I]'The "true" tells it to only do it when
'the categories contains "Paid Programming"
'You would call this once on the Tv class and it
'would iterate through the programmes automatically[/I]

[color=Red][B]tv.AddSecondaryTitles("Blah Blah", true)[/B][/color]

[I]'Then when processing other stuff:[/I]

[B][color=red]If IsNot p.IsPaidProgramming[/color][/B]
  [I]'do stuff[/I]
[B][color=red]EndIf[/color][/B]
And do you only want to add it if the SecondaryTitle(0) doesn't exist?
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#35
2009-02-14, 10:15 AM
whurlston Wrote:Quick question:

Will this work for you?

Code:
If p.IsPaidProgramming Then
   p.AddSecondaryTitle("Blah Blah")
ElseIf
   'do stuff
EndIf

or

Code:
[I]'The "true" tells it to only do it when
'the categories contains "Paid Programming"
'You would call this once on the Tv class and it
'would iterate through the programmes automatically[/I]

[color=Red][B]tv.AddSecondaryTitles("Blah Blah", true)[/B][/color]

[I]'Then when processing other stuff:[/I]

[B][color=red]If IsNot p.IsPaidProgramming[/color][/B]
  [I]'do stuff[/I]
[B][color=red]EndIf[/color][/B]
And do you only want to add it if the SecondaryTitle(0) doesn't exist?

Either would be fine. As I'm getting more comfortable, they both look good. Thanks for the patience...

I'd like to create Description, Secondary, and add a category
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#36
2009-02-14, 05:12 PM
I've already added the following methods

Code:
p.AddDescription("Some Description");
p.AddDescription(languagecode, "Some Description");
p.AddCategory("Some Category");
p.AddCategory(languagecode, "Some Category");

Which will add a description or category and also initialize the list if it's null.

Code:
p.HasDescriptions
p.HasCategories:

Which are simple bools.

Also added a couple of new constructors:

Code:
new Tv("myGuide.xml")
new Tv("myGuide.xml", true)

Which will automatically read the specified file when creating the new instance of the Tv object. The second one with the "true" parameter tells it to initialize empty lists so that if the say p.Description is null, it will initialize it and add an blank entry for p.Description(0). So if you checked p.Description(0).Text, it would be an empty string (but you could access it). p.HasDescription would still return false if it only has the blank entry.

Currently, only the Categories and Descriptions are being initialized, but I'll initialize pretty much all the lists when I'm done.
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#37
2009-02-14, 07:56 PM
Another thing, that might be fixable on your end or mine, don't know...

Before Process
Code:
    <programme start="20090213170000 [color=Red]-0700[/color]" stop="20090213180000 [color=Red]-0700[/color]" channel="I2.28460209.microsoft.com">
        <title lang="en">American Idol Rewind</title>
        <sub-title lang="en">New Orleans Auditions</sub-title>
        <desc lang="en">Hopefuls audition for season 4 in New Orleans.</desc>
        <date>20090206</date>
        <category lang="en">Episodic</category>
        <category lang="en">Music</category>
        <category lang="en">Reality</category>
        <category lang="en">Series</category>
        <episode-num system="onscreen">311</episode-num>
        <episode-num system="dd_progid">EP00848801.0066</episode-num>
        <audio>
            <stereo>stereo</stereo>
        </audio>
        <previously-shown start="20090206000000" />
        <subtitles type="teletext" />
    </programme>


After Process
Code:
<programme start="20090213170000 [color=Red]+0000[/color]" stop="20090213180000 [color=Red]+0000[/color]" channel="I2.28460209.microsoft.com">
    <title lang="en">American Idol Rewind</title>
    <sub-title lang="en">-New Orleans Auditions</sub-title>
    <desc lang="en">Hopefuls audition for season 4 in New Orleans.</desc>
    <date>20090206</date>
    <category lang="en">Episodic</category>
    <category lang="en">Music</category>
    <category lang="en">Reality</category>
    <category lang="en">Series</category>
    <episode-num system="onscreen">311</episode-num>
    <episode-num system="dd_progid">EP00848801.0066</episode-num>
    <audio>
      <stereo>stereo</stereo>
    </audio>
    <previously-shown start="20090206000000" />
    <subtitles type="teletext" />
  </programme>

I'm not sure if I'm triggering something or not, but the offset is getting zeroed... Is there a method I may have called that is doing that?

Oh and one more thing (yeah like it's ever going to be over!!!)

I've been trying to load some UK xmltv files and I think the parser is choking because in the Programme Start attribute, it does not have an offset...
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#38
2009-02-14, 08:02 PM
whurlston Wrote:I've already added the following methods

Code:
p.AddDescription("Some Description");
p.AddDescription(languagecode, "Some Description");
p.AddCategory("Some Category");
p.AddCategory(languagecode, "Some Category");

Which will add a description or category and also initialize the list if it's null.

Code:
p.HasDescriptions
p.HasCategories:

Which are simple bools.

Also added a couple of new constructors:

Code:
new Tv("myGuide.xml")
new Tv("myGuide.xml", true)

Which will automatically read the specified file when creating the new instance of the Tv object. The second one with the "true" parameter tells it to initialize empty lists so that if the say p.Description is null, it will initialize it and add an blank entry for p.Description(0). So if you checked p.Description(0).Text, it would be an empty string (but you could access it). p.HasDescription would still return false if it only has the blank entry.

Currently, only the Categories and Descriptions are being initialized, but I'll initialize pretty much all the lists when I'm done.

My code is much tighter and cleaner and more reusable code. (nice to start over) I have been having some trouble with the damn '.net doesn't use variants' snag. (I though I read that THAT is probably one of the things that made other Platform Devs, turn their knows up on VB6 :-) )

However, I suspect using

Code:
if p.hasDescription then 'already boolean
   blah
else
  blah2
end if

is going to be great

Edit: And yet another thing...

How about a Stop Processing method, so that when I cancel a iteration, I can release the file without first 'writeto' writing out the file...
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#39
2009-02-15, 04:37 AM
zehd Wrote:I'm not sure if I'm triggering something or not, but the offset is getting zeroed... Is there a method I may have called that is doing that?
Probably on my end, I'll check into it.

zehd Wrote:Oh and one more thing (yeah like it's ever going to be over!!!)

I've been trying to load some UK xmltv files and I think the parser is choking because in the Programme Start attribute, it does not have an offset...
Can you upload a copy of the file for me?

zehd Wrote:How about a Stop Processing method, so that when I cancel a iteration, I can release the file without first 'writeto' writing out the file...
Not exactly sure what you mean by this. You mean you want to cancel all the changes? If so and you haven't already called WriteTo, you can just set Tv = null to release it.
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#40
2009-02-15, 05:05 AM
Here's a sample from UK (Birtles)

Regarding a Stop...

your dll, loads a file into a structure, and I iterate through it one record at a time.

When I click 'Stop' I set a variable that is read during that iteration, where I can exit the loop.

During the exit I could also send the WriteTo method, but then the dll writes out a full sized file, (only some of the changes made, to the point of where I stopped it)

However, I was hoping somewhere in your code, you'd be able to stop the processing and only write out the records that were modified... though with serialization, I'm thinking all or nothing.

The reason I wanted this was, when I saw an error, O wanted to be able to rewrite the xmltv file using other code,but xmltv.dll won't release the file unless it was writtenout...

And one more thing... don't know if you can see this on the foum but accented characters are getting messed...

I'm losing accented characters...

Before
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
....

    <programme start="20090220130000 -0700" stop="20090220140000 -0700" channel="I6.28458286.microsoft.com">
        <title lang="en">The Martha Stewart Show</title>
        <desc lang="en">Chef José Andrés demonstrates how versatile potatoes can be with three Spanish-inspired recipes; the Daylesford Organic Farm in England; Martha reveals her latest must-have item.</desc>
        <credits>
            <presenter>Martha Stewart</presenter>
        </credits>
        <date>20090108</date>
        <category lang="en">Cooking</category>
        <category lang="en">Episodic</category>
        <category lang="en">Series</category>
        <category lang="en">Talk Show</category>

After:
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
...
  <programme start="20090220130000 +0000" stop="20090220140000 +0000" channel="I6.28458286.microsoft.com">
    <title lang="en">The Martha Stewart Show</title>
    <desc lang="en">Chef Jos� Andr�s demonstrates how versatile potatoes can be with three Spanish-inspired recipes; the Daylesford Organic Farm in England; Martha reveals her latest must-have item.</desc>
    <credits>
      <presenter>Martha Stewart</presenter>
    </credits>
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
« 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
  How Does "Use S01E01 File naming format if possible" work puck64 7 5,342 2015-08-25, 10:21 AM
Last Post: puck64
  NEWA - using buffer file produced by /public/VLCService?Channel= bgowland 5 2,811 2014-01-02, 06:36 AM
Last Post: bgowland
  Is the input file for pvrx2.exe -import unique to NextPVR? spinnaker 1 1,776 2013-10-08, 02:25 AM
Last Post: sub
  Accessing music file metadata in C# bgowland 6 3,310 2013-01-26, 05:14 AM
Last Post: bgowland
  RSS Reader tmrt 51 18,215 2011-02-21, 07:22 AM
Last Post: tmrt
  File browsing - a big ask imilne 3 1,999 2010-11-04, 09:03 PM
Last Post: imilne
  Run Multiple File Conversions On Your 4 Core -Burn Your Processor luttrell1962 12 4,582 2010-03-25, 07:33 AM
Last Post: luttrell1962
  Determining text size and available space Ommina 2 1,667 2010-03-15, 05:34 AM
Last Post: sub
  Using Windows file system shortcuts ACTCMS 0 1,808 2010-01-26, 11:45 PM
Last Post: ACTCMS
  Not looking in correct location for skin file scb147 4 2,219 2009-07-29, 06:26 PM
Last Post: scb147

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

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

Linear Mode
Threaded Mode