Branch Coverage

blib/lib/App/MHFS.pm
Criterion Covered Total %
branch 10 1474 0.6


line true false branch
31 0 0 unless $timerfd != -1
33 0 0 unless $timerhandle
55 0 0 $start > 1e-09 ? :
58 0 0 unless $settime_success == 0
66 0 0 if ($nread < 8)
73 0 0 unless (defined $nread)
74 0 0 unless ($!{'EAGAIN'})
111 0 0 if (defined $self{'children'}{$child}) { }
172 0 0 if defined $id
180 0 0 unless defined $self->{'timers'}[$i]{'id'}
181 0 0 if ($self->{'timers'}[$i]{'id'} == $id)
204 0 0 if ($current_time >= $timer->{'desired'}) { }
206 0 0 if (defined $timer->{'callback'}->($timer, $current_time, $self))
221 0 0 if ($pollret > 0) { }
0 0 elsif ($pollret == 0) { }
0 0 elsif (not $!{'EINTR'}) { }
225 0 0 if ($revents & 1)
227 0 0 unless (defined $obj->onReadReady)
234 0 0 if ($revents & 4)
236 0 0 unless (defined $obj->onWriteReady)
243 0 0 if ($revents & 16)
271 0 0 if ($self->{'timers'}) { }
278 0 0 if (@{$self->{'timers'};}) { }
305 0 0 if ($self->SUPER::add_timer(@_) == 0)
315 0 0 if (@{$self->{'timers'};})
329 0 0 if ($self->{'timers'}) { }
348 1 0 if (index($MHFS::EventLoop::Poll::Config{'archname'}, 'x86_64-linux') != -1) { }
349 1 0 if (not &main::HAS_EventLoop_Poll_Linux_Timer()) { }
361 1 0 if (not $isLoaded)
394 0 0 if (exists $settings->{'flush'} and $settings->{'flush'})
406 0 0 unless ($sock)
411 0 0 unless ($sock->setsockopt(1, 9, 1))
429 0 0 if (index($MHFS::HTTP::Server::Config{'osname'}, "linux") != -1)
431 0 0 unless $sock->setsockopt(6, 12, 1)
441 0 0 unless ($fs)
450 0 0 if defined $settings->{$pluginname}{'enabled'} and not $settings->{$pluginname}{'enabled'}
452 0 0 unless $plugin
458 0 0 if (my $func = $plugin->{'uploader'})
485 0 0 unless ($csock)
492 0 0 unless ($peerhost)
497 0 0 unless (defined $peerip)
503 0 0 if (($peerip & $allowedHost->{'subnetmask'}) == $allowedHost->{'ip'})
508 0 0 unless ($ah)
513 0 0 unless ($peerport)
544 0 0 unless (defined $bytes)
561 0 0 if (-e $lockname)
577 0 0 unless open my $fh, ">", $filename
587 0 0 if (not open(my $fh, '<', $filename)) { }
605 0 0 unless $dir_matches
606 0 0 if (/$name_req/i)
607 0 0 if -d $_
613 0 0 if (defined $path_req)
636 0 0 if ($pid == 0) { }
677 0 0 if defined &{$funcname;}
701 0 0 unless (opendir $dir, $path)
709 0 0 if $file =~ /^..?$/
712 0 0 @files ? :
716 0 0 unless (defined $path)
717 0 0 if $options->{'on_dir_end'}
721 0 0 if (-d $path)
722 0 0 if $options->{'on_dir_start'}
727 0 0 if ($root)
731 0 0 unless (defined $size)
735 0 0 if $size < $options->{'min_file_size'}
736 0 0 if $options->{'on_file'}
752 0 0 unless (defined $data{$multiple})
758 0 0 unless defined $data{$m2}
816 0 0 if (scalar @values != 4)
820 0 0 unless $values[$i] <= 255
846 0 0 unless length $$octets >= 1
851 0 0 if (($byteval & $rule->[0]) == $rule->[1])
856 0 0 unless length $octets >= $charlen
858 0 0 if (length $char > 1)
897 0 0 unless length $octets
905 0 0 if ($chardata->{'bytelength'} == 3 and $chardata->{'codepoint'} >= 55296 and $chardata->{'codepoint'} <= 56319)
907 0 0 if ($secondchar and $secondchar->{'bytelength'} == 3 and $secondchar->{'codepoint'} >= 56320 and $secondchar->{'codepoint'} <= 57343)
929 0 0 unless length $escapedoctets
955 0 0 if ($mebibytes >= 1024) { }
988 1 0 if (not eval "use JSON; 1")
989 0 1 unless eval "use JSON::PP; 1"
1021 0 0 if ($ipos != -1) { }
0 0 elsif (length $self->{'client'}{'inbuf'} > 8192) { }
1022 0 0 if (substr($self->{'client'}{'inbuf'}, 0, $ipos + 2, '') =~ m[^(([^\s]+)\s+([^\s]+)\s+(?:HTTP/1\.([0-1])))\r\n]) { }
1031 0 0 if ($self->{'method'} ne "GET" and $self->{'method'} ne "HEAD" and $self->{'method'} ne "PUT")
1049 0 0 if (index($pathStruct{'unsafecollapse'}, "/", length($pathStruct{'unsafecollapse'}) - 1) != -1)
1062 0 0 if (defined $value)
1063 0 0 if (not defined $qsStruct{$key}) { }
1067 0 0 if (ref $qsStruct{$key} ne "ARRAY")
1097 0 0 if ($ipos == -1) { }
0 0 elsif (substr($self->{'client'}{'inbuf'}, 0, $ipos + 2, '') =~ /^(([^:]+):\s*(.*))\r\n/) { }
1098 0 0 if (length $self->{'client'}{'inbuf'} > 8192)
1116 0 0 if ($self->{'client'}{'serverhostname'})
1117 0 0 if (not $self->{'header'}{'Host'} or $self->{'header'}{'Host'} ne $self->{'client'}{'serverhostname'})
1129 0 0 if ($self->{'client'}{'X-MHFS-PROXY-KEY'} and $self->{'header'}{'X-MHFS-PROXY-KEY'})
1133 0 0 if (not $trusted) { }
1136 0 0 if (exists $self->{'header'}{$forbidden})
1145 0 0 if $self->{'header'}{'X-Forwarded-For'}
1148 0 0 if ($netmap and $self->{'ip'} >> 24 == $netmap->[0])
1155 0 0 if (defined $self->{'header'}{'Range'} and $self->{'header'}{'Range'} =~ /^bytes=([0-9]+)\-([0-9]*)$/)
1157 0 0 $2 ne '' ? :
1166 0 0 if ($self->{'path'}{'unsafecollapse'} eq $route->[0]) { }
1172 0 0 if index($route->[0], "*", length($route->[0]) - 1) == -1
1173 0 0 if rindex($self->{'path'}{'unsafecollapse'}, substr($route->[0], 0, -1), 0) != 0
1185 0 0 defined $self->{'header'}{'Host'} ? :
1199 0 0 if (&Encode::is_utf8($fileitem->{'buf'}))
1203 0 0 if ($self->{'outheaders'}{'Transfer-Encoding'} and $self->{'outheaders'}{'Transfer-Encoding'} eq "chunked")
1217 0 0 unless ($code)
1219 0 0 if (defined $self->{'header'}{'_RangeStart'}) { }
1229 0 0 if ($code == 206) { }
1232 0 0 if (defined $end) { }
0 0 elsif (defined $size) { }
1252 0 0 if ($end < $start)
1265 0 0 if (not defined $contentlength) { }
1286 0 0 unless ($headtext)
1296 0 0 if ($opt->{'attachment'}) { }
0 0 elsif ($opt->{'inline'}) { }
1303 0 0 if ($filename)
1313 0 0 if ($opt->{'allowSAB'})
1327 0 0 if ($dataitem->{'fh'})
1366 0 0 if ($code == 301) { }
0 0 elsif ($code == 307) { }
1384 0 0 $slash != -1 ? :
1387 0 0 if ($slash != -1)
1393 0 0 if ($qs)
1397 0 0 if (ref $qs->{$key} ne 'ARRAY') { }
1422 0 0 if ($self->{'method'} ne 'HEAD') { }
1424 0 0 unless (open $FH, "<", $requestfile)
1431 0 0 unless ($st)
1443 0 0 if (defined $start)
1444 0 0 if ($start >= $currentsize) { }
0 0 elsif ($fileitem{'fh'}) { }
1461 0 0 if ($done)
1464 0 0 if (defined $locksz) { }
1475 0 0 if (defined $self->{'header'}{'_RangeEnd'})
1480 0 0 if ($fileitem{'fh'})
1481 0 0 unless ($done)
1489 0 0 if (defined $self->{'header'}{'_RangeEnd'})
1491 0 0 if $rangesize <= $maxsize
1502 0 0 if (index($requestfile, $allowed, length($requestfile) - length($allowed)) != -1)
1509 0 0 if ($filelength == '99999999999')
1519 0 0 if ($self->{'responseopt'}{'cd_file'})
1529 0 0 unless (defined $filelength)
1538 0 0 defined $self->{'header'}{'_RangeEnd'} ? :
1557 0 0 if (defined $self->{'header'}{'_RangeStart'}) { }
1568 0 0 unless open my $cmdh, "-|", @cmd
1586 0 0 if (&Encode::is_utf8($buf))
1594 0 0 if (not $options->{'code'} or $options->{'code'} == 206)
1602 0 0 unless (open $fh, "<", \$buf)
1660 0 0 unless ($libtarsize)
1703 0 0 if defined $requestfile
1706 0 0 if (not defined $requestfile or rindex($requestfile, $droot, 0) != 0) { }
0 0 elsif (-f $requestfile) { }
0 0 elsif (-d _) { }
1712 0 0 if (index($request->{'path'}{'unsafecollapse'}, '/', length($request->{'path'}{'unsafecollapse'}) - 1) == -1) { }
1722 0 0 if (index($request->{'path'}{'unescapepath'}, '/', length($request->{'path'}{'unescapepath'}) - 1) != -1) { }
1724 0 0 if (-f $index)
1746 0 0 if defined $requestfile
1747 0 0 if (not defined $requestfile or rindex($requestfile, $ml, 0) != 0)
1752 0 0 if (-f $requestfile) { }
0 0 elsif (-d _) { }
1753 0 0 if (index($self->{'path'}{'unsafecollapse'}, '/', length($self->{'path'}{'unsafecollapse'}) - 1) == -1) { }
1763 0 0 if (substr($self->{'path'}{'unescapepath'}, -1) eq '/') { }
1764 0 0 unless opendir my $dh, $requestfile
1768 0 0 if $filename eq "." or $filename eq ".."
1769 0 0 unless -s "$requestfile/$filename"
1771 0 0 if -d _
1789 0 0 if (length $self->{'client'}{'inbuf'} < $self->{'header'}{'Content-Length'})
1797 0 0 if ($dlength >= $contentlength) { }
1800 0 0 if ($dlength > $contentlength) { }
1823 0 0 if ($self->{'header'}{'Content-Length'} > 20000000)
1829 0 0 if (length $self->{'client'}{'inbuf'} < $self->{'header'}{'Content-Length'})
1835 0 0 if ($dlength >= $contentlength)
1838 0 0 if ($dlength > $contentlength) { }
1856 0 0 if &$uploader($self, $requestfile)
1897 0 0 unless (defined $self)
1955 0 0 unless (defined $self->{'sock'}->recv($tempdata, 65536))
1956 0 0 unless ($!{'EAGAIN'})
1962 0 0 if (length $tempdata == 0)
1973 0 0 unless (defined $self->{'request'}{'on_read_ready'})
1978 0 0 unless ($res)
1981 0 0 if (defined $self->{'request'}{'response'}) { }
0 0 elsif (defined $self->{'request'}{'on_read_ready'}) { }
1992 0 0 unless (defined $self->{'request'}{'response'})
1998 0 0 if (not defined $tsrRet) { }
0 0 elsif ($tsrRet ne '') { }
2003 0 0 if ($self->{'request'}{'outheaders'}{'Connection'} and $self->{'request'}{'outheaders'}{'Connection'} eq "close")
2017 0 0 if ($res)
2018 0 0 if (defined $self->{'request'}{'response'}) { }
0 0 elsif (defined $self->{'request'}{'on_read_ready'}) { }
2041 0 0 if (defined $self->{'sock'}->recv($tempdata, 65536))
2042 0 0 if (length $tempdata == 0)
2049 0 0 unless ($!{'EAGAIN'})
2060 0 0 if (defined $client->{'request'}{'response'}) { }
2063 0 0 if (not defined $tsrRet) { }
0 0 elsif ($tsrRet ne '') { }
2068 0 0 if ($client->{'request'}{'outheaders'}{'Connection'} and $client->{'request'}{'outheaders'}{'Connection'} eq "close")
2086 0 0 if ($sentthiscall > 0)
2095 0 0 unless defined $dataitem->{'buf'}
2099 0 0 if (length $dataitem->{'buf'})
2102 0 0 unless (defined $sret)
2106 0 0 if ($sret)
2109 0 0 if (defined $client->{'sendresponsetimerid'})
2115 0 0 if (length $dataitem->{'buf'} > 0)
2126 0 0 if (defined $dataitem->{'fh'}) { }
0 0 elsif (defined $dataitem->{'cb'}) { }
2131 0 0 if ($filepos != tell $FH)
2134 0 0 if ($req_length and $filepos >= $req_length) { }
2135 0 0 if ($filepos > $req_length)
2143 0 0 if ($req_length)
2145 0 0 if $tmpsend < $readamt
2149 0 0 if (not defined $bytesRead) { }
0 0 elsif ($bytesRead == 0) { }
2155 0 0 if (not $req_length) { }
2177 0 0 unless ($newdata)
2185 0 0 if ($encode_chunked)
2204 0 0 if (not defined $sret) { }
0 0 elsif ($sret) { }
2205 0 0 if ($!{'EAGAIN'}) { }
0 0 elsif ($!{'ECONNRESET'}) { }
0 0 elsif ($!{'EPIPE'}) { }
2235 0 0 if ($self->{'sock'})
2261 0 0 if ($ret == 0)
2265 0 0 if ($ret == -1)
2268 0 0 if ($ret == 1)
2279 0 0 if $self->{'process'}
2304 0 0 if ($ret == 0)
2308 0 0 if ($ret == -1)
2311 0 0 if ($ret == 1)
2368 0 0 if ($fddispatch->{'SIGCHLD'})
2373 0 0 if ($fddispatch->{'STDIN'}) { }
2380 0 0 if ($fddispatch->{'STDOUT'}) { }
2387 0 0 if ($fddispatch->{'STDERR'}) { }
2395 0 0 if ($handlesettings->{'O_NONBLOCK'})
2398 0 0 unless 0 == fcntl($err, 3, $flags)
2400 0 0 unless 0 == fcntl($err, 4, $flags)
2402 0 0 unless 0 == fcntl($out, 3, $flags)
2404 0 0 unless 0 == fcntl($out, 4, $flags)
2406 0 0 unless defined $in->blocking(0)
2416 0 0 if ($cb)
2438 0 0 if ($env)
2452 0 0 if ($@)
2458 0 0 if ($env)
2483 0 0 if ($context->{'on_stdout_data'})
2509 0 0 if ($context->{'on_stdout_data'})
2516 0 0 if ($context->{'input'})
2521 0 0 if ($curbuf)
2523 0 0 if (not defined $rv) { }
0 0 elsif ($rv != length $curbuf) { }
2524 0 0 unless ($!{'EAGAIN'})
2539 0 0 unless (defined $context->{'curbuf'})
2585 0 0 if (defined $inputdata)
2603 0 0 unless pipe my $inreader, my $inwriter
2604 0 0 unless pipe my $outreader, my $outwriter
2605 0 0 unless pipe my $errreader, my $errwriter
2609 0 0 if ($pid == 0)
2613 0 0 unless open STDIN, "<&", $inreader
2614 0 0 unless open STDOUT, ">&", $errwriter
2615 0 0 unless open STDERR, ">&", $errwriter
2630 0 0 if (fork == 0)
2631 0 0 unless open STDOUT, ">&", $sockfh
2655 0 0 if (defined $self->{'fd'}{$key}{'fd'} and $fd == $self->{'fd'}{$key}{'fd'})
2667 0 0 if (defined $self->{'fd'}{$key}{'fd'})
2703 0 0 unless (defined $type)
2704 0 0 if (defined $value)
2708 0 0 if ($raw or $noindent)
2713 0 0 if (not defined $value) { }
0 0 elsif ($value eq '__indent-') { }
2730 0 0 if ($type eq "NOP")
2734 0 0 unless $noindent
2735 0 0 if ($type eq 'SCALAR') { }
0 0 elsif ($type eq 'HASH') { }
0 0 elsif ($type eq 'ARRAY') { }
2737 0 0 unless ($raw)
2744 0 0 unless $raw
2770 0 0 unless system("mkdir", "-p", dirname($filepath)) == 0
2776 0 0 if ($source->{'type'} ne "local")
2789 0 0 if ($launchsettings->{'CFGDIR'}) { }
2790 0 0 unless -d $launchsettings->{'CFGDIR'}
2802 0 0 if (-d "$cfgdir/mhfs")
2813 0 0 unless ($SETTINGS)
2814 0 0 if $@
2815 0 0 if -e $SETTINGS_FILE
2834 0 0 unless (-f $SETTINGS_FILE)
2842 0 0 unless $rule->[0] =~ m[^([^/]+)(?:/(\d{1,2}))?$]
2845 0 0 unless defined $ip
2846 0 0 unless $cidr >= 0 and $cidr <= 32
2853 0 0 if $rule->[1]
2855 0 0 if ($rule->[2])
2857 0 0 if index($absurl, "/", length($absurl) - 1) != -1
2861 0 0 if ($rule->[3])
2872 0 0 unless ($SETTINGS->{'DOCUMENTROOT'})
2878 0 0 unless ($SETTINGS->{'RUNTIME_DIR'})
2880 0 0 unless ($RUNTIMEDIR)
2900 0 0 if (ref $srcs ne "ARRAY")
2907 0 0 if ($stype ne "HASH")
2908 0 0 if ($stype ne "")
2968 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') { }
3000 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) { }
3016 0 0 if ($firstchar eq 'd' or $firstchar eq 'l') { }
0 0 elsif (substr($$contents, $foffset - 1) =~ /^i(0|\-?[1-9][0-9]*)e/) { }
3036 0 0 if (scalar @nodestack == 1)
3056 0 0 unless $tree
3076 0 0 unless (exists $opt->{'src'} and exists $opt->{'dest_metafile'} and exists $opt->{'tracker'})
3083 0 0 if $opt->{'private'}
3101 0 0 if ($node->[0] ne "d")
3106 0 0 if ($node->[$i][1] eq $key)
3114 0 0 if ($valuetype and $node->[0] ne $valuetype)
3123 0 0 if ($node->[0] ne "d")
3137 0 0 unless $infodata
3155 0 0 unless (exists $self->{'sources'}{$sid})
3160 0 0 if ($src->{'type'} ne "local")
3166 0 0 unless $absolute
3167 0 0 unless $absolute =~ /^$location/
3205 0 0 unless ($process)
3216 0 0 if ($output =~ /ERROR/)
3227 0 0 if ($output =~ /ERROR/)
3238 0 0 if ($output =~ /ERROR/)
3249 0 0 if ($output =~ /ERROR/)
3260 0 0 if ($output =~ /ERROR/)
3271 0 0 if ($output =~ /ERROR/)
3282 0 0 if ($output =~ /ERROR/)
3294 0 0 if ($output =~ /ERROR/)
3305 0 0 if ($output =~ /ERROR/)
3317 0 0 if ($output =~ /ERROR/)
3322 0 0 if ($output =~ /ERROR/)
3336 0 0 if ($output =~ /ERROR/)
3352 0 0 if ($output =~ /ERROR/)
3363 0 0 if ($output =~ /ERROR/)
3372 0 0 unless defined $line
3373 0 0 if (substr($line, 0, 1) ne "[")
3380 0 0 unless (defined $newline)
3388 0 0 unless (defined $file and defined $size)
3397 0 0 if (@fkeys == 1)
3401 0 0 unless (defined $res)
3404 0 0 if ($res == 1)
3422 0 0 unless ($torrent)
3431 0 0 if (not defined $bytes_done) { }
3435 0 0 unless (defined $_[0])
3438 0 0 unless (defined $_[0])
3441 0 0 unless (defined $_[0])
3450 0 0 unless (defined $_[0])
3453 0 0 unless (defined $_[0])
3479 1 0 if (not eval "use JSON; 1")
3480 0 1 unless eval "use JSON::PP; 1"
3501 1 0 if (not &HAS_MHFS_XS())
3511 0 0 unless $statinfo
3515 0 0 if (not S_ISDIR($statinfo->mode)) { }
3516 0 0 unless $path =~ /\.(flac|mp3|m4a|wav|ogg|webm)$/
3521 0 0 unless (opendir $dir, $path)
3530 0 0 if $file eq "." or $file eq ".."
3531 0 0 if (my $file = BuildLibrary("$path/$file"))
3536 0 0 if $size eq 0
3548 0 0 if ($files->[2]) { }
3567 0 0 if ($where eq "")
3574 0 0 if ($where eq "")
3591 0 0 unless ($file)
3598 0 0 if ($file->[2])
3630 0 0 if ($request->{'qs'}{'forcerefresh'}) { }
0 0 elsif ($request->{'qs'}{'refresh'}) { }
3646 0 0 unless ($fmt)
3649 0 0 if ($request->{'header'}{'User-Agent'} =~ m[Chrome/([^\.]+)]) { }
0 0 elsif ($request->{'header'}{'User-Agent'} =~ m[Firefox/([^\.]+)]) { }
3653 0 0 if ($ver < 93)
3654 0 0 if ($ver < 68 or $request->{'header'}{'User-Agent'} =~ /Linux/)
3662 0 0 if ($ver < 79)
3671 0 0 if ($request->{'qs'}{'segments'})
3677 0 0 defined $request->{'qs'}{'ptrack'} ? :
3678 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') { }
3708 0 0 if (defined $request->{'qs'}{'part'}) { }
0 0 elsif (defined $request->{'qs'}{'fmt'} and $request->{'qs'}{'fmt'} eq 'wav') { }
3709 0 0 unless (&HAS_MHFS_XS())
3715 0 0 unless ($TRACKDURATION{$tosend})
3729 0 0 $samples_per_seg < $samples_left ? :
3733 0 0 unless (&HAS_MHFS_XS())
3753 0 0 if ($actual_endbyte >= $endbyte)
3769 0 0 if ($request->{'qs'}{'action'} and $request->{'qs'}{'action'} eq 'dl') { }
0 0 elsif (lc substr($tosend, -4) eq '.mp3') { }
3774 0 0 if (&HAS_MHFS_XS())
3775 0 0 unless ($TRACKINFO{$tosend})
3815 0 0 unless open my $fh, "<", $file
3817 0 0 unless seek $fh, 8, 0
3818 0 0 unless read($fh, $buf, 34) == 34
3830 0 0 if ($justsendfile)
3838 0 0 if $nameloc
3843 0 0 unless ($is_flac)
3847 0 0 if (-e $tlossy) { }
3851 0 0 if (defined LOCK_GET_LOCKDATA($tlossy))
3862 0 0 if (LOCK_WRITE($tlossy)) { }
3884 0 0 unless (defined $TRACKINFO{$file})
3891 0 0 $max_sample_rate > 48000 ? :
3898 0 0 if ($samplerate <= $max_sample_rate and $inbitdepth <= $bitdepth)
3912 0 0 if ($setting->[0] <= $bitdepth and $setting->[1] <= $max_sample_rate)
3920 0 0 if (-e $tmpfile)
3931 0 0 if ($samplerate % $key == 0)
3933 0 0 if ($rate <= $samplerate and $rate <= $max_sample_rate)
3947 0 0 if (LOCK_WRITE($outfile)) { }
3978 0 0 if ($source->{'type'} eq 'local') { }
0 0 elsif ($source->{'type'} eq 'ssh') { }
0 0 elsif ($source->{'type'} eq 'mhfs') { }
3988 0 0 unless ($lib)
3990 0 0 if $source->{'type'} eq "local"
3996 0 0 if $already->[0] eq $item->[0]
4013 0 0 if ($libcomponent->[3] eq $component)
4056 0 0 unless $node
4059 0 0 if ($utf8name =~ m[(.+/).+$])
4063 0 0 if ($sendFiles{$source->{'type'}}($request, $node->{'path'}, $node->{'node'}, $source, $nameloc))
4075 0 0 unless (&HAS_MHFS_XS())
4084 0 0 unless $node
4106 0 0 unless $node
4110 0 0 unless (opendir $dh, $dname)
4112 0 0 unless (opendir $dh, $dname)
4122 0 0 if $last eq ".png" or $last eq ".jpg" or $last eq "jpeg"
4125 0 0 unless (@files)
4132 0 0 if (substr($file, 0, length $expname) eq $expname)
4163 0 0 if ($before{$pupdate} ne $self->{$pupdate})
4180 0 0 unless (eval { do { $unthawed = thaw($out); return 1 } })
4187 0 0 if ($unthawed) { }
4266 1 0 if (not eval "use JSON; 1")
4267 0 1 unless eval "use JSON::PP; 1"
4278 0 0 if ($query)
4284 0 0 if ($request->{'qs'}{'media'})
4296 0 0 if $request->{'qs'}{'media'}
4297 0 0 if ($request->{'qs'}{'media'} and $request->{'qs'}{'media'} eq 'music') { }
4311 0 0 unless ($json)
4319 0 0 unless defined $id
4323 0 0 if defined $media
4382 0 0 if ($request->{'qs'}{'fmt'} eq 'json') { }
4402 0 0 unless ($request)
4418 0 0 unless $cl
4420 0 0 if ($cr)
4422 0 0 if $cr > $cl
4430 0 0 unless $st
4432 0 0 if $cl < $minsize
4433 0 0 if $st->size < $minsize
4453 0 0 unless $qs->{'id'}
4456 0 0 if (defined $qs->{'media'} and defined $self->{'fmts'}{$qs->{'media'}}) { }
4514 0 0 if (not $youtubedl) { }
0 0 elsif (not -e $youtubedl) { }
4516 0 0 unless (-e $mhfsytdl)
4518 0 0 if (system("curl", "-L", "https://yt-dl.org/downloads/latest/youtube-dl", "-o", $mhfsytdl) != 0)
4522 0 0 if (system("chmod", "a+rx", $mhfsytdl) != 0)
4538 0 0 unless ($installed)
4540 0 0 if (fork == 0)
4563 0 0 unless ($fileitem)
4568 0 0 unless ($absurl)
4583 0 0 unless ($torrentData)
4587 0 0 unless ($torrent)
4627 0 0 unless (exists $request->{'qs'}{$key})
4637 0 0 if ($port ne unpack("S", pack("S", $port)))
4642 0 0 if ($left ne unpack("Q", pack("Q", $left)))
4646 0 0 if (exists $request->{'qs'}{'compact'} and $request->{'qs'}{'compact'} eq 0)
4652 0 0 unless (exists $self->{'torrents'}{$rih})
4669 0 0 if ($left == 0)
4675 0 0 if (defined $event)
4677 0 0 if ($event eq 'started') { }
0 0 elsif ($event eq 'stopped') { }
0 0 elsif ($event eq 'completed') { }
4689 0 0 if (not defined $numwant or $numwant ne unpack("C", pack("C", $numwant)) or $numwant > 55)
4700 0 0 if ($self->{'torrents'}{$rih}{$peer}{'completed'}) { }
4706 0 0 if ($i++ < $numwant)
4707 0 0 if ($peer ne $ipport)
4711 0 0 if ($netmap and ($values[0] == $netmap->[1] and unpack("C", $ipport) != $netmap->[1]) and $pubip)
4730 0 0 if ($bdata) { }
4741 0 0 $settings->{'BitTorrent::Tracker'} && $settings->{'BitTorrent::Tracker'}{'announce_interval'} ? :
4750 0 0 unless ($odres)
4755 0 0 if substr($file, 0, 1) eq "."
4758 0 0 unless ($torrentcontents)
4763 0 0 unless ($torrent)
4790 0 0 if ($current_time - $peerdata->{'last_announce'} > $self->{'announce_interval'} + 60)
4824 0 0 if is_video($file)
4825 0 0 if is_mhfs_music_playable($file)
4835 0 0 if (defined $qs->{'infohash'}) { }
4842 0 0 unless (defined $_[0])
4860 0 0 if ($bytes_done < $size_bytes) { }
4867 0 0 unless (defined $_[0])
4880 0 0 if not defined $qs->{'playinbrowser'} or $qs->{'playinbrowser'} == 1
4894 0 0 unless (defined $_[0])
4904 0 0 if ($curtor =~ /^\[(u?)['"](.+)['"],\s'(.+)',\s([0-9]+),\s([0-9]+),\s([0-9]+)\]$/) { }
4912 0 0 if ($is_unicode)
4918 0 0 if ($qs->{'logunicode'})
4929 0 0 unless ($line)
4946 0 0 if (exists $request->{'qs'}{'dlsubsystem'} and exists $request->{'qs'}{'privdata'})
4948 0 0 if (exists $self->{'dlsubsystems'}{$subsystem})
4952 0 0 unless ($result)
5011 0 0 if (rindex($request->{'path'}{'unsafepath'}, "/od/" . $key, 0) == 0)
5043 0 0 if (not -d $video->{'src_file'}{'filepath'}) { }
5077 0 0 if (scalar @pathcomponents >= 3)
5078 0 0 if ($pathcomponents[2] eq "video")
5079 0 0 if (scalar @pathcomponents >= 5)
5085 0 0 unless ($video{'src_file'})
5091 0 0 if ($fmt eq "m3u8")
5093 0 0 unless ($absurl)
5099 0 0 $video{'src_file'}{'ext'} ? :
5131 0 0 unless (defined $tvdir)
5136 0 0 unless (opendir $dh, $tvdir)
5144 0 0 if $filename eq "." or $filename eq ".."
5145 0 0 unless -s "$tvdir/$filename"
5147 0 0 unless $filename =~ /^(.+)[\.\s]+S\d+/
5149 0 0 if ($showname)
5151 0 0 unless ($shows{$showname})
5161 0 0 if ($request->{'path'}{'unsafepath'} ne $kodidir)
5165 0 0 $slash != -1 ? :
5166 0 0 $slash != -1 ? :
5169 0 0 unless ($showitems)
5179 0 0 if (not $item) { }
0 0 elsif (rindex($item, $tvdir, 0) != 0) { }
0 0 elsif (-f $item) { }
0 0 elsif (-d _) { }
5187 0 0 if (not $showfilename) { }
0 0 elsif ($showfilename eq $filebasename) { }
5191 0 0 if (index($request->{'path'}{'unsafecollapse'}, '/', length($request->{'path'}{'unsafecollapse'}) - 1) == -1) { }
5202 0 0 unless opendir my $dh, $item
5205 0 0 if $newitem eq "." or $newitem eq ".."
5218 0 0 if (index($request->{'path'}{'unescapepath'}, "/", length($request->{'path'}{'unescapepath'}) - 1) == -1)
5228 0 0 if $show->{'isdir'}
5239 0 0 unless (defined $moviedir)
5244 0 0 unless (opendir $dh, $moviedir)
5252 0 0 if $filename eq "." or $filename eq ".."
5253 0 0 unless -s "$moviedir/$filename"
5256 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}$/) { }
5275 0 0 if ($showname)
5277 0 0 unless ($shows{$showname})
5287 0 0 if ($request->{'path'}{'unsafepath'} ne $kodidir)
5292 0 0 $slash != -1 ? :
5293 0 0 $slash != -1 ? :
5297 0 0 unless ($showitems)
5307 0 0 if (not $item) { }
0 0 elsif (rindex($item, $moviedir, 0) != 0) { }
0 0 elsif (-f $item) { }
0 0 elsif (-d _) { }
5315 0 0 if (not $showfilename) { }
0 0 elsif ($showfilename eq $filebasename) { }
5319 0 0 if (index($request->{'path'}{'unsafecollapse'}, '/', length($request->{'path'}{'unsafecollapse'}) - 1) == -1) { }
5330 0 0 unless opendir my $dh, $item
5333 0 0 if $newitem eq "." or $newitem eq ".."
5346 0 0 if (index($request->{'path'}{'unescapepath'}, "/", length($request->{'path'}{'unescapepath'}) - 1) == -1)
5356 0 0 if $show->{'isdir'}
5374 0 0 if (scalar @pathcomponents >= 3)
5375 0 0 if ($pathcomponents[2] eq 'movies') { }
0 0 elsif ($pathcomponents[2] eq 'tv') { }
5412 0 0 if ($MHFS::Plugin::GetVideo::Config{'ivsize'} < 8)
5464 0 0 if (defined $qs->{'name'}) { }
0 0 elsif ($$videoformats{$video{'out_fmt'}}{'plugin'}) { }
5465 0 0 if (defined $qs->{'sid'}) { }
5467 0 0 unless ($video{'src_file'})
5478 0 0 if ($video{'out_fmt'} eq 'noconv') { }
0 0 elsif ($video{'out_fmt'} eq 'mkvinfo') { }
0 0 elsif ($video{'out_fmt'} eq 'fmp4') { }
5492 0 0 unless (-e $video{'src_file'}{'filepath'})
5500 0 0 if $video{'out_fmt'} eq "hls"
5504 0 0 unless ($video{'out_base'} = $video{'plugin'}->getOutBase($qs))
5521 0 0 if (-e $video{'out_filepath'})
5528 0 0 if ($videoformats->{$fmt}{'lock'} == 1 and LOCK_WRITE($video{'out_filepath'}) != 1)
5532 0 0 if ($video{'plugin'}) { }
0 0 elsif (defined $videoformats->{$fmt}{'create_cmd'}) { }
5546 0 0 if ($fmt eq "hls")
5556 0 0 unless (defined $request)
5563 0 0 unless (-e $filename)
5567 0 0 if (defined $minsize and -s $filename < $minsize)
5570 0 0 if (defined $video{'on_exists'})
5571 0 0 unless $video{'on_exists'}->($settings, \%video)
5578 0 0 if (pid_running($video{'pid'}))
5599 0 0 if (defined $fmt)
5602 0 0 if (defined $self->{'VIDEOFORMATS'}{$fmt})
5620 0 0 if ($line =~ /^(.+)\.m3u8_v$/)
5633 0 0 if ($subm3u and -e $reqsub)
5639 0 0 if $sub->{'is_default'}
5640 0 0 if $sub->{'is_forced'}
5652 0 0 unless ($matroska)
5658 0 0 if (defined $request->{'qs'}{'mkvinfo_time'}) { }
5660 0 0 unless ($track)
5665 0 0 unless ($gopinfo)
5681 0 0 if ($request->{'qs'}{'fmp4_time'})
5725 0 0 unless (defined $sync)
5729 0 0 if ($sync != 65521)
5742 0 0 $ebml->{'elements'} > 0 ? :
5743 0 0 if $lastelm and defined $lastelm->{'size'} and $amount > $lastelm->{'size'}
5746 0 0 unless ($amtread)
5751 0 0 if ($elem->{'size'})
5760 0 0 unless $whence == 1
5761 0 0 if $ebml->{'elements'} > 0 and $ebml->{'elements'}[-1]{'size'} and $position > $ebml->{'elements'}[-1]{'size'}
5762 0 0 unless seek $ebml->{'fh'}, $position, $whence
5764 0 0 if ($elem->{'size'})
5778 0 0 if $value << $width - 1 & 128
5779 0 0 unless $width < 9
5782 0 0 unless length $$bufref >= $width - 1
5799 0 0 unless defined $value
5807 0 0 if (defined $savewidth)
5816 0 0 unless ebml_read($ebml, $value, 1)
5820 0 0 if $value << $width - 1 & 128
5821 0 0 unless $width < 9
5827 0 0 unless ebml_read($ebml, $byte, 1)
5838 0 0 unless read_vint($ebml, \$value, \$width)
5851 0 0 unless open my $fh, "<", $filename
5853 0 0 unless read $fh, $magic, 4
5854 0 0 unless $magic eq "\32E\337\243"
5857 0 0 unless read_and_parse_vint($ebml, \$ebmlheadsize)
5858 0 0 unless seek $fh, $ebmlheadsize, 1
5865 0 0 unless read_vint($ebml, \$id)
5867 0 0 unless read_and_parse_vint($ebml, \$size)
5876 0 0 unless ebml_seek($ebml, $elm->{'size'}, 1)
5885 0 0 unless $elm
5886 0 0 if ($elm->{'id'} == $id)
5890 0 0 unless ebml_skip($ebml)
5899 0 0 if (not $elm) { }
0 0 elsif (not $elm->{'data'}) { }
5911 0 0 unless ($elementid)
5915 0 0 unless $elementid < 4294967295
5919 0 0 unless $size < '72057594037927935'
5922 0 0 if ($elementid > 16777215) { }
0 0 elsif ($elementid > 65535) { }
0 0 elsif ($elementid > 255) { }
5942 0 0 if ($elm->{'infsize'}) { }
6009 0 0 if ($elm->{'id'} == 160) { }
0 0 elsif ($elm->{'id'} == 163) { }
6014 0 0 unless defined $id
6016 0 0 unless defined $size
6018 0 0 if $id == 161
6030 0 0 if (not defined $trackno or length $data < 3)
6040 0 0 if ($lacing == 2) { }
0 0 elsif ($lacing == 6) { }
0 0 elsif ($lacing == 4) { }
6048 0 0 if $val < 255
6111 0 0 if (telmval($track, "TrackNumber") == $trackno)
6124 0 0 unless $headread and $headread == 4
6130 0 0 unless $$type != 127
6133 0 0 unless $dataread and $dataread == $size
6169 0 0 unless $magic and $magic == 4
6175 0 0 unless $bref
6177 0 0 if ($type == 0)
6180 0 0 if $done
6199 0 0 if length $str == 0
6201 0 0 if length $str == 4
6203 0 0 if length $str == 8
6219 0 0 unless ($ebml)
6225 0 0 unless ($foundsegment)
6233 0 0 unless ($foundsegmentinfo)
6241 0 0 unless ($tselm)
6246 0 0 unless (ebml_read($ebml, $tsbinary, $tselm->{'size'}))
6252 0 0 unless defined $tsval
6255 0 0 unless (ebml_skip($ebml))
6262 0 0 unless ($durationelm)
6267 0 0 unless (ebml_read($ebml, $durbin, $durationelm->{'size'}))
6279 0 0 unless (ebml_skip($ebml))
6284 0 0 unless (ebml_skip($ebml))
6290 0 0 unless ($in_tracks)
6302 0 0 unless $packetsize
6306 0 0 if ($packetsread == $targetpackets)
6314 0 0 if (length $$dataref >= $targetsize)
6322 0 0 unless ($in_track)
6329 0 0 unless ($telm)
6337 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) { }
6344 0 0 if ($elm{'data'} =~ m[^([A-Z]+_)([A-Z0-9]+)(?:/([A-Z0-9_/]+))?$])
6347 0 0 if ($3)
6350 0 0 if $track{'CodecID_Prefix'} eq "A_"
6376 0 0 unless ($id)
6382 0 0 unless ($size)
6389 0 0 if ($id == 181) { }
0 0 elsif ($id == 159) { }
6403 0 0 if ($track{'CodecID_Major'} eq "EAC3" or $track{'CodecID_Major'} eq "AC3")
6420 0 0 if (scalar @tracks == 0)
6433 0 0 if (defined $tt and $tt->{'value'} == 2)
6444 0 0 if (defined $tt and $tt->{'value'} == 1)
6457 0 0 unless $custer
6463 0 0 unless ($belm)
6470 0 0 if ($elm{'id'} == 231)
6505 0 0 unless ($belm)
6508 0 0 if ($cluster)
6520 0 0 if ($elm{'id'} == 163 or $elm{'id'} == 160)
6522 0 0 if ($block and $block->{'trackno'} == $tid)
6546 0 0 unless $cluster
6551 0 0 if ($ctime <= $timeinseconds)
6554 0 0 if ($prevcluster)
6560 0 0 if ($ctime >= $timeinseconds)
6565 0 0 unless $desiredcluster
6568 0 0 if $desiredcluster->{'prevcluster'}
6580 0 0 if ($block)
6582 0 0 if ($blocktime > $timeinseconds)
6585 0 0 unless ($matroska->{'dc'}{'firstblk'})
6589 0 0 unless ($block)
6590 0 0 unless ($prevcluster)
6602 0 0 if ($timeinseconds < $blocktime + $blockduration)
6618 0 0 unless ($pcmFrameLen)
6626 0 0 unless $cluster
6632 0 0 if ($curframe <= $pcmFrameIndex)
6636 0 0 if ($prevcluster)
6642 0 0 if ($curframe >= $pcmFrameIndex)
6647 0 0 unless $desiredcluster
6650 0 0 if $desiredcluster->{'prevcluster'}
6662 0 0 if ($block)
6664 0 0 if ($blockframe > $pcmFrameIndex)
6668 0 0 unless ($block)
6669 0 0 unless ($prevcluster)
6681 0 0 if ($pcmFrameIndex < $blockframe + $pcmSampleCount)
6682 0 0 if (($pcmFrameIndex - $blockframe) % $pcmFrameLen != 0)
6728 0 0 unless ($pcmFrameLen)
6734 0 0 if ($matroska->{'curframe'} != $pcmFrameIndex)
6736 0 0 unless (matroska_seek_track($matroska, $track, $pcmFrameIndex))
6750 0 0 if ($matroska->{'curframe'} == $destframe)
6758 0 0 unless ($block)
6759 0 0 if ($matroska->{'ebml'}{'elements'}[0]{'id'} == 408125543 and $matroska->{'ebml'}{'elements'}[0]{'size'} == 0) { }
6791 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) { }
6795 0 0 if $current_element->{'fmt'} =~ /\(default\)$/i
6796 0 0 if $current_element->{'fmt'} =~ /FORCED/i
6797 0 0 if ($type =~ /audio/i) { }
0 0 elsif ($type =~ /video/i) { }
0 0 elsif ($type =~ /subtitle/i) { }
6814 0 0 unless ($eline =~ /^\s\s+/)
6820 0 0 if ($eline =~ /\s+title\s*:\s*(.+)$/)
6865 0 0 if ($qs->{'library'} ne "all")
6872 0 0 unless exists $settings->{'MEDIASOURCES'}{$library}
6877 0 0 unless -d $sublib->{'folder'}
6880 0 0 unless $libhtmlcontent
6968 0 0 if ($ARGV[$i] eq 'flush') { }
6972 0 0 unless defined $ARGV[$i + 1]
6973 0 0 if ($ARGV[$i] eq '--cfgdir') { }