App-MHFS
view release on metacpan or search on metacpan
lib/MHFS/Plugin/Kodi.pm view on Meta::CPAN
try {
my $bytes = read_file($b_plotfile);
my $json = decode_json($bytes);
if (defined $episode) {
$json = MHFS::Kodi::Season::_get_season_episode($json, $episode);
}
$request->SendText('text/plain; charset=utf-8', $json->{overview});
return;
} catch ($e){}
} elsif (-d $b_metadir) {
my %acceptable = ( 'thumb' => ['png', 'jpg'], 'fanart' => ['png', 'jpg'], 'plot' => ['txt']);
if(exists $acceptable{$metadatatype}) {
foreach my $totry (@{$acceptable{$metadatatype}}) {
my $path = $b_metadir.'/'.$metadatatype.".$totry";
if(-f $path) {
$request->SendLocalFile($path);
return;
}
}
}
}
lib/MHFS/Plugin/MusicLibrary.pm view on Meta::CPAN
if(! opendir($dh, $dname)) {
$request->Send404;
return 1;
}
}
# scan dir for art
my @files;
while(my $fname = readdir($dh)) {
my $last = lc(substr($fname, -4));
push @files, $fname if(($last eq '.png') || ($last eq '.jpg') || ($last eq 'jpeg'));
}
closedir($dh);
if( ! @files) {
$request->Send404;
return 1;
}
my $tosend = "$dname/" . $files[0];
foreach my $file (@files) {
foreach my $expname ('cover', 'front', 'album') {
if(substr($file, 0, length($expname)) eq $expname) {
lib/MHFS/Util.pm view on Meta::CPAN
'm3u8_v' => 'application/x-mpegURL',
# text
'html' => 'text/html; charset=utf-8',
'json' => 'application/json',
'js' => 'application/javascript',
'txt' => 'text/plain; charset=utf-8',
'css' => 'text/css',
# images
'jpg' => 'image/jpeg',
'jpeg' => 'image/jpeg',
'png' => 'image/png',
'gif' => 'image/gif',
'bmp' => 'image/bmp',
# binary
'pdf' => 'application/pdf',
'tar' => 'application/x-tar',
'wasm' => 'application/wasm',
'bin' => 'application/octet-stream'
);
my ($ext) = $filename =~ /\.([^.]+)$/;
share/public_html/static/kodi/addons.xml view on Meta::CPAN
<disclaimer lang="en_GB">Feel free to use this script. For information visit the wiki.</disclaimer>
<platform>all</platform>
<language>en</language>
<license>GPL-2.0-or-later</license>
<forum>https://github.com/G4Vi/MHFS/issues</forum>
<website>computoid.com</website>
<source>https://github.com/G4Vi/MHFS</source>
<news>Version 0.0.0 for Matrix
</news>
<assets>
<icon>resources/icon.png</icon>
<fanart>resources/fanart.jpg</fanart>
</assets>
</extension>
</addon>
</addons>
( run in 0.915 second using v1.01-cache-2.11-cpan-df04353d9ac )