diff options
Diffstat (limited to 'lib/App/MediaControl/Web.rakumod')
-rw-r--r-- | lib/App/MediaControl/Web.rakumod | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/App/MediaControl/Web.rakumod b/lib/App/MediaControl/Web.rakumod index 77d8e05..86c748e 100644 --- a/lib/App/MediaControl/Web.rakumod +++ b/lib/App/MediaControl/Web.rakumod @@ -4,12 +4,12 @@ use Cro::HTTP::Router; use Cro::WebApp::Template; use Vlc::Client; use Lirc::Commands; -use App::MediaControl::DB; +use App::MediaControl::Model; class App::MediaControl::Web { has Vlc::Client $.vlc is required; has Lirc::Commands $.lirc is required; - has App::MediaControl::DB $.db is required; + has App::MediaControl::Model $.model is required; has Int $.port = 8080; has Str $.host = '*'; has Cro::Service $!service handles <stop>; @@ -18,11 +18,11 @@ class App::MediaControl::Web { my $vlc = route { post -> 'play' { await self.vlc.command('pl_play') } post -> 'play', Int:D $id { - my $file = self.db.get-entry($id); + my $file = self.model.get-entry($id); await self.vlc.play-file(|%( $file<path name>:p # no comma! )); - self.db.mark-entry-watched($id); + self.model.mark-entry-watched($id); } post -> 'pause' { await self.vlc.command('pl_pause') } post -> 'stop' { await self.vlc.command('pl_stop') } @@ -46,14 +46,14 @@ class App::MediaControl::Web { my $media = route { get -> $id=Nil { - my %reply = children => @(self.db.get-children-of($id)); + my %reply = children => @(self.model.get-children-of($id)); with $id { - %reply<parents> = self.db.get-parents-of($id); + %reply<parents> = self.model.get-parents-of($id); }; content 'application/json', %reply; } get -> 'recent' { - content 'application/json', @(self.db.get-recently-watched-folders()); + content 'application/json', @(self.model.get-recently-watched-folders()); } }; |