From 26a36504d081f0dbf071d05f823cd375fcfd33f8 Mon Sep 17 00:00:00 2001 From: coolneng Date: Mon, 5 Feb 2024 23:36:58 +0100 Subject: [PATCH] Parse year in peerflix script --- scripts/.local/share/scripts/peerflix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/.local/share/scripts/peerflix b/scripts/.local/share/scripts/peerflix index 5711598..5e6c098 100755 --- a/scripts/.local/share/scripts/peerflix +++ b/scripts/.local/share/scripts/peerflix @@ -5,7 +5,7 @@ player=mpv data_file=$HOME/Documents/Misc/peerflix-db.csv parse_csv() { - show_name=$(echo "$1" | cut -d "=" -f 3 | awk -F "S[0-9]|[S|s]eason|[C|c]omplete" '{print $1}' | + show_name=$(echo "$1" | cut -d "=" -f 3 | awk -F "S[0-9]|[S|s]eason|[C|c]omplete|([0-9]+)" '{print $1}' | tr -d "[:digit:]" | tr "[:punct:]" " " | sed -e 's/[[:space:]]*$//') episode=$(awk -F ',' -v var="$show_name" '$1 ~ var {print $2}' "$data_file") line_number=$(awk -F ',' -v var="$show_name" '$1 ~ var {print NR}' "$data_file")