home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Products
TV-Server
XmlTV: Parse the <new /> tag to obtain air date when <date> tag is missing?
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="ChaosMageX" data-source="post: 1157549" data-attributes="member: 155771"><p>Ah, I understand. I did not take that into account because I did not know that could be the case.</p><p></p><p></p><p></p><p>Thank you for these suggestions. I will most likely try out number one, since my main goal is to prevent automatically recording an episode that I have already recorded.</p><p></p><p>HOWEVER, I was looking over the code for the TVEngine.XMLTVImport.Import() function, and I now have a new question:</p><p></p><p>Why isn't the <date> tag actually parsed into a valid DateTime and used in the TvDatabase.Program class constructor?</p><p></p><p>Instead I see that the <date> string is disregarded entirely even when it is a valid string and System.Data.SqlTypes.SqlDateTime.MinValue.Value is used as the argument for originalAirDate constructor parameter instead. Why can't you implement code that parses it in a similar way the start date/time and end date/time are parsed?</p><p></p><p>Something like this could work:</p><p></p><p><span style="font-family: 'Courier New'">long originalAirDate = datetolong(System.Data.SqlTypes.SqlDateTime.MinValue.Value);</span></p><p><span style="font-family: 'Courier New'">if (nodeDate != null && nodeDate.Length >= 8)</span></p><p><span style="font-family: 'Courier New'">{</span></p><p><span style="font-family: 'Courier New'"> originalAirDate = 1000000 * Int64.Parse(node.Substring(0, 8)); //20040331</span></p><p><span style="font-family: 'Courier New'">}</span></p><p><span style="font-family: 'Courier New'">originalAirDate = CorrectIllegalDateTime(originalAirDate);</span></p><p></p><p>Then you could send <span style="font-family: 'Courier New'">longtodate(originalAirDate)</span> as the argument for the originalAirDate parameter in the TvDatabase.Program class constructor, unless there's a reason not to assume that the <date> tag's data will be in the format YYYYMMDD. Is there a reason not to assume that? Are there examples of the <date> string being in a different format?</p></blockquote><p></p>
[QUOTE="ChaosMageX, post: 1157549, member: 155771"] Ah, I understand. I did not take that into account because I did not know that could be the case. Thank you for these suggestions. I will most likely try out number one, since my main goal is to prevent automatically recording an episode that I have already recorded. HOWEVER, I was looking over the code for the TVEngine.XMLTVImport.Import() function, and I now have a new question: Why isn't the <date> tag actually parsed into a valid DateTime and used in the TvDatabase.Program class constructor? Instead I see that the <date> string is disregarded entirely even when it is a valid string and System.Data.SqlTypes.SqlDateTime.MinValue.Value is used as the argument for originalAirDate constructor parameter instead. Why can't you implement code that parses it in a similar way the start date/time and end date/time are parsed? Something like this could work: [FONT=Courier New]long originalAirDate = datetolong(System.Data.SqlTypes.SqlDateTime.MinValue.Value); if (nodeDate != null && nodeDate.Length >= 8) { originalAirDate = 1000000 * Int64.Parse(node.Substring(0, 8)); //20040331 } originalAirDate = CorrectIllegalDateTime(originalAirDate);[/FONT] Then you could send [FONT=Courier New]longtodate(originalAirDate)[/FONT] as the argument for the originalAirDate parameter in the TvDatabase.Program class constructor, unless there's a reason not to assume that the <date> tag's data will be in the format YYYYMMDD. Is there a reason not to assume that? Are there examples of the <date> string being in a different format? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Products
TV-Server
XmlTV: Parse the <new /> tag to obtain air date when <date> tag is missing?
Contact us
RSS
Top
Bottom