summaryrefslogtreecommitdiff
path: root/lib/Ultramarine/Controller.pm6
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Ultramarine/Controller.pm6')
-rw-r--r--lib/Ultramarine/Controller.pm614
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/Ultramarine/Controller.pm6 b/lib/Ultramarine/Controller.pm6
index f5cbd64..5e18b48 100644
--- a/lib/Ultramarine/Controller.pm6
+++ b/lib/Ultramarine/Controller.pm6
@@ -51,8 +51,11 @@ class Ultramarine::Controller {
# middlewares, so our serialised won't be seen by the
# "unauthorised" response
before $!authorisation;
- post -> 'ping' { respond [] }
- post -> 'getLicense' {
+
+ post my $ping = -> 'ping' { respond [] }
+ get $ping;
+
+ post my $getLicense = -> 'getLicense' {
my $expires = $.license.expires-at.DateTime.truncated-to('second');
respond [
:status<ok>,
@@ -63,7 +66,9 @@ class Ultramarine::Controller {
],
],
}
- post -> 'getMusicFolders' {
+ get $getLicense;
+
+ post my $getMusicFolders = -> 'getMusicFolders' {
respond [
:status<ok>,
musicFolders => [
@@ -71,8 +76,9 @@ class Ultramarine::Controller {
]
],
}
+ get $getMusicFolders;
# this is clearly not a Subsonic method
- post -> 'dakkarList' {
+ get -> 'dakkarList' {
await $.collection.is-ready;
respond [
:status<ok>,