faster internal searches

This commit is contained in:
Squidly271 2021-11-26 18:51:25 -05:00
parent 0d59b02484
commit f1d973846d
6 changed files with 27 additions and 13 deletions

Binary file not shown.

View File

@ -2,8 +2,8 @@ cfab760a899abbd8d622abb32f82e13c ./Apps.page
83b3f89cd42e8601c7c217d5b4889c81 ./CA_notices.page
7ee0b23dbd92ed55f611360a983f9565 ./ca_settings.page
1b49ec9797713ce869ea0c1066a109f2 ./default.cfg
5e1c5d9820ab5df5a8d3f88c06c873d7 ./include/exec.php
07eaff6c4650cdaea1088442c996700e ./include/helpers.php
cf9306e6dc141752c26637363831bbb0 ./include/exec.php
2c3ed2682b378b0a06bf445f2d9ca403 ./include/helpers.php
95709ae0ed53e2889a93849a69b37892 ./include/paths.php
410c0166bae560754e231486050621f6 ./javascript/libraries.js
8c24d585c7dd3ff9ef961bb2c2705711 ./PluginAPI.page
@ -20,6 +20,6 @@ b398273cf7daa62ab00d2de2336ca25f ./README.md
e3dc9ed23036a09d69d5cd5c3111751e ./scripts/showStatistics.php
4425f8fd4ef662a7dc65cee01de3e419 ./scripts/updatePLG.sh
2bd671daecaf01549f8cc0202cb184b3 ./scripts/updatePluginSupport.php
c03b8822e6a2f63f864e59b2383a51db ./skins/Narrow/css.php
a8900ea90ba3a4937a4648ae92f9e848 ./skins/Narrow/css.php
cfa1511913f794c8c5980460dfcdf049 ./skins/Narrow/skin.html
dfaafbb04cd8ac2b4a3bedd57a16083e ./skins/Narrow/skin.php
26d44a94d370dc23bf96ec4909fb856a ./skins/Narrow/skin.php

View File

@ -529,7 +529,6 @@ function checkRandomApp($test) {
if ( ! $test['Compatible'] && $caSettings['hideIncompatible'] == "true" ) return false;
if ( $test['Blacklist'] ) return false;
if ( $test['Deprecated'] && ( $caSettings['hideDeprecated'] == "true" ) ) return false;
// if ( $random ) return ! appInstalled($test,$info);
return true;
}

View File

@ -171,8 +171,14 @@ function favouriteSort($a,$b) {
# returns the index number of the array #
# return value === false if not found #
###############################################
function searchArray($array,$key,$value,$startingIndex=0) {
$result = false;
function searchArray($array,$key,$value,$multi=false) {
if ( $multi )
return array_keys(array_column($array,$key),$value);
else
return array_search($value,array_column($array,$key));
/* $result = false;
if (count($array) ) {
for ($i = $startingIndex; $i <= max(array_keys($array)); $i++) {
if ( $array[$i][$key] == $value ) {
@ -181,7 +187,7 @@ function searchArray($array,$key,$value,$startingIndex=0) {
}
}
}
return $result;
return $result; */
}
########################################################
# Fix common problems (maintainer errors) in templates #

View File

@ -372,7 +372,7 @@ a.popup-donate {text-decoration:none;font-style:italic;color:black;font-size:1.5
a.popup-donate:hover {color:<?=$donateText?>;background-color:<?=$unRaid66color?>}
.readmore-js-collapsed{-webkit-mask-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0,0,0,1)), to(rgba(0,0,0,0.1)));}
.repoDonateText{margin-bottom:0.5rem;}
.repoLinks{margin-top:3rem;}
.repoLinks{margin-top:3rem;margin-left:1.5rem;}
.repoPopup {margin-right:1rem;font-size:1.5rem;line-height:2rem;cursor:pointer;display:inline-block;color:<?=$supportPopupText?>!important;background: <?=$supportPopupBackground?>;background: -webkit-linear-gradient(top, transparent 0%, rgba(0,0,0,0.4) 100%),-webkit-linear-gradient(left, lighten(<?=$donateBackground?>, 15%) 0%, <?=$donateBackground?> 50%, lighten(<?=$donateBackground?>, 15%) 100%); background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.4) 100%),linear-gradient(to right, lighten(#E68321, 15%) 0%, #E68321 50%, lighten(#E68321, 15%) 100%); background-position: 0 0; background-size: 100% 100%; border-radius: 15px; color: #fff; padding: 1px 10px 1px 10px;}
.repoPopup:hover {text-decoration:none;background-color:<?=$unRaid66color?>;}
.repoStats{font-size:2rem;margin-top:2rem;}

View File

@ -371,8 +371,17 @@ function getPopupDescriptionSkin($appNumber) {
$index = searchArray($displayed['community'],"InstallPath",$appNumber);
if ( $index === false ) {
$index = searchArray($displayed['community'],"Path",$appNumber);
$ind = $index;
$ind = searchArray($displayed['community'],"Path",$appNumber,true);
foreach ($ind as $i) {
$template = $displayed[$i];
if ( $template['Name'] == $displayed['community'][$i]['Name'] ) {
$index = $i;
break;
}
}
}
/* $ind = $index;
while ( true ) {
$template = $displayed[$ind];
if ( $template['Name'] == $displayed['community'][$ind]['Name'] ) {
@ -384,8 +393,8 @@ function getPopupDescriptionSkin($appNumber) {
unset($template);
break;
}
}
}
}
}*/
if ( $index !== false ) {
$template = $displayed['community'][$index];