Bug 8673 - Alarm time not saving, when time format not default 12h
: Alarm time not saving, when time format not default 12h
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Player UI
: unspecified
: PC All
: -- normal (vote)
: ---
Assigned To: Michael Herger
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-08 11:33 UTC by James Richardson
Modified: 2008-12-15 11:58 UTC (History)
3 users (show)

See Also:
Category: ---


Attachments
Alarm Error (31.99 KB, text/plain)
2008-07-09 08:13 UTC, James Richardson
Details
Log with ALARM debug info (35.58 KB, application/octet-stream)
2008-07-31 13:51 UTC, James Richardson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Richardson 2008-07-08 11:33:03 UTC
using version of 7.2-21573 r18, I am unable to set a TIME and have it stick.

This happens when SC is set Time Format = hh.mm (24h) or any other setting NOT 12h
Comment 1 KDF 2008-07-08 12:51:19 UTC
I have no problem with this.  I use 24H format and it seems to work fine.  Are you seeing anything in the log?  how about settings prefs logging for DEBUG level?
Comment 2 James Richardson 2008-07-09 08:13:05 UTC
Created attachment 3547 [details]
Alarm Error
Comment 3 James Richardson 2008-07-09 08:13:25 UTC
KDF: I checked and could only repro this on the Boom branch of 7.2

It appears to be the new alarm code that is causing the issue.

See attached log
Comment 4 James Richardson 2008-07-09 08:14:53 UTC
Steps to Reproduce

Install 7.2 boom branch
Set SC clock to 24h
Clear all alarms if any are set for an attached boom
Attempt to set the time for a new alarm
Notice that the time field is always blank
Comment 5 KDF 2008-07-09 08:51:49 UTC
hrm...my test was on the branch as well - timeFormat: "%H:%M:%S"
Comment 6 KDF 2008-07-09 09:10:41 UTC
Are you entering the time with formatting?  ie 13:00 rather than 1300 ?  without the colon, it does fail, but with it I'm having no trouble.  See the following log ship:


[09:09:02.8189] Slim::Utils::Prefs::Base::set (114) setting server::timeFormat to "%H.%M.%S"
[09:09:12.0096] Slim::Utils::Prefs::Namespace::savenow (302) saving prefs for server to C:\Documents and Settings\All Users\Application Data\SqueezeCenter\prefs\server.prefs
[09:09:13.4948] Slim::Utils::Prefs::Base::set (114) setting server:de:c2:39:ac:b8:21:alarms to {
  b096ec34 => {
        _comment  => undef,
        _days     => [1, 1, 1, 1, 1, 1, 1],
        _enabled  => 1,
        _id       => "b096ec34",
        _playlist => "",
        _time     => 43_200,
        _volume   => 50,
      },
}
Comment 7 Max Spicer 2008-07-19 15:34:33 UTC
This definitely works for me - I tested it quite thoroughly with various different time formats.  Please confirm that it still doesn't work.  Also, how are you setting the alarm time - web ui or player ui.  Is this only when connected to squeeze network?

Comment 8 James Richardson 2008-07-22 07:18:09 UTC
I'll have to retest this when SN and SC are synced for boom, as this was an SN error.  Thanks for all your work on verifying this Max and KDF
Comment 9 James Richardson 2008-07-30 19:42:58 UTC
*** Bug 8941 has been marked as a duplicate of this bug. ***
Comment 10 James Richardson 2008-07-30 19:44:57 UTC
This is still happening on my systems with the latest build of SC 7.2 and r21.

I have reproduced this on MAC / Vista / XP.

There is no problem setting the time from the BOOM UI, only from SC/SN WEB UI.  Firefox / Opera / Safari all have the problem.

Either with or without the punctuation I have the problem.
Comment 11 James Richardson 2008-07-31 13:51:24 UTC
Created attachment 3720 [details]
Log with ALARM debug info

Server log with Alarm Debug.  Note TIME = 0.00 when alarm is saved.  SC time format set to 24h (#7) hh,mm.
Comment 12 Max Spicer 2008-07-31 14:03:01 UTC
I still can't reproduce.  Exactly which time format are you using?  Mine is 24 hour (hh:mm:ss (24h)).  I've never seen this.

Reassigning to Michael as this issue only appears in web ui.
Comment 13 James Richardson 2008-07-31 14:26:24 UTC
I have tested ALL of the 24h time formats.  The only one's I can get working are:

#1 - hh:mm:ss pm (12h)
#5 - h:mm (24h)
#8 - hh:mm pm (12h)
#11 - hh:mm:ss (24h)
#14 - h:mm:ss pm (12h)
#19 - h:mm pm (12h)

Notice that only the ones with : as the separator work.  if you have something else as the separator like ' or , then it will fail
Comment 14 KDF 2008-07-31 16:36:29 UTC
the time format options are interfering with the strptime call that is supposed to give use the seconds to store as the pref.  Since that fails, 0 is stored.
Comment 15 KDF 2008-07-31 22:48:34 UTC
the problem appears to be that strptime can only handle time formatted as HH:MM or hh:mm AM/PM.  The player UI uses this type of input, and the older web ui as well.  I've done some research and it doesn't look like there is any easy way to parse arbitrary formatted strings other than a complicated regex matching via Time::Normalize.  perhaps the Default skin ui can unparse the time string before submitting, as a reverse of what it's doing to show the formatted version of the string given through the template.
Comment 16 Michael Herger 2008-08-04 04:32:26 UTC
change 22342 - apply a rather simplistic fix, which should cover our cases: replace ,. separators with a colon before storing the alarm time.

Please test with our various formats. Thanks!
Comment 17 Michael Herger 2008-08-06 01:12:54 UTC
Feel free to re-open if this fix was too simplistic for your taste.
Comment 18 James Richardson 2008-08-06 07:55:04 UTC
Tested with 7.222374, the fix appears to be working.
Comment 19 James Richardson 2008-12-15 11:58:50 UTC
This bug has been fixed in the latest release of SqueezeCenter!

Please download the new version from http://www.slimdevices.com/su_downloads.html if you haven't already.  

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.