blob: ec1cbd77f2978008e75920a72b2ce8127739d6ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
use v6.d.PREVIEW; use JSON::Fast; =begin example
=end example class Ultramarine::Model::MusicFile { has $.path is required; method metadata(-->Promise) { my $result = Promise.new; my $proc = Proc::Async.new( 'avprobe', '-show_format','-of', 'json', $.path, ); my Str $json-str=''; $proc.stdout.tap(->$data { $json-str~=$data }); $proc.stderr.tap(->$err {}); return $proc.start.then(->$status { from-json $json-str }); } }
|