Branch Coverage

blib/lib/App/MHFS.pm
Criterion Covered Total %
branch 11 1518 0.7


line true false branch
14 0 1 if (index($MHFS::EventLoop::Poll::Linux::Timer::Config{'archname'}, "x86_64-linux") == -1)
35 0 0 unless $timerfd != -1
37 0 0 unless $timerhandle
59 0 0 $start > 1e-09 ? :
62 0 0 unless $settime_success == 0
70 0 0 if ($nread < 8)
77 0 0 unless (defined $nread)
78 0 0 unless ($!{'EAGAIN'})
115 0 0 if (defined $self{'children'}{$child}) { }
176 0 0 if defined $id
184 0 0 unless defined $self->{'timers'}[$i]{'id'}
185 0 0 if ($self->{'timers'}[$i]{'id'} == $id)
208 0 0 if ($current_time >= $timer->{'desired'}) { }
210 0 0 if (defined $timer->{'callback'}->($timer, $current_time, $self))
225 0 0 if ($pollret > 0) { }
0 0 elsif ($pollret == 0) { }
0 0 elsif (not $!{'EINTR'}) { }
229 0 0 if ($revents & 1)
231 0 0 unless (defined $obj->onReadReady)
238 0 0 if ($revents & 4)
240 0 0 unless (defined $obj->onWriteReady)
247 0 0 if ($revents & 16)
275 0 0 if ($self->{'timers'}) { }
282 0 0 if (@{$self->{'timers'};}) { }
309 0 0 if ($self->SUPER::add_timer(@_) == 0)
319 0 0 if (@{$self->{'timers'};})
333 0 0 if ($self->{'timers'}) { }
353 0 1 if (&main::HAS_EventLoop_Poll_Linux_Timer())
359 1 0 if (eval "use parent $backend; 1;")
364 0 1 unless $selbackend
399 0 0 if (exists $settings->{'flush'} and $settings->{'flush'})
411 0 0 unless ($sock)
416 0 0 unless ($sock->setsockopt(1, 9, 1))
434 0 0 if (index($MHFS::HTTP::Server::Config{'osname'}, "linux") != -1)
436 0 0 unless $sock->setsockopt(6, 12, 1)
446 0 0 unless ($fs)
455 0 0 if defined $settings->{$pluginname}{'enabled'} and not $settings->{$pluginname}{'enabled'}
457 0 0 unless $plugin
463 0 0 if (my $func = $plugin->{'uploader'})
490 0 0 unless ($csock)
497 0 0 unless ($peerhost)
502 0 0 unless (defined $peerip)
508 0 0 if (($peerip & $allowedHost->{'subnetmask'}) == $allowedHost->{'ip'})
513 0 0 unless ($ah)
518 0 0 unless ($peerport)
549 0 0 unless (defined $bytes)
566 0 0 if (-e $lockname)
582 0 0 unless open my $fh, ">", $filename
592 0 0 if (not open(my $fh, '<', $filename)) { }
610 0 0 unless $dir_matches
611 0 0 if (/$name_req/i)
612 0 0 if -d $_
618 0 0 if (defined $path_req)
641 0 0 if ($pid == 0) { }
682 0 0 if defined &{$funcname;}
706 0 0 unless (opendir $dir, $path)
714 0 0 if $file =~ /^..?$/
717 0 0 @files ? :
721 0 0 unless (defined $path)
722 0 0 if $options->{'on_dir_end'}
726 0 0 if (-d $path)
727 0 0 if $options->{'on_dir_start'}
732 0 0 if ($root)
736 0 0 unless (defined $size)
740 0 0 if $size < $options->{'min_file_size'}
741 0 0 if $options->{'on_file'}
757 0 0 unless (defined $data{$multiple})
763 0 0 unless defined $data{$m2}
821 0 0 if (scalar @values != 4)
825 0 0 unless $values[$i] <= 255
851 0 0 unless length $$octets >= 1
856 0 0 if (($byteval & $rule->[0]) == $rule->[1])
861 0 0 unless length $octets >= $charlen
863 0 0 if (length $char > 1)
902 0 0 unless length $octets
910 0 0 if ($chardata->{'bytelength'} == 3 and $chardata->{'codepoint'} >= 55296 and $chardata->{'codepoint'} <= 56319)
912 0 0 if ($secondchar and $secondchar->{'bytelength'} == 3 and $secondchar->{'codepoint'} >= 56320 and $secondchar->{'codepoint'} <= 57343)
934 0 0 unless length $escapedoctets
960 0 0 if ($mebibytes >= 1024) { }
993 1 0 if (not eval "use JSON; 1")
994 0 1 unless eval "use JSON::PP; 1"
1026 0 0 if ($ipos != -1) { }
0 0 elsif (length $self->{'client'}{'inbuf'} > 8192) { }
1027 0 0 if (substr($self->{'client'}{'inbuf'}, 0, $ipos + 2, '') =~ m[^(([^\s]+)\s+([^\s]+)\s+(?:HTTP/1\.([0-1])))\r\n]) { }
1036 0 0 if ($self->{'method'} ne "GET" and $self->{'method'} ne "HEAD" and $self->{'method'} ne "PUT")
1054 0 0 if (index($pathStruct{'unsafecollapse'}, "/", length($pathStruct{'unsafecollapse'}) - 1) != -1)
1067 0 0 if (defined $value)
1068 0 0 if (not defined $qsStruct{$key}) { }
1072 0 0 if (ref $qsStruct{$key} ne "ARRAY")
1102 0 0 if ($ipos == -1) { }
0 0 elsif (substr($self->{'client'}{'inbuf'}, 0, $ipos + 2, '') =~ /^(([^:]+):\s*(.*))\r\n/) { }
1103 0 0 if (length $self->{'client'}{'inbuf'} > 8192)
1121 0 0 if ($self->{'client'}{'serverhostname'})
1122 0 0 if (not $self->{'header'}{'Host'} or $self->{'header'}{'Host'} ne $self->{'client'}{'serverhostname'})
1134 0 0 if ($self->{'client'}{'X-MHFS-PROXY-KEY'} and $self->{'header'}{'X-MHFS-PROXY-KEY'})
1138 0 0 if (not $trusted) { }
1141 0 0 if (exists $self->{'header'}{$forbidden})
1150 0 0 if $self->{'header'}{'X-Forwarded-For'}
1153 0 0 if ($netmap and $self->{'ip'} >> 24 == $netmap->[0])
1160 0 0 if (defined $self->{'header'}{'Range'} and $self->{'header'}{'Range'} =~ /^bytes=([0-9]+)\-([0-9]*)$/)
1162 0 0 $2 ne '' ? :
1171 0 0 if ($self->{'path'}{'unsafecollapse'} eq $route->[0]) { }
1177 0 0 if index($route->[0], "*", length($route->[0]) - 1) == -1
1178 0 0 if rindex($self->{'path'}{'unsafecollapse'}, substr($route->[0], 0, -1), 0) != 0
1190 0 0 defined $self->{'header'}{'Host'} ? :
1204 0 0 if (&Encode::is_utf8($fileitem->{'buf'}))
1208 0 0 if ($self->{'outheaders'}{'Transfer-Encoding'} and $self->{'outheaders'}{'Transfer-Encoding'} eq "chunked")
1222 0 0 unless ($code)
1224 0 0 if (defined $self->{'header'}{'_RangeStart'}) { }
1234 0 0 if ($code == 206) { }
1237 0 0 if (defined $end) { }
0 0 elsif (defined $size) { }
1257 0 0 if ($end < $start)
1270 0 0 if (not defined $contentlength) { }
1291 0 0 unless ($headtext)
1301 0 0 if ($opt->{'attachment'}) { }
0 0 elsif ($opt->{'inline'}) { }
1308 0 0 if ($filename)
1318 0 0 if ($opt->{'allowSAB'})
1332 0 0 if ($dataitem->{'fh'})
1371 0 0 if ($code == 301) { }
0 0 elsif ($code == 307) { }
1389 0 0 $slash != -1 ? :
1392 0 0 if ($slash != -1)
1398 0 0 if ($qs)
1402 0 0 if (ref $qs->{$key} ne 'ARRAY') { }
1427 0 0 if ($self->{'method'} ne 'HEAD') { }
1429 0 0 unless (open $FH, "<", $requestfile)
1436 0 0 unless ($st)
1448 0 0 if (defined $start)
1449 0 0 if ($start >= $currentsize) { }
0 0 elsif ($fileitem{'fh'}) { }
1466 0 0 if ($done)
1469 0 0 if (defined $locksz) { }
1480 0 0 if (defined $self->{'header'}{'_RangeEnd'})
1485 0 0 if ($fileitem{'fh'})
1486 0 0 unless ($done)
1494 0 0 if (defined $self->{'header'}{'_RangeEnd'})
1496 0 0 if $rangesize <= $maxsize
1507 0 0 if (index($requestfile, $allowed, length($requestfile) - length($allowed)) != -1)
1514 0 0 if ($filelength == '99999999999')
1524 0 0 if ($self->{'responseopt'}{'cd_file'})
1534 0 0 unless (defined $filelength)
1543 0 0 defined $self->{'header'}{'_RangeEnd'} ? :
1562 0 0 if (defined $self->{'header'}{'_RangeStart'}) { }
1573 0 0 unless open my $cmdh, "-|", @cmd
1591 0 0 if (&Encode::is_utf8($buf))
1599 0 0 if (not $options->{'code'} or $options->{'code'} == 206)
1607 0 0 unless (open $fh, "<", \$buf)
1665 0 0 unless ($libtarsize)
1708 0 0 if defined $requestfile
1711 0 0 if (not defined $requestfile or rindex($requestfile, $droot, 0) != 0) { }
0 0 elsif (-f $requestfile) { }
0 0 elsif (-d _) { }
1717 0 0 if (index($request->{'path'}{'unsafecollapse'}, '/', length($request->{'path'}{'unsafecollapse'}) - 1) == -1) { }
1727 0 0 if (index($request->{'path'}{'unescapepath'}, '/', length($request->{'path'}{'unescapepath'}) - 1) != -1) { }
1729 0 0 if (-f $index)
1751 0 0 if defined $requestfile
1752 0 0 if (not defined $requestfile or rindex($requestfile, $ml, 0) != 0)
1757 0 0 if (-f $requestfile) { }
0 0 elsif (-d _) { }
1758 0 0 if (index($self->{'path'}{'unsafecollapse'}, '/', length($self->{'path'}{'unsafecollapse'}) - 1) == -1) { }
1768 0 0 if (substr($self->{'path'}{'unescapepath'}, -1) eq '/') { }
1769 0 0 unless opendir my $dh, $requestfile
1773 0 0 if $filename eq "." or $filename eq ".."
1774 0 0 unless -s "$requestfile/$filename"
1776 0 0 if -d _
1794 0 0 if (length $self->{'client'}{'inbuf'} < $self->{'header'}{'Content-Length'})
1802 0 0 if ($dlength >= $contentlength) { }
1805 0 0 if ($dlength > $contentlength) { }
1828 0 0 if ($self->{'header'}{'Content-Length'} > 20000000)
1834 0 0 if (length $self->{'client'}{'inbuf'} < $self->{'header'}{'Content-Length'})
1840 0 0 if ($dlength >= $contentlength)
1843 0 0 if ($dlength > $contentlength) { }
1861 0 0 if &$uploader($self, $requestfile)
1902 0 0 unless (defined $self)
1960 0 0 unless (defined $self->{'sock'}->recv($tempdata, 65536))
1961 0 0 unless ($!{'EAGAIN'} or $!{'EWOULDBLOCK'})
1968 0 0 if (length $tempdata == 0)
1979 0 0 unless (defined $self->{'request'}{'on_read_ready'})
1984 0 0 unless ($res)
1987 0 0 if (defined $self->{'request'}{'response'}) { }
0 0 elsif (defined $self->{'request'}{'on_read_ready'}) { }
1998 0 0 unless (defined $self->{'request'}{'response'})
2004 0 0 if (not defined $tsrRet) { }
0 0 elsif ($tsrRet ne '') { }
2009 0 0 if ($self->{'request'}{'outheaders'}{'Connection'} and $self->{'request'}{'outheaders'}{'Connection'} eq "close")
2023 0 0 if ($res)
2024 0 0 if (defined $self->{'request'}{'response'}) { }
0 0 elsif (defined $self->{'request'}{'on_read_ready'}) { }
2047 0 0 if (defined $self->{'sock'}->recv($tempdata, 65536))
2048 0 0 if (length $tempdata == 0)
2055 0 0 unless ($!{'EAGAIN'})
2066 0 0 if (defined $client->{'request'}{'response'}) { }
2069 0 0 if (not defined $tsrRet) { }
0 0 elsif ($tsrRet ne '') { }
2074 0 0 if ($client->{'request'}{'outheaders'}{'Connection'} and $client->{'request'}{'outheaders'}{'Connection'} eq "close")
2092 0 0 if ($sentthiscall > 0)
2101 0 0 unless defined $dataitem->{'buf'}
2105 0 0 if (length $dataitem->{'buf'})
2108 0 0 unless (defined $sret)
2112 0 0 if ($sret)
2115 0 0 if (defined $client->{'sendresponsetimerid'})
2121 0 0 if (length $dataitem->{'buf'} > 0)
2132 0 0 if (defined $dataitem->{'fh'}) { }
0 0 elsif (defined $dataitem->{'cb'}) { }
2137 0 0 if ($filepos != tell $FH)
2140 0 0 if ($req_length and $filepos >= $req_length) { }
2141 0 0 if ($filepos > $req_length)
2149 0 0 if ($req_length)
2151 0 0 if $tmpsend < $readamt
2155 0 0 if (not defined $bytesRead) { }
0 0 elsif ($bytesRead == 0) { }
2161 0 0 if (not $req_length) { }
2183 0 0 unless ($newdata)
2191 0 0 if ($encode_chunked)
2210 0 0 if (not defined $sret) { }
0 0 elsif ($sret) { }
2211 0 0 if ($!{'EAGAIN'}) { }
0 0 elsif ($!{'ECONNRESET'}) { }
0 0 elsif ($!{'EPIPE'}) { }
2241 0 0 if ($self->{'sock'})
2267 0 0 if ($ret == 0)
2271 0 0 if ($ret == -1)
2274 0 0 if ($ret == 1)
2285 0 0 if $self->{'process'}
2310 0 0 if ($ret == 0)
2314 0 0 if ($ret == -1)
2317 0 0 if ($ret == 1)
2374 0 0 if ($fddispatch->{'SIGCHLD'})
2379 0 0 if ($fddispatch->{'STDIN'}) { }
2386 0 0 if ($fddispatch->{'STDOUT'}) { }
2393 0 0 if ($fddispatch->{'STDERR'}) { }
2401 0 0 if ($handlesettings->{'O_NONBLOCK'})
2404 0 0 unless 0 == fcntl($err, 3, $flags)
2406 0 0 unless 0 == fcntl($err, 4, $flags)
2408 0 0 unless 0 == fcntl($out, 3, $flags)
2410 0 0 unless 0 == fcntl($out, 4, $flags)
2412 0 0 unless defined $in->blocking(0)
2422 0 0 if ($cb)
2444 0 0 if ($env)
2458 0 0 if ($@)
2464 0 0 if ($env)
2489 0 0 if ($context->{'on_stdout_data'})
2515 0 0 if ($context->{'on_stdout_data'})
2522 0 0 if ($context->{'input'})
2527 0 0 if ($curbuf)
2529 0 0 if (not defined $rv) { }
0 0 elsif ($rv != length $curbuf) { }
2530 0 0 unless ($!{'EAGAIN'})
2545 0 0 unless (defined $context->{'curbuf'})
2591 0 0 if (defined $inputdata)
2609 0 0 unless pipe my $inreader, my $inwriter
2610 0 0 unless pipe my $outreader, my $outwriter
2611 0 0 unless pipe my $errreader, my $errwriter
2615 0 0 if ($pid == 0)
2619 0 0 unless open STDIN, "<&", $inreader
2620 0 0 unless open STDOUT, ">&", $errwriter
2621 0 0 unless open STDERR, ">&", $errwriter
2636 0 0 if (fork == 0)
2637 0 0 unless open STDOUT, ">&", $sockfh
2661 0 0 if (defined $self->{'fd'}{$key}{'fd'} and $fd == $self->{'fd'}{$key}{'fd'})
2673 0 0 if (defined $self->{'fd'}{$key}{'fd'})
2712 0 0 unless (defined $type)
2713 0 0 if (defined $value)
2717 0 0 if ($raw or $noindent)
2722 0 0 if (not defined $value) { }
0 0 elsif ($value eq '__indent-') { }
2739 0 0 if ($type eq "NOP")
2743 0 0 unless $noindent
2744 0 0 if ($type eq 'SCALAR') { }
0 0 elsif ($type eq 'HASH') { }
0 0 elsif ($type eq 'ARRAY') { }
2746 0 0 unless ($raw)
2753 0 0 unless $raw
2786 0 0 if ($source->{'type'} ne "local")
2804 0 0 if (exists $launchsettings->{'CFGDIR'})
2808 0 0 if (exists $launchsettings->{'APPDIR'})
2809 0 0 unless -d $launchsettings->{'APPDIR'}
2812 0 0 if (exists $launchsettings->{'FALLBACK_DATA_ROOT'})
2818 0 0 unless ($CFGDIR)
2820 0 0 if $ENV{'APPDATA'}
2824 0 0 if $cfg_fallback
2826 0 0 if $XDG_CONFIG_HOME
2830 0 0 if (-d "$cfgdir/mhfs")
2835 0 0 if $XDG_CONFIG_HOME
2836 0 0 unless defined $CFGDIR
2843 0 0 unless ($SETTINGS)
2844 0 0 if $@
2845 0 0 if -e $SETTINGS_FILE
2859 0 0 unless (-f $SETTINGS_FILE)
2863 0 0 if exists $launchsettings->{'flush'}
2873 0 0 if $ENV{'APPDATA'}
2874 0 0 if ($FALLBACK_DATA_ROOT)
2881 0 0 unless $rule->[0] =~ m[^([^/]+)(?:/(\d{1,2}))?$]
2884 0 0 unless defined $ip
2885 0 0 unless $cidr >= 0 and $cidr <= 32
2892 0 0 if $rule->[1]
2894 0 0 if ($rule->[2])
2896 0 0 if index($absurl, "/", length($absurl) - 1) != -1
2900 0 0 if ($rule->[3])
2906 0 0 unless ($SETTINGS->{'DOCUMENTROOT'})
2911 0 0 if $ENV{'XDG_CACHE_HOME'}
2912 0 0 if $FALLBACK_DATA_ROOT
2913 0 0 unless defined $tmpdir
2915 0 0 unless ($SETTINGS->{'RUNTIME_DIR'})
2917 0 0 unless ($RUNTIMEDIR)
2924 0 0 if $ENV{'XDG_DATA_HOME'}
2925 0 0 if $FALLBACK_DATA_ROOT
2926 0 0 unless defined $datadir
2940 0 0 if (ref $srcs ne "ARRAY")
2947 0 0 if ($stype ne "HASH")
2948 0 0 if ($stype ne "")
2978 0 0 if $FALLBACK_DATA_ROOT
3007 0 0 if ($type eq 'd' or $type eq 'l') { }
0 0 elsif ($type eq 'bstr') { }
0 0 elsif ($type eq 'int') { }
0 0 elsif ($type eq 'e') { }
3039 0 0 if (substr($$contents, $foffset) =~ /^(0|[1-9][0-9]*):/) { }
0 0 elsif (substr($$contents, $foffset, 1) eq 'e' and $nodestack[-1][0] eq 'l' || $nodestack[-1][0] eq 'd' && scalar(@{$nodestack[-1];}) % 2 == 1) { }
0 0 elsif ($nodestack[-1][0] ne 'd' or scalar(@{$nodestack[-1];}) % 2 == 0) { }
3055 0 0 if ($firstchar eq 'd' or $firstchar eq 'l') { }
0 0 elsif (substr($$contents, $foffset - 1) =~ /^i(0|\-?[1-9][0-9]*)e/) { }
3075 0 0 if (scalar @nodestack == 1)
3095 0 0 unless $tree
3115 0 0 unless (exists $opt->{'src'} and exists $opt->{'dest_metafile'} and exists $opt->{'tracker'})
3122 0 0 if $opt->{'private'}
3140 0 0 if ($node->[0] ne "d")
3145 0 0 if ($node->[$i][1] eq $key)
3153 0 0 if ($valuetype and $node->[0] ne $valuetype)
3162 0 0 if ($node->[0] ne "d")
3176 0 0 unless $infodata
3194 0 0 unless (exists $self->{'sources'}{$sid})
3199 0 0 if ($src->{'type'} ne "local")
3205 0 0 unless $absolute
3206 0 0 unless $absolute =~ /^$location/
3244 0 0 unless ($process)
3255 0 0 if ($output =~ /ERROR/)
3266 0 0 if ($output =~ /ERROR/)
3277 0 0 if ($output =~ /ERROR/)
3288 0 0 if ($output =~ /ERROR/)
3299 0 0 if ($output =~ /ERROR/)
3310 0 0 if ($output =~ /ERROR/)
3321 0 0 if ($output =~ /ERROR/)
3333 0 0 if ($output =~ /ERROR/)
3344 0 0 if ($output =~ /ERROR/)
3356 0 0 if ($output =~ /ERROR/)
3361 0 0 if ($output =~ /ERROR/)
3375 0 0 if ($output =~ /ERROR/)
3391 0 0 if ($output =~ /ERROR/)
3402 0 0 if ($output =~ /ERROR/)
3411 0 0 unless defined $line
3412 0 0 if (substr($line, 0, 1) ne "[")
3419 0 0 unless (defined $newline)
3427 0 0 unless (defined $file and defined $size)
3436 0 0 if (@fkeys == 1)
3440 0 0 unless (defined $res)
3443 0 0 if ($res == 1)
3461 0 0 unless ($torrent)
3470 0 0 if (not defined $bytes_done) { }
3474 0 0 unless (defined $_[0])
3477 0 0 unless (defined $_[0])
3480 0 0 unless (defined $_[0])
3489 0 0 unless (defined $_[0])
3492 0 0 unless (defined $_[0])
3518 1 0 if (not eval "use JSON; 1")
3519 0 1 unless eval "use JSON::PP; 1"
3540 1 0 if (not &HAS_MHFS_XS())
3550 0 0 unless $statinfo
3554 0 0 if (not S_ISDIR($statinfo->mode)) { }
3555 0 0 unless $path =~ /\.(flac|mp3|m4a|wav|ogg|webm)$/
3560 0 0 unless (opendir $dir, $path)
3569 0 0 if $file eq "." or $file eq ".."
3570 0 0 if (my $file = BuildLibrary("$path/$file"))
3575 0 0 if $size eq 0
3587 0 0 if ($files->[2]) { }
3606 0 0 if ($where eq "")
3613 0 0 if ($where eq "")
3630 0 0 unless ($file)
3637 0 0 if ($file->[2])
3669 0 0 if ($request->{'qs'}{'forcerefresh'}) { }
0 0 elsif ($request->{'qs'}{'refresh'}) { }
3685 0 0 unless ($fmt)
3688 0 0 if ($request->{'header'}{'User-Agent'} =~ m[Chrome/([^\.]+)]) { }
0 0 elsif ($request->{'header'}{'User-Agent'} =~ m[Firefox/([^\.]+)]) { }
3692 0 0 if ($ver < 93)
3693 0 0 if ($ver < 68 or $request->{'header'}{'User-Agent'} =~ /Linux/)
3701 0 0 if ($ver < 79)
3710 0 0 if ($request->{'qs'}{'segments'})
3716 0 0 defined $request->{'qs'}{'ptrack'} ? :
3717 0 0 if ($fmt eq 'worklet') { }
0 0 elsif ($fmt eq 'musicdbjson') { }
0 0 elsif ($fmt eq 'musicdbhtml') { }
0 0 elsif ($fmt eq 'gapless') { }
0 0 elsif ($fmt eq 'musicinc') { }
0 0 elsif ($fmt eq 'legacy') { }
3747 0 0 if (defined $request->{'qs'}{'part'}) { }
0 0 elsif (defined $request->{'qs'}{'fmt'} and $request->{'qs'}{'fmt'} eq 'wav') { }
3748 0 0 unless (&HAS_MHFS_XS())
3754 0 0 unless ($TRACKDURATION{$tosend})
3768 0 0 $samples_per_seg < $samples_left ? :
3772 0 0 unless (&HAS_MHFS_XS())
3792 0 0 if ($actual_endbyte >= $endbyte)
3808 0 0 if ($request->{'qs'}{'action'} and $request->{'qs'}{'action'} eq 'dl') { }
0 0 elsif (lc substr($tosend, -4) eq '.mp3') { }
3813 0 0 if (&HAS_MHFS_XS())
3814 0 0 unless ($TRACKINFO{$tosend})
3854 0 0 unless open my $fh, "<", $file
3856 0 0 unless seek $fh, 8, 0
3857 0 0 unless read($fh, $buf, 34) == 34
3869 0 0 if ($justsendfile)
3877 0 0 if $nameloc
3882 0 0 unless ($is_flac)
3886 0 0 if (-e $tlossy) { }
3890 0 0 if (defined LOCK_GET_LOCKDATA($tlossy))
3901 0 0 if (LOCK_WRITE($tlossy)) { }
3923 0 0 unless (defined $TRACKINFO{$file})
3930 0 0 $max_sample_rate > 48000 ? :
3937 0 0 if ($samplerate <= $max_sample_rate and $inbitdepth <= $bitdepth)
3951 0 0 if ($setting->[0] <= $bitdepth and $setting->[1] <= $max_sample_rate)
3959 0 0 if (-e $tmpfile)
3970 0 0 if ($samplerate % $key == 0)
3972 0 0 if ($rate <= $samplerate and $rate <= $max_sample_rate)
3986 0 0 if (LOCK_WRITE($outfile)) { }
4017 0 0 if ($source->{'type'} eq 'local') { }
0 0 elsif ($source->{'type'} eq 'ssh') { }
0 0 elsif ($source->{'type'} eq 'mhfs') { }
4027 0 0 unless ($lib)
4029 0 0 if $source->{'type'} eq "local"
4035 0 0 if $already->[0] eq $item->[0]
4052 0 0 if ($libcomponent->[3] eq $component)
4095 0 0 unless $node
4098 0 0 if ($utf8name =~ m[(.+/).+$])
4102 0 0 if ($sendFiles{$source->{'type'}}($request, $node->{'path'}, $node->{'node'}, $source, $nameloc))
4114 0 0 unless (&HAS_MHFS_XS())
4123 0 0 unless $node
4145 0 0 unless $node
4149 0 0 unless (opendir $dh, $dname)
4151 0 0 unless (opendir $dh, $dname)
4161 0 0 if $last eq ".png" or $last eq ".jpg" or $last eq "jpeg"
4164 0 0 unless (@files)
4171 0 0 if (substr($file, 0, length $expname) eq $expname)
4202 0 0 if ($before{$pupdate} ne $self->{$pupdate})
4219 0 0 unless (eval { do { $unthawed = thaw($out); return 1 } })
4226 0 0 if ($unthawed) { }
4305 1 0 if (not eval "use JSON; 1")
4306 0 1 unless eval "use JSON::PP; 1"
4317 0 0 if ($query)
4323 0 0 if ($request->{'qs'}{'media'})
4335 0 0 if $request->{'qs'}{'media'}
4336 0 0 if ($request->{'qs'}{'media'} and $request->{'qs'}{'media'} eq 'music') { }
4350 0 0 unless ($json)
4358 0 0 unless defined $id
4362 0 0 if defined $media
4421 0 0 if ($request->{'qs'}{'fmt'} eq 'json') { }
4441 0 0 unless ($request)
4457 0 0 unless $cl
4459 0 0 if ($cr)
4461 0 0 if $cr > $cl
4469 0 0 unless $st
4471 0 0 if $cl < $minsize
4472 0 0 if $st->size < $minsize
4492 0 0 unless $qs->{'id'}
4495 0 0 if (defined $qs->{'media'} and defined $self->{'fmts'}{$qs->{'media'}}) { }
4553 0 0 if (not $youtubedl) { }
0 0 elsif (not -e $youtubedl) { }
4555 0 0 unless (-e $mhfsytdl)
4557 0 0 if (system("curl", "-L", "https://yt-dl.org/downloads/latest/youtube-dl", "-o", $mhfsytdl) != 0)
4561 0 0 if (system("chmod", "a+rx", $mhfsytdl) != 0)
4577 0 0 unless ($installed)
4579 0 0 if (fork == 0)
4602 0 0 unless ($fileitem)
4607 0 0 unless ($absurl)
4622 0 0 unless ($torrentData)
4626 0 0 unless ($torrent)
4666 0 0 unless (exists $request->{'qs'}{$key})
4676 0 0 if ($port ne unpack("S", pack("S", $port)))
4681 0 0 if ($left ne unpack("Q", pack("Q", $left)))
4685 0 0 if (exists $request->{'qs'}{'compact'} and $request->{'qs'}{'compact'} eq 0)
4691 0 0 unless (exists $self->{'torrents'}{$rih})
4708 0 0 if ($left == 0)
4714 0 0 if (defined $event)
4716 0 0 if ($event eq 'started') { }
0 0 elsif ($event eq 'stopped') { }
0 0 elsif ($event eq 'completed') { }
4728 0 0 if (not defined $numwant or $numwant ne unpack("C", pack("C", $numwant)) or $numwant > 55)
4739 0 0 if ($self->{'torrents'}{$rih}{$peer}{'completed'}) { }
4745 0 0 if ($i++ < $numwant)
4746 0 0 if ($peer ne $ipport)
4750 0 0 if ($netmap and ($values[0] == $netmap->[1] and unpack("C", $ipport) != $netmap->[1]) and $pubip)
4769 0 0 if ($bdata) { }
4780 0 0 $settings->{'BitTorrent::Tracker'} && $settings->{'BitTorrent::Tracker'}{'announce_interval'} ? :
4789 0 0 unless ($odres)
4794 0 0 if substr($file, 0, 1) eq "."
4797 0 0 unless ($torrentcontents)
4802 0 0 unless ($torrent)
4829 0 0 if ($current_time - $peerdata->{'last_announce'} > $self->{'announce_interval'} + 60)
4863 0 0 if is_video($file)
4864 0 0 if is_mhfs_music_playable($file)
4874 0 0 if (defined $qs->{'infohash'}) { }
4881 0 0 unless (defined $_[0])
4899 0 0 if ($bytes_done < $size_bytes) { }
4906 0 0 unless (defined $_[0])
4919 0 0 if not defined $qs->{'playinbrowser'} or $qs->{'playinbrowser'} == 1
4933 0 0 unless (defined $_[0])
4943 0 0 if ($curtor =~ /^\[(u?)['"](.+)['"],\s'(.+)',\s([0-9]+),\s([0-9]+),\s([0-9]+)\]$/) { }
4951 0 0 if ($is_unicode)
4957 0 0 if ($qs->{'logunicode'})
4968 0 0 unless ($line)
4985 0 0 if (exists $request->{'qs'}{'dlsubsystem'} and exists $request->{'qs'}{'privdata'})
4987 0 0 if (exists $self->{'dlsubsystems'}{$subsystem})
4991 0 0 unless ($result)
5050 0 0 if (rindex($request->{'path'}{'unsafepath'}, "/od/" . $key, 0) == 0)
5082 0 0 if (not -d $video->{'src_file'}{'filepath'}) { }
5116 0 0 if (scalar @pathcomponents >= 3)
5117 0 0 if ($pathcomponents[2] eq "video")
5118 0 0 if (scalar @pathcomponents >= 5)
5124 0 0 unless ($video{'src_file'})
5130 0 0 if ($fmt eq "m3u8")
5132 0 0 unless ($absurl)
5138 0 0 $video{'src_file'}{'ext'} ? :
5170 0 0 unless (defined $tvdir)
5175 0 0 unless (opendir $dh, $tvdir)
5183 0 0 if $filename eq "." or $filename eq ".."
5184 0 0 unless -s "$tvdir/$filename"
5186 0 0 unless $filename =~ /^(.+)[\.\s]+S\d+/
5188 0 0 if ($showname)
5190 0 0 unless ($shows{$showname})
5200 0 0 if ($request->{'path'}{'unsafepath'} ne $kodidir)
5204 0 0 $slash != -1 ? :
5205 0 0 $slash != -1 ? :
5208 0 0 unless ($showitems)
5218 0 0 if (not $item) { }
0 0 elsif (rindex($item, $tvdir, 0) != 0) { }
0 0 elsif (-f $item) { }
0 0 elsif (-d _) { }
5226 0 0 if (not $showfilename) { }
0 0 elsif ($showfilename eq $filebasename) { }
5230 0 0 if (index($request->{'path'}{'unsafecollapse'}, '/', length($request->{'path'}{'unsafecollapse'}) - 1) == -1) { }
5241 0 0 unless opendir my $dh, $item
5244 0 0 if $newitem eq "." or $newitem eq ".."
5257 0 0 if (index($request->{'path'}{'unescapepath'}, "/", length($request->{'path'}{'unescapepath'}) - 1) == -1)
5267 0 0 if $show->{'isdir'}
5278 0 0 unless (defined $moviedir)
5283 0 0 unless (opendir $dh, $moviedir)
5291 0 0 if $filename eq "." or $filename eq ".."
5292 0 0 unless -s "$moviedir/$filename"
5295 0 0 if ($filename =~ /^(.+)[\.\s]+\(?(\d{4})([^p]|$)/) { }
0 0 elsif ($filename =~ /^(.+)(\.DVDRip)\.[a-zA-Z]{3,4}$/) { }
0 0 elsif ($filename =~ /^(.+)\.VHS/) { }
0 0 elsif ($filename =~ /^(.+)[\.\s]+\d{3,4}p\.[a-zA-Z]{3,4}$/) { }
0 0 elsif ($filename =~ /^(.+)\.[a-zA-Z]{3,4}$/) { }
5314 0 0 if ($showname)
5316 0 0 unless ($shows{$showname})
5326 0 0 if ($request->{'path'}{'unsafepath'} ne $kodidir)
5331 0 0 $slash != -1 ? :
5332 0 0 $slash != -1 ? :
5336 0 0 unless ($showitems)
5346 0 0 if (not $item) { }
0 0 elsif (rindex($item, $moviedir, 0) != 0) { }
0 0 elsif (-f $item) { }
0 0 elsif (-d _) { }
5354 0 0 if (not $showfilename) { }
0 0 elsif ($showfilename eq $filebasename) { }
5358 0 0 if (index($request->{'path'}{'unsafecollapse'}, '/', length($request->{'path'}{'unsafecollapse'}) - 1) == -1) { }
5369 0 0 unless opendir my $dh, $item
5372 0 0 if $newitem eq "." or $newitem eq ".."
5385 0 0 if (index($request->{'path'}{'unescapepath'}, "/", length($request->{'path'}{'unescapepath'}) - 1) == -1)
5395 0 0 if $show->{'isdir'}
5413 0 0 if (scalar @pathcomponents >= 3)
5414 0 0 if ($pathcomponents[2] eq 'movies') { }
0 0 elsif ($pathcomponents[2] eq 'tv') { }
5451 0 0 if ($MHFS::Plugin::GetVideo::Config{'ivsize'} < 8)
5503 0 0 if (defined $qs->{'name'}) { }
0 0 elsif ($$videoformats{$video{'out_fmt'}}{'plugin'}) { }
5504 0 0 if (defined $qs->{'sid'}) { }
5506 0 0 unless ($video{'src_file'})
5517 0 0 if ($video{'out_fmt'} eq 'noconv') { }
0 0 elsif ($video{'out_fmt'} eq 'mkvinfo') { }
0 0 elsif ($video{'out_fmt'} eq 'fmp4') { }
5531 0 0 unless (-e $video{'src_file'}{'filepath'})
5539 0 0 if $video{'out_fmt'} eq "hls"
5543 0 0 unless ($video{'out_base'} = $video{'plugin'}->getOutBase($qs))
5560 0 0 if (-e $video{'out_filepath'})
5567 0 0 if ($videoformats->{$fmt}{'lock'} == 1 and LOCK_WRITE($video{'out_filepath'}) != 1)
5571 0 0 if ($video{'plugin'}) { }
0 0 elsif (defined $videoformats->{$fmt}{'create_cmd'}) { }
5585 0 0 if ($fmt eq "hls")
5595 0 0 unless (defined $request)
5602 0 0 unless (-e $filename)
5606 0 0 if (defined $minsize and -s $filename < $minsize)
5609 0 0 if (defined $video{'on_exists'})
5610 0 0 unless $video{'on_exists'}->($settings, \%video)
5617 0 0 if (pid_running($video{'pid'}))
5638 0 0 if (defined $fmt)
5641 0 0 if (defined $self->{'VIDEOFORMATS'}{$fmt})
5659 0 0 if ($line =~ /^(.+)\.m3u8_v$/)
5672 0 0 if ($subm3u and -e $reqsub)
5678 0 0 if $sub->{'is_default'}
5679 0 0 if $sub->{'is_forced'}
5691 0 0 unless ($matroska)
5697 0 0 if (defined $request->{'qs'}{'mkvinfo_time'}) { }
5699 0 0 unless ($track)
5704 0 0 unless ($gopinfo)
5720 0 0 if ($request->{'qs'}{'fmp4_time'})
5764 0 0 unless (defined $sync)
5768 0 0 if ($sync != 65521)
5781 0 0 $ebml->{'elements'} > 0 ? :
5782 0 0 if $lastelm and defined $lastelm->{'size'} and $amount > $lastelm->{'size'}
5785 0 0 unless ($amtread)
5790 0 0 if ($elem->{'size'})
5799 0 0 unless $whence == 1
5800 0 0 if $ebml->{'elements'} > 0 and $ebml->{'elements'}[-1]{'size'} and $position > $ebml->{'elements'}[-1]{'size'}
5801 0 0 unless seek $ebml->{'fh'}, $position, $whence
5803 0 0 if ($elem->{'size'})
5817 0 0 if $value << $width - 1 & 128
5818 0 0 unless $width < 9
5821 0 0 unless length $$bufref >= $width - 1
5838 0 0 unless defined $value
5846 0 0 if (defined $savewidth)
5855 0 0 unless ebml_read($ebml, $value, 1)
5859 0 0 if $value << $width - 1 & 128
5860 0 0 unless $width < 9
5866 0 0 unless ebml_read($ebml, $byte, 1)
5877 0 0 unless read_vint($ebml, \$value, \$width)
5890 0 0 unless open my $fh, "<", $filename
5892 0 0 unless read $fh, $magic, 4
5893 0 0 unless $magic eq "\32E\337\243"
5896 0 0 unless read_and_parse_vint($ebml, \$ebmlheadsize)
5897 0 0 unless seek $fh, $ebmlheadsize, 1
5904 0 0 unless read_vint($ebml, \$id)
5906 0 0 unless read_and_parse_vint($ebml, \$size)
5915 0 0 unless ebml_seek($ebml, $elm->{'size'}, 1)
5924 0 0 unless $elm
5925 0 0 if ($elm->{'id'} == $id)
5929 0 0 unless ebml_skip($ebml)
5938 0 0 if (not $elm) { }
0 0 elsif (not $elm->{'data'}) { }
5950 0 0 unless ($elementid)
5954 0 0 unless $elementid < 4294967295
5958 0 0 unless $size < '72057594037927935'
5961 0 0 if ($elementid > 16777215) { }
0 0 elsif ($elementid > 65535) { }
0 0 elsif ($elementid > 255) { }
5981 0 0 if ($elm->{'infsize'}) { }
6048 0 0 if ($elm->{'id'} == 160) { }
0 0 elsif ($elm->{'id'} == 163) { }
6053 0 0 unless defined $id
6055 0 0 unless defined $size
6057 0 0 if $id == 161
6069 0 0 if (not defined $trackno or length $data < 3)
6079 0 0 if ($lacing == 2) { }
0 0 elsif ($lacing == 6) { }
0 0 elsif ($lacing == 4) { }
6087 0 0 if $val < 255
6150 0 0 if (telmval($track, "TrackNumber") == $trackno)
6163 0 0 unless $headread and $headread == 4
6169 0 0 unless $$type != 127
6172 0 0 unless $dataread and $dataread == $size
6208 0 0 unless $magic and $magic == 4
6214 0 0 unless $bref
6216 0 0 if ($type == 0)
6219 0 0 if $done
6238 0 0 if length $str == 0
6240 0 0 if length $str == 4
6242 0 0 if length $str == 8
6258 0 0 unless ($ebml)
6264 0 0 unless ($foundsegment)
6272 0 0 unless ($foundsegmentinfo)
6280 0 0 unless ($tselm)
6285 0 0 unless (ebml_read($ebml, $tsbinary, $tselm->{'size'}))
6291 0 0 unless defined $tsval
6294 0 0 unless (ebml_skip($ebml))
6301 0 0 unless ($durationelm)
6306 0 0 unless (ebml_read($ebml, $durbin, $durationelm->{'size'}))
6318 0 0 unless (ebml_skip($ebml))
6323 0 0 unless (ebml_skip($ebml))
6329 0 0 unless ($in_tracks)
6341 0 0 unless $packetsize
6345 0 0 if ($packetsread == $targetpackets)
6353 0 0 if (length $$dataref >= $targetsize)
6361 0 0 unless ($in_track)
6368 0 0 unless ($telm)
6376 0 0 if ($elm{'id'} == 215) { }
0 0 elsif ($elm{'id'} == 134) { }
0 0 elsif ($elm{'id'} == 131) { }
0 0 elsif ($elm{'id'} == 29637) { }
0 0 elsif ($elm{'id'} == 2352003) { }
0 0 elsif ($elm{'id'} == 225) { }
6383 0 0 if ($elm{'data'} =~ m[^([A-Z]+_)([A-Z0-9]+)(?:/([A-Z0-9_/]+))?$])
6386 0 0 if ($3)
6389 0 0 if $track{'CodecID_Prefix'} eq "A_"
6415 0 0 unless ($id)
6421 0 0 unless ($size)
6428 0 0 if ($id == 181) { }
0 0 elsif ($id == 159) { }
6442 0 0 if ($track{'CodecID_Major'} eq "EAC3" or $track{'CodecID_Major'} eq "AC3")
6459 0 0 if (scalar @tracks == 0)
6472 0 0 if (defined $tt and $tt->{'value'} == 2)
6483 0 0 if (defined $tt and $tt->{'value'} == 1)
6496 0 0 unless $custer
6502 0 0 unless ($belm)
6509 0 0 if ($elm{'id'} == 231)
6544 0 0 unless ($belm)
6547 0 0 if ($cluster)
6559 0 0 if ($elm{'id'} == 163 or $elm{'id'} == 160)
6561 0 0 if ($block and $block->{'trackno'} == $tid)
6585 0 0 unless $cluster
6590 0 0 if ($ctime <= $timeinseconds)
6593 0 0 if ($prevcluster)
6599 0 0 if ($ctime >= $timeinseconds)
6604 0 0 unless $desiredcluster
6607 0 0 if $desiredcluster->{'prevcluster'}
6619 0 0 if ($block)
6621 0 0 if ($blocktime > $timeinseconds)
6624 0 0 unless ($matroska->{'dc'}{'firstblk'})
6628 0 0 unless ($block)
6629 0 0 unless ($prevcluster)
6641 0 0 if ($timeinseconds < $blocktime + $blockduration)
6657 0 0 unless ($pcmFrameLen)
6665 0 0 unless $cluster
6671 0 0 if ($curframe <= $pcmFrameIndex)
6675 0 0 if ($prevcluster)
6681 0 0 if ($curframe >= $pcmFrameIndex)
6686 0 0 unless $desiredcluster
6689 0 0 if $desiredcluster->{'prevcluster'}
6701 0 0 if ($block)
6703 0 0 if ($blockframe > $pcmFrameIndex)
6707 0 0 unless ($block)
6708 0 0 unless ($prevcluster)
6720 0 0 if ($pcmFrameIndex < $blockframe + $pcmSampleCount)
6721 0 0 if (($pcmFrameIndex - $blockframe) % $pcmFrameLen != 0)
6767 0 0 unless ($pcmFrameLen)
6773 0 0 if ($matroska->{'curframe'} != $pcmFrameIndex)
6775 0 0 unless (matroska_seek_track($matroska, $track, $pcmFrameIndex))
6789 0 0 if ($matroska->{'curframe'} == $destframe)
6797 0 0 unless ($block)
6798 0 0 if ($matroska->{'ebml'}{'elements'}[0]{'id'} == 408125543 and $matroska->{'ebml'}{'elements'}[0]{'size'} == 0) { }
6830 0 0 if ($eline =~ /^\s*Stream\s#0:(\d+)(?:\((.+)\)){0,1}:\s(.+):\s(.+)(.*)$/) { }
0 0 elsif ($eline =~ /^\s+Duration:\s+(\d\d):(\d\d):(\d\d)\.(\d\d)/) { }
0 0 elsif (defined $current_stream) { }
6834 0 0 if $current_element->{'fmt'} =~ /\(default\)$/i
6835 0 0 if $current_element->{'fmt'} =~ /FORCED/i
6836 0 0 if ($type =~ /audio/i) { }
0 0 elsif ($type =~ /video/i) { }
0 0 elsif ($type =~ /subtitle/i) { }
6853 0 0 unless ($eline =~ /^\s\s+/)
6859 0 0 if ($eline =~ /\s+title\s*:\s*(.+)$/)
6904 0 0 if ($qs->{'library'} ne "all")
6911 0 0 unless exists $settings->{'MEDIASOURCES'}{$library}
6916 0 0 unless -d $sublib->{'folder'}
6919 0 0 unless $libhtmlcontent
7024 0 0 unless (&GetOptions("flush", \$flush, "cfgdir=s", \$cfgdir, "fallback_data_root=s", \$fallback_data_root, "appdir=s", \$appdir, "--help|h", \$help, "--version|v", \$versionflag))
7037 0 0 if ($help) { }
0 0 elsif ($versionflag) { }
7047 0 0 if $flush
7048 0 0 if $cfgdir
7049 0 0 if $fallback_data_root
7050 0 0 if $appdir