From a0087b291103b5f734eae21774e847547c4ada5a Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 6 Apr 2025 08:54:46 +0200 Subject: [PATCH] Limit play.php to 40 items at a time (#280) --- scripts/play.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/scripts/play.php b/scripts/play.php index f18b785..0d1bb51 100644 --- a/scripts/play.php +++ b/scripts/play.php @@ -570,6 +570,7 @@ if ($fp) { } $name = htmlspecialchars_decode($_GET['species'], ENT_QUOTES); +$limit = isset($_GET['limit']) ? (int)$_GET['limit'] : 40; if(isset($_SESSION['date'])) { $date = $_SESSION['date']; if(isset($_GET['sort']) && $_GET['sort'] == "confidence") { @@ -623,6 +624,10 @@ echo " continue; } $iter++; + if($iter > $limit) { + $iter_additional=true; + break; + } if($num_rows < 100){ $imageelem = ""; @@ -665,6 +670,26 @@ echo "
}if($iter == 0){ echo "";}echo "
No recordings were found.

They may have been deleted to make space for new recordings. You can prevent this from happening in the future by clicking the icon in the top right of a recording.
You can also modify this behavior globally under \"Full Disk Behavior\" here.
";} + if ($iter_additional) { + echo "
"; + echo "
"; + echo ""; + echo ""; + if(isset($_GET['sort'])) { + echo ""; + } + if(isset($_GET['only_excluded'])) { + echo ""; + } + if(isset($_SESSION['date'])) { + echo ""; + } + echo ""; + echo ""; + echo "
"; + echo "
"; + } + if(isset($_GET['filename'])){ $name = $_GET['filename']; $statement2 = $db->prepare("SELECT * FROM detections where File_name == \"$name\" ORDER BY Date DESC, Time DESC");