From b3cfb984d774b217e7a95ba569fe873b8c05251b Mon Sep 17 00:00:00 2001 From: dakkar Date: Sat, 23 Dec 2017 20:02:43 +0000 Subject: wiring the collection into the application --- lib/Ultramarine/Controller.pm6 | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/Ultramarine/Controller.pm6') diff --git a/lib/Ultramarine/Controller.pm6 b/lib/Ultramarine/Controller.pm6 index 35f37a9..e864b00 100644 --- a/lib/Ultramarine/Controller.pm6 +++ b/lib/Ultramarine/Controller.pm6 @@ -8,6 +8,7 @@ use Cro; class Ultramarine::Controller { has $.license is required; has $.authorisation is required; + has $.collection is required; sub respond(*@body) { response.status = 200; @@ -65,6 +66,14 @@ class Ultramarine::Controller { ] ], } + # this is clearly not a Subsonic method + post -> 'dakkarList' { + await $!collection.is-ready; + respond [ + :status, + songs => $!collection.all-songs, + ]; + } } } -- cgit v1.2.3