From e5b5aac10475a8a6010672b91f159fd5904c42f3 Mon Sep 17 00:00:00 2001 From: Dave Morriss Date: Fri, 17 Nov 2023 18:23:22 +0000 Subject: [PATCH] A further fix to the free slot algorithm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit templates/content-index.tpl.html: the `TTĀ²` algorithm can be simplified because the new query returns less. We get the date of the show before the free slot, and can increment it differently depending on whether the previous show is on a Friday or not - catering for weekends in other words! templates/queries-index-mysql.tpl.html, templates/queries-index-sqlite.tpl.html: using a 'find unused index numbers' query available in many places on the Internet, but modified to return the id number and date for the show *before* the next free slot. --- templates/content-index.tpl.html | 9 ++------- templates/queries-index-mysql.tpl.html | 12 ++++++++++++ templates/queries-index-sqlite.tpl.html | 12 ++++++++++++ 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/templates/content-index.tpl.html b/templates/content-index.tpl.html index ae4ea18..1c9b563 100644 --- a/templates/content-index.tpl.html +++ b/templates/content-index.tpl.html @@ -32,13 +32,8 @@ - - - - - - - + + diff --git a/templates/queries-index-mysql.tpl.html b/templates/queries-index-mysql.tpl.html index f8b95c1..1f29958 100644 --- a/templates/queries-index-mysql.tpl.html +++ b/templates/queries-index-mysql.tpl.html @@ -1,3 +1,15 @@ +