Improve torrent name parsing of peerflix
This commit is contained in:
parent
5c8729b209
commit
a03ee37cb2
|
@ -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 +. " " | tr -d "[: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")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue