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
#51
2009-02-16, 11:49 PM
whurlston Wrote: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.

Awesome work.. Sorry to keep you in suspense, but I won't be able to work with it for another couple of days now... I'm excited though....
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
#52
2009-02-17, 08:09 AM
No worries, I'm sure I can find other things to occupy my time. Wink
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#53
2009-02-17, 11:24 PM
Here are a couple of things I noticed...

I notice with Category_0 you give me the text of the first Category. Would you be able to string all the categories into a comma delimited

line?

"Series, Soap Opera, Episodic" -- I would split the text up if I needed it separated, so maybe no spaces [Cat1],[Cat2]

My current routine iterates the Categories() and searches for items ( Skip: 'News', 'Soap Opera', 'Game Show', 'Talk Show' ) ((I was doing

that for Paid Programming too. But I think your function would be faster. I could then just search the text rather than iterate...

Maybe the same for Actors, Guests, Credits etc...

To mark Paid Programming, is there a value I can set externally to change the search pattern. I think Paid Programming is called other things in other countries.

The Time Offset is still not working.

The XML is being written in UTF-8. My originals are written in Ansi, and so the special characters display... Maybe your are checking how it displays in GB-PVR? I'm currently checking with notepad...

---

Of course the two things that are really trouble are the encoding and time offsets.. I am getting around the other things. But the variable that you added have already sped things up... :-)
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
#54
2009-02-18, 01:13 AM
zehd Wrote:Here are a couple of things I noticed...

I notice with Category_0 you give me the text of the first Category. Would you be able to string all the categories into a comma delimited line?

"Series, Soap Opera, Episodic" -- I would split the text up if I needed it separated, so maybe no spaces [Cat1],[Cat2]

My current routine iterates the Categories() and searches for items ( Skip: 'News', 'Soap Opera', 'Game Show', 'Talk Show' ) ((I was doing that for Paid Programming too. But I think your function would be faster. I could then just search the text rather than iterate...

Maybe the same for Actors, Guests, Credits etc...

To mark Paid Programming, is there a value I can set externally to change the search pattern. I think Paid Programming is called other things in other countries.
I can add these easily enough.

zehd Wrote:The Time Offset is still not working.
All offsets are now converted to UTC (+0000) when written, so if something was "20080101000000 -7000" it will be changed to "20080101070000 +0000". It should end up displaying in the same timeslot. Is there any particular reason that you need it to output the local time offset? There can be complications with that if you read a file produced by someone in a different timezone from yours. When rewriting the file, it will be written with your local offset instead of their's like it was originally.

zehd Wrote:The XML is being written in UTF-8. My originals are written in Ansi, and so the special characters display... Maybe your are checking how it displays in GB-PVR? I'm currently checking with notepad...

---
It should now be written in ISO-8859-1, not UTF-8. I can let you specify the encoding but I recommend sticking with ISO-8859-1. If you only need the ANSI for checks in notepad, I highly recommend switching to Notepad++.
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#55
2009-02-18, 10:56 PM
whurlston Wrote:All offsets are now converted to UTC (+0000) when written, so if something was "20080101000000 -7000" it will be changed to "20080101070000 +0000". It should end up displaying in the same timeslot. Is there any particular reason that you need it to output the local time offset? There can be complications with that if you read a file produced by someone in a different timezone from yours. When rewriting the file, it will be written with your local offset instead of their's like it was originally.

I didn't notice. I'll check

Quote:It should now be written in ISO-8859-1, not UTF-8. I can let you specify the encoding but I recommend sticking with ISO-8859-1. If you only need the ANSI for checks in notepad, I highly recommend switching to Notepad++.

OK. So in Notepad ++ I see this:

[ATTACHMENT NOT FOUND]

[ATTACHMENT NOT FOUND]

I search for "Chef Jos" in order to find the string...

I wasn't sure how we fixed it (or I I did a work around in Old Ultra, but I remember dealing with this last year. I don't know what the problem is, but I think the xml encoder in the header, is not necessarily the same as how the text file was generated...

I've included snips of original and new file generated. This is how I tested a year ago, and lately too...

The grabber creates a file which is written in ansi (even though it has an iso...header_ I check this by opening in Notepad and trying to 'save as'. And you see ANSI selected as default...

The file that is created by your dll, creates a file as UTF-8, regardless of the XML header.

I see the same whether Notepad or Notepad++

Looking at my old code, I know I did work around this problem. I had to deal with a Unicode, decode to UTF -8 etc stuff...

Here's the VB6 coding that might trigger something...

Code:
Open XMLFile For Input As #1

    If FileExists(XMLFile & ".tmp") Then Kill XMLFile & ".tmp"
    fso.CopyFile XMLFile, XMLFile & ".BeforeFixXML.xml"
    DoEvents
    Open XMLFile & ".tmp" For Append As #2
    
    Do While Not EOF(1)
        Line Input #1, strBuff
        strBuff = Unicode.DecodeUTF8(strBuff) 'converts Unicode to ANSI if necessary
        LineCounter = LineCounter + 1
        If strBuff <> "" Then Print #2, strBuff 'not program info
    Loop

Close #1
Close #2

This routine was used to read into new file, line by line....

I also needed to use the 'EncodeUTF8' function when playing with sqlite3 (in VB6)...
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
#56
2009-02-18, 10:58 PM
Note the status in Notepad++.... ANSI and ANSI as UTF-8

My feeling is, if the grabber creates the file in ANSI, then it should be no problem outputting into ANSI...
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
#57
2009-02-20, 04:27 AM
You sure you have the right copy of the dll in the working directory? That's not the results I'm seeing:

The header on the new file should now read "<?xml version="1.0" encoding="iso-8859-1"?>" instead of "<?xml version="1.0" encoding="utf8"?>" The last dll I posted has this change.
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#58
2009-02-20, 05:50 AM
whurlston Wrote:You sure you have the right copy of the dll in the working directory? That's not the results I'm seeing:

The header on the new file should now read "<?xml version="1.0" encoding="iso-8859-1"?>" instead of "<?xml version="1.0" encoding="utf8"?>" The last dll I posted has this change.

I'm pretty sure.

isocodes 1.0.0.0 v2.0.50727
and xmltv 1.0.0.1 v2.0.50727

Both file have the iso header, but the encoding itself to text file is using a different encoding. I still don't have a grasp, but here are a few links of guys with this issue and how they solved it...

http://www.google.ca/search?hl=en&q=vb.n...rt=10&sa=N

Apparently you can choose the encoding for the xml (which is in the header) and the encoding for the actual text writing...
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
#59
2009-02-20, 05:59 AM
I notice that I don't call the Initailze Boolean

xmltv.ReadFrom(XMLTVFile)

xmltv.WriteTo(XMLTVFile & ".new.xml")

Like you have in your most recent example. What does it it do? Is this my problem?
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
#60
2009-02-20, 06:07 AM (This post was last modified: 2009-02-20, 06:17 AM by whurlston.)
That's the right version and the Initialize boolean won't make a difference. I think I may know the cause of the issue though. Sending you an email.
« 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,346 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,778 2013-10-08, 02:25 AM
Last Post: sub
  Accessing music file metadata in C# bgowland 6 3,316 2013-01-26, 05:14 AM
Last Post: bgowland
  RSS Reader tmrt 51 18,216 2011-02-21, 07:22 AM
Last Post: tmrt
  File browsing - a big ask imilne 3 2,002 2010-11-04, 09:03 PM
Last Post: imilne
  Run Multiple File Conversions On Your 4 Core -Burn Your Processor luttrell1962 12 4,586 2010-03-25, 07:33 AM
Last Post: luttrell1962
  Determining text size and available space Ommina 2 1,668 2010-03-15, 05:34 AM
Last Post: sub
  Using Windows file system shortcuts ACTCMS 0 1,809 2010-01-26, 11:45 PM
Last Post: ACTCMS
  Not looking in correct location for skin file scb147 4 2,220 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