From cfe34795b1d9db7ada11d18c4f76444060cdf60d Mon Sep 17 00:00:00 2001 From: dakkar Date: Tue, 2 Jan 2018 17:18:39 +0000 Subject: better structure, and test, for License --- lib/Ultramarine/Controller.pm6 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/Ultramarine/Controller.pm6') diff --git a/lib/Ultramarine/Controller.pm6 b/lib/Ultramarine/Controller.pm6 index 208a50b..f5cbd64 100644 --- a/lib/Ultramarine/Controller.pm6 +++ b/lib/Ultramarine/Controller.pm6 @@ -53,9 +53,14 @@ class Ultramarine::Controller { before $!authorisation; post -> 'ping' { respond [] } post -> 'getLicense' { + my $expires = $.license.expires-at.DateTime.truncated-to('second'); respond [ :status, - license => [ |%($.license.status) ], + license => [ + :valid($.license.is-valid.Str.lc), + :email($.license.email), + :licenseExpires($expires.yyyy-mm-dd ~ ':' ~ $expires.hh-mm-ss), + ], ], } post -> 'getMusicFolders' { -- cgit v1.2.3