MySleepTimer (2 Viewers)

Keksebacker

Portal Member
May 9, 2013
28
4
36
Home Country
Austria Austria
1.) Sometimes when activating the Plugin the timer shows 0 or 1 seconds left and the pc shuts down(Interval steps 15 min configured). Maybe the problem only comes up after resuming from standby - i´m testing.

I have exactly the same problem.
The problem only occurs when i activate the timer during Live-TV.

Is there any solution?
 

popy

MP Donator
  • Premium Supporter
  • July 3, 2011
    617
    141
    1.) Sometimes when activating the Plugin the timer shows 0 or 1 seconds left and the pc shuts down(Interval steps 15 min configured). Maybe the problem only comes up after resuming from standby - i´m testing.

    I have exactly the same problem.
    The problem only occurs when i activate the timer during Live-TV.

    Is there any solution?

    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:
            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 New:
    Code:
            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();
                }
            }
     

    Attachments

    • MySleepTimer_2.0.2.0_fixed_by_pOpY.zip
      82.8 KB
    Last edited:

    Keksebacker

    Portal Member
    May 9, 2013
    28
    4
    36
    Home Country
    Austria Austria
    Hey popy,

    a big THX for your revision.

    I've tested your modification.
    The bug during live tv seems to be solved but with your version i have an other problem.
    The notification popup blinks as often I increase the timer.

    In my case I have steps of 10 minutes. If I want to set the timer to 40 minutes I have to push the button four times.
    In this case the popup flashes four times.

    It's just a minimal blemish but maybe it could be easily solved.

    At this point I have to say that English isn’t my first language, so please excuse any mistakes.
     

    popy

    MP Donator
  • Premium Supporter
  • July 3, 2011
    617
    141
    Hey Keksebacker.

    Thanks for your feeedback.
    Nice to hear that the bug with livetv is also solved for you.

    Regarding your issue: i am using the plugin with MP 1.10 + StreamedMP and doesnt have this "flash" issue.
    What Skin you are using?
    Sorry, but i havent changed anything with the notify popup.
    Could you take a look in the MP logs? Maybe there are exceptions....
    If yes i can look into it.

    Update 2.0.3.0:
    • now when watching videos/series... and you activate the sleeptimer the duration of the currently played media is used again. It must be > then the configured step time. If this is not the case (like in livetv where it is 0-2 sec) -> the configured step time will be used. Have solved it this way because i havent found a way to get the current playing epg data endtime.
      So now the "old" feature is working again on videos/series :p
    • Added a feature called "Auto Activate". You can enable the feature in Config tool and set a time in format HH:mm. Always when the configured time has come MySleepTimer now sets the default step as shutdown time and notify the user throught the GUI (as always). The User can normally interact with the Dialog (increase, decrease the time...), or just sleep :sleep: and let MySleepTimer do the rest. When the user manually set a shutdown time the AutoActivate feature doesnt change the current setting/time. It should also work for users which are using hibernating/standby. The AutoActivate timer will fire every 24h. But i havent tested this scenario because i hav SSDs and do a cold boot every day.

      ex.: you configure it to 00:30 and your step time is 10min -> at 00:30 the notify dialog will popup in the GUI and tells you that the HTPC will shutdown in 10 minutes -> the same if you press the configured action key. @00:40 the action will be executed.
    Hope you like the new features
    pOpY
     

    Attachments

    • MySleepTimer_v2.0.3.0_by_pOpY.zip
      83.7 KB

    Edalex

    Community Plugin Dev
  • Premium Supporter
  • January 3, 2008
    2,955
    1,264
    Saratov
    Home Country
    Russian Federation Russian Federation
    Anyone knows how to push this to the MP plugin repository
    Havent done this yet.
    Currently there is 2.0.1.0 in the extension manager.
    First, you should register Sourceforge account. Second, you need to askk @high to add you to mp-plugins project.
    If you have more questions you could find me on IRC. :)
     

    popy

    MP Donator
  • Premium Supporter
  • July 3, 2011
    617
    141
    nice that you found the issue :cool:

    Can you please test the auto activate feature?
    Do you shutting down your HTPC or go to standby/hibernate?

    pOpY
     

    popy

    MP Donator
  • Premium Supporter
  • July 3, 2011
    617
    141
    Anyone knows how to push this to the MP plugin repository
    Havent done this yet.
    Currently there is 2.0.1.0 in the extension manager.
    First, you should register Sourceforge account. Second, you need to askk @high to add you to mp-plugins project.
    If you have more questions you could find me on IRC. :)

    Hey, i have an sourceforge account and will ask @high to get permissions for the mysleeptimer plugin repo.
     

    Users who are viewing this thread

    Top Bottom