Skip to content

Commit

Permalink
webui: timelapse config. make default filename to include a directory…
Browse files Browse the repository at this point in the history
… per day.
  • Loading branch information
themactep committed Nov 24, 2024
1 parent b51e37c commit 766deaf
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions package/thingino-webui/files/var/www/x/plugin-timelapse.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ plugin_name="Timelapse"
page_title="Timelapse"
params="enabled interval storage filename"

# constants
CRONTABS="/etc/crontabs/root"
MOUNTS=$(awk '/nfs|fat/{print $2}' /etc/mtab)

Expand All @@ -15,18 +14,16 @@ include $config_file

defaults() {
default_for timelapse_enabled "false"
default_for timelapse_filename "%Y%m%dT%H%M.jpg"
default_for timelapse_filename "%Y%m%d/%Y%m%dT%H%M.jpg"
default_for timelapse_interval 1
}

if [ "POST" = "$REQUEST_METHOD" ]; then
read_from_post "$plugin" "$params"
defaults

# normalize
[ "/" = "${timelapse_filename:0:1}" ] && timelapse_filename="${timelapse_filename:1}"

# validate
error_if_empty "$timelapse_storage" "Timelapse storage cannot be empty."

if [ -z "$error" ]; then
Expand Down

0 comments on commit 766deaf

Please sign in to comment.