Generates and manages static html of mpd currently playing music.

git clone git://watertao.xyz/programs/mpdhh.git

commit 5092579b74ae8ae2ce9df309e391f42b95442465
parent 38b98a43168772df8bfd83265c301d32b224dc2a
Author: Jeff <dev@watertao.xyz>
Date:   Wed,  1 May 2024 22:47:26 -0700

Fixed analysis date error for first played track of the day

Diffstat:
Mmpdhh.sh | 7++++---
Dtest | 1-
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/mpdhh.sh b/mpdhh.sh @@ -53,7 +53,7 @@ rss_title="Sonus" # Set rss_data_file to data file to force hugo to parse data file for rss stream # for currently playing playlist page. This is unset in awk for historia page creation -rss_data_file="${music_bin_proj_local}/${rss_index_name}" +rss_data_file="${rss_index_name}" awk_prog_1="${mpdhh_bin}/a_write_html.awk" awk_prog_2="${mpdhh_bin}/a_filter_track_data.awk" @@ -213,7 +213,8 @@ update_csv(){ update_historia - [ -n "$track_data" ] && return 0 || return 1 + # reset date vars to today if track_data + [ -n "$track_data" ] && get_date_vars && return 0 || return 1 # if playlist file not empty, # if track data not empty @@ -324,7 +325,7 @@ __update_analysis_sort(){ # Get new count newcount="$(sed -n "${track_match}p" "$1" | cut -f "$((field_count+3))" )" newcount=$((newcount+1)) - sed -i "${track_match}s/\([0-9]\{4\}[-0-9T:]\{21\}\)\t\([0-9]\+\)$/$played_date\t$newcount/" $1 + sed -i "${track_match}s/\([0-9]\{4\}[-0-9T:]\{21\}\)\t\([0-9]\+\)$/${played_date}\t${newcount}/" $1 printf "done.\n" else # Track no exist, add it, then sort diff --git a/test b/test @@ -1 +0,0 @@ -#test