From 7bcd9aff7c40e4d4851f3b581e4f2fc7ed1b5350 Mon Sep 17 00:00:00 2001 From: coolneng Date: Fri, 28 Oct 2022 11:04:04 +0200 Subject: [PATCH] Improve torrent name parsing of peerflix --- 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 8e4feab..a2d8d68 100755 --- a/scripts/.local/share/scripts/peerflix +++ b/scripts/.local/share/scripts/peerflix @@ -5,7 +5,7 @@ player=mpv data_file=$HOME/Documents/IT/peerflix-db.csv parse_csv() { - show_name=$(echo "$1" | cut -d "=" -f 3 | cut -d "%" -f 1 | tr + " ") + show_name=$(echo "$1" | cut -d "=" -f 3 | awk -F "S[0-9]|[S|s]eason" '{print $1}' | tr -d "[:digit:]%" | tr +. " " | 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") }