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
MediaPortal 1 Plugins
MySleepTimer
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="popy" data-source="post: 1121965" data-attributes="member: 114134"><p>Hey guys, i had the same issue and and looked atthe source code.</p><p>I have found the issue, it has something todo with the playing media.</p><p>MySleepTimer had a feature that the first time was calculated by the remaining current running media time.</p><p>In liveTv with timeshift there was a problem in this function.</p><p>I have done a quick and dirty fix and removed this feature.</p><p>So the timer first starts witch the configured time!</p><p>This is enougth for my needs.</p><p></p><p>Attached is a v2.0.2.0 where the issue is fixed!</p><p></p><p>Anyone knows how to push this to the MP plugin repository <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite12" alt="o_O" title="Er... what? o_O" loading="lazy" data-shortname="o_O" /></p><p>Havent done this yet.</p><p>Currently there is 2.0.1.0 in the extension manager.</p><p></p><p>pOpY</p><p></p><p>PS, Code old:</p><p></p><p>[CODE=C#] void SleepTimerOnEntry() {</p><p> double currentRemaining = GetRemainingPlaytime();</p><p> if (currentRemaining <= 0)</p><p> {</p><p> currentRemaining = Settings.SleepTimeStep * 60 * 1000;</p><p> }[/COLOR]</p><p> Shutdown = DateTime.Now.AddMilliseconds(currentRemaining);</p><p> ShutDownTimer = new Timer(Remaining.TotalMilliseconds);</p><p> ShutDownTimer.Elapsed += TimerShutDown_Elapsed;</p><p> ShutDownTimer.AutoReset = false;</p><p> ShutDownTimer.Start();</p><p> if (Settings.NotifyBeforeSleep > 0 && Settings.NotifyBeforeSleep < Remaining.TotalMinutes) {</p><p> NotificationTimer.Interval = Remaining.TotalMilliseconds - Settings.NotifyBeforeSleep * 60 * 1000;</p><p> NotificationTimer.AutoReset = true;</p><p> NotificationTimer.Start();</p><p> }</p><p> }[/CODE]</p><p></p><p>Code New:</p><p>[CODE=C#] void SleepTimerOnEntry() {</p><p> double currentRemaining = Settings.SleepTimeStep * 60 * 1000;</p><p> //double currentRemaining = GetRemainingPlaytime();</p><p> //if (currentRemaining <= 0)</p><p> //{</p><p> // currentRemaining = Settings.SleepTimeStep * 60 * 1000;</p><p> //}</p><p> Shutdown = DateTime.Now.AddMilliseconds(currentRemaining);</p><p> ShutDownTimer = new Timer(Remaining.TotalMilliseconds);</p><p> ShutDownTimer.Elapsed += TimerShutDown_Elapsed;</p><p> ShutDownTimer.AutoReset = false;</p><p> ShutDownTimer.Start();</p><p> if (Settings.NotifyBeforeSleep > 0 && Settings.NotifyBeforeSleep < Remaining.TotalMinutes) {</p><p> NotificationTimer.Interval = Remaining.TotalMilliseconds - Settings.NotifyBeforeSleep * 60 * 1000;</p><p> NotificationTimer.AutoReset = true;</p><p> NotificationTimer.Start();</p><p> }</p><p> }[/CODE]</p></blockquote><p></p>
[QUOTE="popy, post: 1121965, member: 114134"] Hey guys, i had the same issue and and looked atthe source code. I have found the issue, it has something todo with the playing media. MySleepTimer had a feature that the first time was calculated by the remaining current running media time. In liveTv with timeshift there was a problem in this function. I have done a quick and dirty fix and removed this feature. So the timer first starts witch the configured time! This is enougth for my needs. Attached is a v2.0.2.0 where the issue is fixed! Anyone knows how to push this to the MP plugin repository o_O Havent done this yet. Currently there is 2.0.1.0 in the extension manager. pOpY PS, Code old: [CODE=C#] void SleepTimerOnEntry() { double currentRemaining = GetRemainingPlaytime(); if (currentRemaining <= 0) { currentRemaining = Settings.SleepTimeStep * 60 * 1000; }[/COLOR] Shutdown = DateTime.Now.AddMilliseconds(currentRemaining); ShutDownTimer = new Timer(Remaining.TotalMilliseconds); ShutDownTimer.Elapsed += TimerShutDown_Elapsed; ShutDownTimer.AutoReset = false; ShutDownTimer.Start(); if (Settings.NotifyBeforeSleep > 0 && Settings.NotifyBeforeSleep < Remaining.TotalMinutes) { NotificationTimer.Interval = Remaining.TotalMilliseconds - Settings.NotifyBeforeSleep * 60 * 1000; NotificationTimer.AutoReset = true; NotificationTimer.Start(); } }[/CODE] Code New: [CODE=C#] void SleepTimerOnEntry() { double currentRemaining = Settings.SleepTimeStep * 60 * 1000; //double currentRemaining = GetRemainingPlaytime(); //if (currentRemaining <= 0) //{ // currentRemaining = Settings.SleepTimeStep * 60 * 1000; //} Shutdown = DateTime.Now.AddMilliseconds(currentRemaining); ShutDownTimer = new Timer(Remaining.TotalMilliseconds); ShutDownTimer.Elapsed += TimerShutDown_Elapsed; ShutDownTimer.AutoReset = false; ShutDownTimer.Start(); if (Settings.NotifyBeforeSleep > 0 && Settings.NotifyBeforeSleep < Remaining.TotalMinutes) { NotificationTimer.Interval = Remaining.TotalMilliseconds - Settings.NotifyBeforeSleep * 60 * 1000; NotificationTimer.AutoReset = true; NotificationTimer.Start(); } }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
MySleepTimer
Contact us
RSS
Top
Bottom