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
#41
2009-02-15, 05:06 AM (This post was last modified: 2009-02-15, 05:11 AM by zehd.)
whurlston Wrote:If so and you haven't already called WriteTo, you can just set Tv = null to release it.

I'll try this

Edit: works...
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
#42
2009-02-15, 06:09 AM (This post was last modified: 2009-02-15, 06:17 AM by whurlston.)
zehd Wrote: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...
Ah. You mean the file remains locked and you can't write to it from another process. That's a bug in my code then. It should unlock the file as soon as the ReadFrom() process completes. I'll double check my code.

One thing though, if you write to the file from a separate process, the data that you have already loaded into your Tv object will not show the new information until you have it read the file again.

zehd Wrote: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...
That shouldn't be happening with that encoding set. I'll look into that too.
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#43
2009-02-15, 07:48 AM (This post was last modified: 2009-02-15, 07:56 AM by whurlston.)
The Birtles xmltv file is not quite xmltv compliant it seems. Specifically, the "generator-info-name" and "generator-info-url" attributes in the <tv> tag are shown as "generator-name" and "generator-url" instead so these tags will not get read. I can add a work around for this I think.

But that's not what's causing the deserialization failure, it's the date attribute in the <tv> tag. I took the format from the xmltv na_dd grabber but apparently I need to be more lenient in the format. I'll fix this as well.

As for the time offset issue, I was not properly converting to UTC time. I've corrected this for the next build.

I've also fixed an issue where <previously-shown /> would actually get output as <previously-shown date="00010101000000">
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#44
2009-02-15, 04:27 PM
whurlston Wrote:The Birtles xmltv file is not quite xmltv compliant it seems. Specifically, the "generator-info-name" and "generator-info-url" attributes in the <tv> tag are shown as "generator-name" and "generator-url" instead so these tags will not get read. I can add a work around for this I think.

But that's not what's causing the deserialization failure, it's the date attribute in the <tv> tag. I took the format from the xmltv na_dd grabber but apparently I need to be more lenient in the format. I'll fix this as well.

As for the time offset issue, I was not properly converting to UTC time. I've corrected this for the next build.

I've also fixed an issue where <previously-shown /> would actually get output as <previously-shown date="00010101000000">

All sounds good... When I was writing VB6-Ultra my way, I was opening and reading the file line by line as text and deciding what the tag was etc... So I could open anything and just adjust the parsing. That's why it was necessary to run a quick "is this DTD compliant?" check, which I still haven't found as easy a way as I have in VB6. But this check allowed for the lesser strict files...

According to the DTD, you don't need offset times in Programme.Start tags, and it shouldn't matter what is in the opening message <xml... generator etc...>

I'm seeing how your code works though, and it does a fair amount of strict assumption. Maybe I should make available to you all my test xmltv.xml I've gathered from around the world...
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
#45
2009-02-15, 10:27 PM
zehd Wrote:Maybe I should make available to you all my test xmltv.xml I've gathered from around the world...
Just email me any files that you run into problems with and I'll fix it. I'll have a new build for you later tonight with the updates we've discussed.
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#46
2009-02-16, 06:26 AM
zehd Wrote:According to the DTD, you don't need offset times in Programme.Start tags, and it shouldn't matter what is in the opening message <xml... generator etc...>
You are right that the DTD is pretty lenient about the date but it specifically defines the attribute names for the tv tag:
Code:
121 <!ATTLIST tv date   CDATA #IMPLIED
  122              source-info-url     CDATA #IMPLIED
  123              source-info-name    CDATA #IMPLIED
  124              source-data-url     CDATA #IMPLIED
  125              generator-info-name CDATA #IMPLIED
  126              generator-info-url  CDATA #IMPLIED >

The data in those attributes of course can be anything.
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#47
2009-02-16, 09:52 AM
Ok, a quick test of the following code:

Code:
Dim ppTitles As Long = 0
Dim test As New XmlTv.Tv(originalFile, True)
test.AddSecondaryTitles("Blah Blah", True, ppTitles)
For Each p As XmlTv.Programme In test.Programmes
    If Not p.IsPaidProgramming Then
        p.Description_0 = (p.Title(0).Text & ". ") + p.Description_0
    End If
Next
test.WriteTo(newFile, True)

produced the following results:

Code:
Program Count: 27908
Paid Count: 3963
File read time: 3.315 seconds
Processing Time: 0.463 seconds
File Write Time: 3.806 seconds
Total Time: 7.584 seconds

Basically, I changed the secondary title on all Paid Programming then I added the program title to start of the description on everything that wasn't paid programming.

I'll do a final test tomorrow making sure I got everything we talked about and then send you the build.
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#48
2009-02-16, 10:17 AM
whurlston Wrote:Ok, a quick test of the following code:

Code:
Dim ppTitles As Long = 0
Dim test As New XmlTv.Tv(originalFile, True)
test.AddSecondaryTitles("Blah Blah", True, ppTitles)
For Each p As XmlTv.Programme In test.Programmes
    If Not p.IsPaidProgramming Then
        p.Description_0 = (p.Title(0).Text & ". ") + p.Description_0
    End If
Next
test.WriteTo(newFile, True)

produced the following results:

Code:
Program Count: 27908
Paid Count: 3963
File read time: 3.315 seconds
Processing Time: 0.463 seconds
File Write Time: 3.806 seconds
Total Time: 7.584 seconds

Basically, I changed the secondary title on all Paid Programming then I added the program title to start of the description on everything that wasn't paid programming.

I'll do a final test tomorrow making sure I got everything we talked about and then send you the build.

You timed the read, process and write, and the process was only .4 seconds?
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
#49
2009-02-16, 09:05 PM
zehd Wrote:You timed the read, process and write, and the process was only .4 seconds?

Yup. Process time was the time it took to add the secondary titles to the Paid Programming and add the titles to the description on everything else. Reads and writes actually took longer than the processing. Now I have a fairly fast machine but it still gives you an idea of the possibilities.
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#50
2009-02-16, 11:36 PM
Try this dll. It is more lenient on date formats. If it hits a date format that it doesn't recognize, it will throw an error. Just let me know if it happens and I'll add any new formats you need.

You can see from my above example how to set the paid programming secondary titles and also there are a couple of new fields in the Programmes:

Description_0
Category_0
SecondaryTitle_0

These will give you direct access to p.Description(0).Text, etc. On gets, it will return an empty string if it doesn't exist and on sets, it will create it if it doesn't exist. This way, you don't need to do any checking on them (see above example again).

There are also some new bools like p.HasCategories, p.HasDescriptions, etc. I've also added a method to write the xml file without writing out the DTD since you shouldn't really need it anymore. Writes and reads are now better optimized and should no longer keep a lock on the file once the read/write process completes.

I've documented most of the new stuff so when you click on them in your Object Browser, it will tell you what it does.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (7): « Previous 1 … 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,535 2015-08-25, 10:21 AM
Last Post: puck64
  NEWA - using buffer file produced by /public/VLCService?Channel= bgowland 5 2,960 2014-01-02, 06:36 AM
Last Post: bgowland
  Is the input file for pvrx2.exe -import unique to NextPVR? spinnaker 1 1,843 2013-10-08, 02:25 AM
Last Post: sub
  Accessing music file metadata in C# bgowland 6 3,457 2013-01-26, 05:14 AM
Last Post: bgowland
  RSS Reader tmrt 51 18,580 2011-02-21, 07:22 AM
Last Post: tmrt
  File browsing - a big ask imilne 3 2,090 2010-11-04, 09:03 PM
Last Post: imilne
  Run Multiple File Conversions On Your 4 Core -Burn Your Processor luttrell1962 12 4,810 2010-03-25, 07:33 AM
Last Post: luttrell1962
  Determining text size and available space Ommina 2 1,754 2010-03-15, 05:34 AM
Last Post: sub
  Using Windows file system shortcuts ACTCMS 0 1,863 2010-01-26, 11:45 PM
Last Post: ACTCMS
  Not looking in correct location for skin file scb147 4 2,330 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