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
Support
General Support
Quick record and advanced record dont work
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="adagio" data-source="post: 508043" data-attributes="member: 90377"><p>So I found this code for Quick record. Can anybody give me a hint why it might be kicking out before it gets to the end? I think has something to do with how the channel ids or groups are set up. I took out my analog group, but still no good. Thanks.</p><p></p><p> private void OnQuickRecord()</p><p> {</p><p> WeekEndTool weekEndTool = Setting.GetWeekEndTool();</p><p> GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU);</p><p> if (dlg == null)</p><p> {</p><p> return;</p><p> }</p><p> dlg.Reset();</p><p> dlg.SetHeading(GUILocalizeStrings.Get(891)); //Select TV Channel</p><p> IList<GroupMap> channels = TVHome.Navigator.CurrentGroup.ReferringGroupMap();</p><p> foreach (GroupMap chan in channels)</p><p> {</p><p> GUIListItem item = new GUIListItem(chan.ReferencedChannel().DisplayName);</p><p> string strLogo = Utils.GetCoverArt(Thumbs.TVChannel, chan.ReferencedChannel().DisplayName);</p><p> if (!File.Exists(strLogo))</p><p> {</p><p> strLogo = "defaultVideoBig.png";</p><p> }</p><p> item.ThumbnailImage = strLogo;</p><p> item.IconImageBig = strLogo;</p><p> item.IconImage = strLogo;</p><p> dlg.Add(item);</p><p> }</p><p> dlg.DoModal(GetID);</p><p> if (dlg.SelectedLabel < 0)</p><p> {</p><p> return;</p><p> }</p><p></p><p> Channel selectedChannel = (channels[dlg.SelectedLabel]).ReferencedChannel();</p><p> dlg.Reset();</p><p> dlg.SetHeading(616); //select recording type</p><p> for (int i = 611; i <= 615; ++i)</p><p> {</p><p> dlg.Add(GUILocalizeStrings.Get(i));</p><p> }</p><p> dlg.Add(GUILocalizeStrings.Get(weekEndTool.GetText(DayType.Record_WorkingDays)));</p><p> dlg.Add(GUILocalizeStrings.Get(weekEndTool.GetText(DayType.Record_WeekendDays)));</p><p></p><p> Schedule rec = new Schedule(selectedChannel.IdChannel, "", Schedule.MinSchedule, Schedule.MinSchedule);</p><p></p><p> TvBusinessLayer layer = new TvBusinessLayer();</p><p> rec.PreRecordInterval = Int32.Parse(layer.GetSetting("preRecordInterval", "5").Value);</p><p> rec.PostRecordInterval = Int32.Parse(layer.GetSetting("postRecordInterval", "5").Value);</p><p> rec.ScheduleType = (int) ScheduleRecordingType.Once;</p><p></p><p> DateTime dtNow = DateTime.Now;</p><p> int day;</p><p> day = 0;</p><p></p><p> dlg.Reset();</p><p> dlg.SetHeading(142); //select time</p><p> dlg.ShowQuickNumbers = false;</p><p> //time</p><p> //int no = 0;</p><p> int hour, minute, steps;</p><p> steps = 15;</p><p> dlg.Add("00:00");</p><p> for (hour = 0; hour <= 23; hour++)</p><p> {</p><p> for (minute = 0; minute < 60; minute += steps)</p><p> {</p><p> if (hour == 0 && minute == 0)</p><p> {</p><p> continue;</p><p> }</p><p> string time;</p><p> if (hour < 10)</p><p> {</p><p> time = "0" + hour;</p><p> }</p><p> else</p><p> {</p><p> time = hour.ToString();</p><p> }</p><p> time += ":";</p><p> if (minute < 10)</p><p> {</p><p> time = time + "0" + minute;</p><p> }</p><p> else</p><p> {</p><p> time += minute.ToString();</p><p> }</p><p></p><p> //if (hour < 1) time = String.Format("{0} {1}", minute, GUILocalizeStrings.Get(3004));</p><p> dlg.Add(time);</p><p> }</p><p> }</p><p> // pre-select the current time</p><p> dlg.SelectedLabel = (DateTime.Now.Hour*(60/steps)) + (Convert.ToInt16(DateTime.Now.Minute/steps));</p><p> dlg.DoModal(GetID);</p><p> if (dlg.SelectedLabel == -1)</p><p> {</p><p> return;</p><p> }</p><p></p><p> int mins = (dlg.SelectedLabel)*steps;</p><p> hour = (mins)/60;</p><p> minute = ((mins)%60);</p><p></p><p></p><p> dlg.Reset();</p><p> dlg.SetHeading(180); //select time</p><p> dlg.ShowQuickNumbers = false;</p><p> //duration</p><p> for (float hours = 0.5f; hours <= 24f; hours += 0.5f)</p><p> {</p><p> dlg.Add(String.Format("{0} {1}", hours.ToString("f2"), GUILocalizeStrings.Get(3002)));</p><p> }</p><p> dlg.DoModal(GetID);</p><p> if (dlg.SelectedLabel == -1)</p><p> {</p><p> return;</p><p> }</p><p> int duration = (dlg.SelectedLabel + 1)*30;</p><p></p><p></p><p> dtNow = DateTime.Now.AddDays(day);</p><p> rec.StartTime = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day, hour, minute, 0, 0);</p><p> rec.EndTime = rec.StartTime.AddMinutes(duration);</p><p> rec.ProgramName = GUILocalizeStrings.Get(413) + " (" + rec.ReferencedChannel().DisplayName + ")";</p><p> rec.Persist();</p><p> TvServer server = new TvServer();</p><p> server.OnNewSchedule();</p><p> GUIWindowManager.ShowPreviousWindow();</p><p> }</p><p></p><p>I'm new to this, so I just found the logs. her's what it says when I try ti do a Quick Record -</p><p></p><p>2009-09-10 20:54:12.765625 [Info.][MPMain]: OnMessage exception:Error: UnexpectedRowCountUnclassified</p><p>Gentle.Common.GentleException: The number of returned rows 0 did not match the expected count of 1.</p><p>If concurrency control is enabled this may indicate that the record was updated or deleted by another process.</p><p> at Gentle.Common.Check.FailWith(Severity severity, Error error, Exception e, String msg)</p><p> at Gentle.Common.Check.Fail(Exception e, Error error, Object[] args)</p><p> at Gentle.Common.Check.Verify(Boolean condition, Error error, Object[] args)</p><p> at Gentle.Framework.ObjectFactory.GetInstance(Type type, SqlResult sr, Key key)</p><p> at Gentle.Framework.PersistenceBroker.RetrieveInstance(Type type, Key key, IDbConnection conn, IDbTransaction tr)</p><p> at Gentle.Framework.PersistenceBroker.RetrieveInstance[T](Key key)</p><p> at Gentle.Framework.Broker.RetrieveInstance[T](Key key)</p><p> at TvDatabase.Channel.Retrieve(Int32 id)</p><p> at TvDatabase.GroupMap.ReferencedChannel()</p><p> at TvPlugin.TvNewScheduleSearchType.OnQuickRecord()</p><p> at TvPlugin.TvNewScheduleSearchType.OnClicked(Int32 controlId, GUIControl control, ActionType actionType)</p><p> at MediaPortal.GUI.Library.GUIWindow.OnMessage(GUIMessage message)</p><p></p><p>Thanks.</p></blockquote><p></p>
[QUOTE="adagio, post: 508043, member: 90377"] So I found this code for Quick record. Can anybody give me a hint why it might be kicking out before it gets to the end? I think has something to do with how the channel ids or groups are set up. I took out my analog group, but still no good. Thanks. private void OnQuickRecord() { WeekEndTool weekEndTool = Setting.GetWeekEndTool(); GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU); if (dlg == null) { return; } dlg.Reset(); dlg.SetHeading(GUILocalizeStrings.Get(891)); //Select TV Channel IList<GroupMap> channels = TVHome.Navigator.CurrentGroup.ReferringGroupMap(); foreach (GroupMap chan in channels) { GUIListItem item = new GUIListItem(chan.ReferencedChannel().DisplayName); string strLogo = Utils.GetCoverArt(Thumbs.TVChannel, chan.ReferencedChannel().DisplayName); if (!File.Exists(strLogo)) { strLogo = "defaultVideoBig.png"; } item.ThumbnailImage = strLogo; item.IconImageBig = strLogo; item.IconImage = strLogo; dlg.Add(item); } dlg.DoModal(GetID); if (dlg.SelectedLabel < 0) { return; } Channel selectedChannel = (channels[dlg.SelectedLabel]).ReferencedChannel(); dlg.Reset(); dlg.SetHeading(616); //select recording type for (int i = 611; i <= 615; ++i) { dlg.Add(GUILocalizeStrings.Get(i)); } dlg.Add(GUILocalizeStrings.Get(weekEndTool.GetText(DayType.Record_WorkingDays))); dlg.Add(GUILocalizeStrings.Get(weekEndTool.GetText(DayType.Record_WeekendDays))); Schedule rec = new Schedule(selectedChannel.IdChannel, "", Schedule.MinSchedule, Schedule.MinSchedule); TvBusinessLayer layer = new TvBusinessLayer(); rec.PreRecordInterval = Int32.Parse(layer.GetSetting("preRecordInterval", "5").Value); rec.PostRecordInterval = Int32.Parse(layer.GetSetting("postRecordInterval", "5").Value); rec.ScheduleType = (int) ScheduleRecordingType.Once; DateTime dtNow = DateTime.Now; int day; day = 0; dlg.Reset(); dlg.SetHeading(142); //select time dlg.ShowQuickNumbers = false; //time //int no = 0; int hour, minute, steps; steps = 15; dlg.Add("00:00"); for (hour = 0; hour <= 23; hour++) { for (minute = 0; minute < 60; minute += steps) { if (hour == 0 && minute == 0) { continue; } string time; if (hour < 10) { time = "0" + hour; } else { time = hour.ToString(); } time += ":"; if (minute < 10) { time = time + "0" + minute; } else { time += minute.ToString(); } //if (hour < 1) time = String.Format("{0} {1}", minute, GUILocalizeStrings.Get(3004)); dlg.Add(time); } } // pre-select the current time dlg.SelectedLabel = (DateTime.Now.Hour*(60/steps)) + (Convert.ToInt16(DateTime.Now.Minute/steps)); dlg.DoModal(GetID); if (dlg.SelectedLabel == -1) { return; } int mins = (dlg.SelectedLabel)*steps; hour = (mins)/60; minute = ((mins)%60); dlg.Reset(); dlg.SetHeading(180); //select time dlg.ShowQuickNumbers = false; //duration for (float hours = 0.5f; hours <= 24f; hours += 0.5f) { dlg.Add(String.Format("{0} {1}", hours.ToString("f2"), GUILocalizeStrings.Get(3002))); } dlg.DoModal(GetID); if (dlg.SelectedLabel == -1) { return; } int duration = (dlg.SelectedLabel + 1)*30; dtNow = DateTime.Now.AddDays(day); rec.StartTime = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day, hour, minute, 0, 0); rec.EndTime = rec.StartTime.AddMinutes(duration); rec.ProgramName = GUILocalizeStrings.Get(413) + " (" + rec.ReferencedChannel().DisplayName + ")"; rec.Persist(); TvServer server = new TvServer(); server.OnNewSchedule(); GUIWindowManager.ShowPreviousWindow(); } I'm new to this, so I just found the logs. her's what it says when I try ti do a Quick Record - 2009-09-10 20:54:12.765625 [Info.][MPMain]: OnMessage exception:Error: UnexpectedRowCountUnclassified Gentle.Common.GentleException: The number of returned rows 0 did not match the expected count of 1. If concurrency control is enabled this may indicate that the record was updated or deleted by another process. at Gentle.Common.Check.FailWith(Severity severity, Error error, Exception e, String msg) at Gentle.Common.Check.Fail(Exception e, Error error, Object[] args) at Gentle.Common.Check.Verify(Boolean condition, Error error, Object[] args) at Gentle.Framework.ObjectFactory.GetInstance(Type type, SqlResult sr, Key key) at Gentle.Framework.PersistenceBroker.RetrieveInstance(Type type, Key key, IDbConnection conn, IDbTransaction tr) at Gentle.Framework.PersistenceBroker.RetrieveInstance[T](Key key) at Gentle.Framework.Broker.RetrieveInstance[T](Key key) at TvDatabase.Channel.Retrieve(Int32 id) at TvDatabase.GroupMap.ReferencedChannel() at TvPlugin.TvNewScheduleSearchType.OnQuickRecord() at TvPlugin.TvNewScheduleSearchType.OnClicked(Int32 controlId, GUIControl control, ActionType actionType) at MediaPortal.GUI.Library.GUIWindow.OnMessage(GUIMessage message) Thanks. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Support
General Support
Quick record and advanced record dont work
Contact us
RSS
Top
Bottom