blob: 037031065b157e0d2ec3fa741122dc29192b35ab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
use v6.d.PREVIEW; use JSON::Fast; class Ultramarine::Model::MusicFile { has $.path is required; method metadata() { my $proc = run 'avprobe', '-show_format','-of', 'json', $.path, :err,:out; CATCH { when X::Proc::Unsuccessful { return %() } } my $json-str = $proc.out.slurp(:close); $proc.err.close(); return (from-json $json-str){'format'}; } }
|