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
MediaPortal 1
WebService and Mobile Access
Self Contained Web Server / Interface
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="Big_Kev" data-source="post: 241953" data-attributes="member: 52102"><p>That would do it... I will update to the latest SVN and check it out...</p><p></p><p>Kev</p><p></p><p></p><p></p><p>The code below adds the scheduled recordings</p><p></p><p>[CODE] R->Close();</p><p> R->SQL->Clear();</p><p></p><p> R->SQL->Add("insert into Schedule (idChannel, scheduleType, programName, startTime, endTime, maxAirings, quality, directory, priority, keepDate, preRecordInterval, postRecordInterval, canceled, recommendedCard, keepMethod) values (:IDCHANNEL, :SCHEDULETYPE, :PROGRAMNAME, :STARTTIME, :ENDTIME, :MAXAIRINGS, :QUALITY, :DIRECTORY, :PRIORITY, :KEEPDATE, :PRERECORDINTERVAL, :POSTRECORDINTERVAL, :CANCELED, :RECOMMENDEDCARD, :KEEPMETHOD)");</p><p> TDateTime *Temp = new TDateTime(2000, 1, 1);</p><p></p><p> int TChannel = Q->FieldByName("idChannel")->AsInteger;</p><p> R->ParamByName("IDCHANNEL")->AsInteger = TChannel;</p><p> R->ParamByName("PROGRAMNAME")->AsString = Q->FieldByName("title")->AsString;</p><p> R->ParamByName("STARTTIME")->AsDateTime = Q->FieldByName("startTime")->AsDateTime;</p><p> R->ParamByName("ENDTIME")->AsDateTime = Q->FieldByName("endTime")->AsDateTime;</p><p> R->ParamByName("MAXAIRINGS")->AsInteger = 5;</p><p> R->ParamByName("QUALITY")->AsInteger = 0;</p><p> [COLOR="Red"][B]R->ParamByName("DIRECTORY")->AsString = " ";[/B][/COLOR]</p><p> R->ParamByName("PRIORITY")->AsInteger = 0;</p><p> R->ParamByName("PRERECORDINTERVAL")->AsInteger = FixedPreRecord;</p><p> R->ParamByName("POSTRECORDINTERVAL")->AsInteger = FixedPostRecord;</p><p> R->ParamByName("SCHEDULETYPE")->AsInteger = SchedType.ToIntDef(0);</p><p> R->ParamByName("CANCELED")->AsDateTime = *Temp;</p><p> R->ParamByName("KEEPDATE")->AsDateTime = *Temp;</p><p> delete Temp;</p><p> Q->Close();</p><p> Q->SQL->Clear();</p><p> Q->SQL->Add("select * from channelmap a, card b where idChannel = :Channel and a.idCard = b.idCard");</p><p> Q->ParamByName("Channel")->AsInteger = TChannel;</p><p> Q->Open();</p><p> Q->First();</p><p> if (!Q->Eof)</p><p> {</p><p> R->ParamByName("RECOMMENDEDCARD")->AsInteger = Q->FieldByName("idCard")->AsInteger;</p><p> R->ParamByName("PRIORITY")->AsInteger = Q->FieldByName("priority")->AsInteger;</p><p> [COLOR="Red"][B]R->ParamByName("DIRECTORY")->AsString = Q->FieldByName("recordingFolder")->AsString;[/B][/COLOR]</p><p> if (R->ParamByName("DIRECTORY")->AsString.[COLOR="Red"][B]IsEmpty[/B][/COLOR]())</p><p> {</p><p> NonFatalMessage += Trans->Trans[[COLOR="Red"][B]"No recording folder has been set for this channel"[/B][/COLOR]] + "<br>";</p><p> }</p><p> }</p><p> else</p><p> {</p><p> R->ParamByName("RECOMMENDEDCARD")->AsInteger = -1;</p><p> NonFatalMessage += Trans->Trans["[COLOR="Red"][B]No recommended card has been set for this channel[/B][/COLOR]"] + "<br>";</p><p> }</p><p></p><p> if (R->ParamByName("DIRECTORY")->AsString.IsEmpty())</p><p> {</p><p> Q->Close();</p><p> Q->SQL->Clear();</p><p> Q->SQL->Add("select * from card");</p><p> Q->Open();</p><p> Q->First();</p><p> while (!Q->Eof)</p><p> {</p><p> if (!Q->FieldByName("recordingFolder")->AsString.IsEmpty())</p><p> {</p><p> R->ParamByName("DIRECTORY")->AsString = Q->FieldByName("recordingFolder")->AsString;</p><p> NonFatalMessage += Trans->Trans["[COLOR="Red"][B]The recording file has been set to[/B][/COLOR]"] + " " + Q->FieldByName("recordingFolder")->AsString + " " + Trans->Trans["[COLOR="Red"][B]as no recording file has been assigned to this card[/B][/COLOR]"] + "<br>";</p><p> break;</p><p> }</p><p> Q->Next();</p><p> }</p><p> }</p><p>[/CODE]</p><p></p><p>The directory for recorded tv is initially null, then the card recommended for that channel is looked up and the directory is assigned.</p><p></p><p>I have added code to check that a directory has been assigned.</p><p></p><p>If it is not assigned, then the program looks through your list of cards and assigns the first non-null directory it finds.</p><p></p><p>The error was being generated because no value was assigned to the recorded tv directory... so either the channel did not have a recommended card assigned, or the assigned card does not have a folder for recorded tv assigned to it.</p><p></p><p>Please let me know how it goes, hopefully the new error messages will give a few more clues.</p><p></p><p>Kev</p></blockquote><p></p>
[QUOTE="Big_Kev, post: 241953, member: 52102"] That would do it... I will update to the latest SVN and check it out... Kev The code below adds the scheduled recordings [CODE] R->Close(); R->SQL->Clear(); R->SQL->Add("insert into Schedule (idChannel, scheduleType, programName, startTime, endTime, maxAirings, quality, directory, priority, keepDate, preRecordInterval, postRecordInterval, canceled, recommendedCard, keepMethod) values (:IDCHANNEL, :SCHEDULETYPE, :PROGRAMNAME, :STARTTIME, :ENDTIME, :MAXAIRINGS, :QUALITY, :DIRECTORY, :PRIORITY, :KEEPDATE, :PRERECORDINTERVAL, :POSTRECORDINTERVAL, :CANCELED, :RECOMMENDEDCARD, :KEEPMETHOD)"); TDateTime *Temp = new TDateTime(2000, 1, 1); int TChannel = Q->FieldByName("idChannel")->AsInteger; R->ParamByName("IDCHANNEL")->AsInteger = TChannel; R->ParamByName("PROGRAMNAME")->AsString = Q->FieldByName("title")->AsString; R->ParamByName("STARTTIME")->AsDateTime = Q->FieldByName("startTime")->AsDateTime; R->ParamByName("ENDTIME")->AsDateTime = Q->FieldByName("endTime")->AsDateTime; R->ParamByName("MAXAIRINGS")->AsInteger = 5; R->ParamByName("QUALITY")->AsInteger = 0; [COLOR="Red"][B]R->ParamByName("DIRECTORY")->AsString = " ";[/B][/COLOR] R->ParamByName("PRIORITY")->AsInteger = 0; R->ParamByName("PRERECORDINTERVAL")->AsInteger = FixedPreRecord; R->ParamByName("POSTRECORDINTERVAL")->AsInteger = FixedPostRecord; R->ParamByName("SCHEDULETYPE")->AsInteger = SchedType.ToIntDef(0); R->ParamByName("CANCELED")->AsDateTime = *Temp; R->ParamByName("KEEPDATE")->AsDateTime = *Temp; delete Temp; Q->Close(); Q->SQL->Clear(); Q->SQL->Add("select * from channelmap a, card b where idChannel = :Channel and a.idCard = b.idCard"); Q->ParamByName("Channel")->AsInteger = TChannel; Q->Open(); Q->First(); if (!Q->Eof) { R->ParamByName("RECOMMENDEDCARD")->AsInteger = Q->FieldByName("idCard")->AsInteger; R->ParamByName("PRIORITY")->AsInteger = Q->FieldByName("priority")->AsInteger; [COLOR="Red"][B]R->ParamByName("DIRECTORY")->AsString = Q->FieldByName("recordingFolder")->AsString;[/B][/COLOR] if (R->ParamByName("DIRECTORY")->AsString.[COLOR="Red"][B]IsEmpty[/B][/COLOR]()) { NonFatalMessage += Trans->Trans[[COLOR="Red"][B]"No recording folder has been set for this channel"[/B][/COLOR]] + "<br>"; } } else { R->ParamByName("RECOMMENDEDCARD")->AsInteger = -1; NonFatalMessage += Trans->Trans["[COLOR="Red"][B]No recommended card has been set for this channel[/B][/COLOR]"] + "<br>"; } if (R->ParamByName("DIRECTORY")->AsString.IsEmpty()) { Q->Close(); Q->SQL->Clear(); Q->SQL->Add("select * from card"); Q->Open(); Q->First(); while (!Q->Eof) { if (!Q->FieldByName("recordingFolder")->AsString.IsEmpty()) { R->ParamByName("DIRECTORY")->AsString = Q->FieldByName("recordingFolder")->AsString; NonFatalMessage += Trans->Trans["[COLOR="Red"][B]The recording file has been set to[/B][/COLOR]"] + " " + Q->FieldByName("recordingFolder")->AsString + " " + Trans->Trans["[COLOR="Red"][B]as no recording file has been assigned to this card[/B][/COLOR]"] + "<br>"; break; } Q->Next(); } } [/CODE] The directory for recorded tv is initially null, then the card recommended for that channel is looked up and the directory is assigned. I have added code to check that a directory has been assigned. If it is not assigned, then the program looks through your list of cards and assigns the first non-null directory it finds. The error was being generated because no value was assigned to the recorded tv directory... so either the channel did not have a recommended card assigned, or the assigned card does not have a folder for recorded tv assigned to it. Please let me know how it goes, hopefully the new error messages will give a few more clues. Kev [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
WebService and Mobile Access
Self Contained Web Server / Interface
Contact us
RSS
Top
Bottom