Skip to content

Commit

Permalink
Show URL instead of bare tconst/nconst in pickMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
Monty committed Feb 7, 2021
1 parent af14401 commit 219f13e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
8 changes: 6 additions & 2 deletions createFilmography.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ while read -r line; do
count=$(cut -f 1 <<<"$line")
match=$(cut -f 2 <<<"$line")
if [ "$count" -eq 1 ]; then
rg "\t$match\t" "$POSSIBLE_MATCHES" >>"$PERSON_RESULTS"
rg "\t$match\t" "$POSSIBLE_MATCHES" | sed -e 's+^+imdb.com/name/+' \
>>"$PERSON_RESULTS"
continue
fi
cat <<EOF
Expand All @@ -204,7 +205,7 @@ EOF
pickOptions=()
# rg --color always -N "\t$match\t" "$POSSIBLE_MATCHES" | xsv table -d "\t"
while IFS=$'\n' read -r line; do
pickOptions+=("$line")
pickOptions+=("imdb.com/name/$line")
done < <(rg -N "\t$match\t" "$POSSIBLE_MATCHES" |
sort -f -t$'\t' --key=3,3r --key=5)
pickOptions+=("Skip \"$match\"" "Quit")
Expand Down Expand Up @@ -252,6 +253,9 @@ else
cat "$PERSON_RESULTS"
fi

# Get rid of the URL preface we added
sed -I -e s+imdb.com/name/++ "$PERSON_RESULTS"

if ! waitUntil "$YN_PREF" -Y; then
loopOrExitP
fi
Expand Down
11 changes: 8 additions & 3 deletions createTconstFile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ while read -r line; do
count=$(cut -f 1 <<<"$line")
match=$(cut -f 2 <<<"$line")
if [ "$count" -eq 1 ]; then
rg "\t$match\t" "$POSSIBLE_MATCHES" >>"$FINAL_RESULTS"
rg "\t$match\t" "$POSSIBLE_MATCHES" | sed -e 's+^+imdb.com/title/+' \
>>"$FINAL_RESULTS"
continue
fi
cat <<EOF
Expand All @@ -203,7 +204,7 @@ EOF
# rg --color always -N "\t$match\t" "$POSSIBLE_MATCHES" | xsv table -d "\t"
pickOptions=()
while IFS=$'\n' read -r line; do
pickOptions+=("$line")
pickOptions+=("imdb.com/title/$line")
done < <(rg -N "\t$match\t" "$POSSIBLE_MATCHES" |
sort -f -t$'\t' --key=2,2 --key=5,5r)
pickOptions+=("Skip \"$match\"" "Quit")
Expand Down Expand Up @@ -250,7 +251,11 @@ if checkForExecutable -q xsv; then
else
cat "$FINAL_RESULTS"
fi
#

# Get rid of the URL preface we added
sed -I -e s+imdb.com/title/++ "$FINAL_RESULTS"

# Do we want to add it?
addToFileP

# Do we really want to quit?
Expand Down
8 changes: 6 additions & 2 deletions findPeopleInShows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ while read -r line; do
count=$(cut -f 1 <<<"$line")
match=$(cut -f 2 <<<"$line")
if [ "$count" -eq 1 ]; then
rg "\t$match\t" "$POSSIBLE_MATCHES" >>"$ALL_MATCHES"
rg "\t$match\t" "$POSSIBLE_MATCHES" | sed -e 's+^+imdb.com/title/+' \
>>"$ALL_MATCHES"
continue
fi
cat <<EOF
Expand All @@ -220,7 +221,7 @@ EOF
pickOptions=()
# rg --color always -N "\t$match\t" "$POSSIBLE_MATCHES" | xsv table -d "\t"
while IFS=$'\n' read -r line; do
pickOptions+=("$line")
pickOptions+=("imdb.com/title/$line")
done < <(rg -N "\t$match\t" "$POSSIBLE_MATCHES" |
sort -f -t$'\t' --key=2,2 --key=5,5r)
pickOptions+=("Skip \"$match\"" "Quit")
Expand Down Expand Up @@ -270,6 +271,9 @@ fi
! waitUntil "$YN_PREF" -Y && loopOrExitP
printf "\n"

# Get rid of the URL we added
sed -I -e s+imdb.com/title/++ "$ALL_MATCHES"

# Figure out which tconst IDs are cached and which aren't
ls -1 "$cacheDirectory" | rg "^tt" >"$CACHE_LIST"
cut -f 1 "$ALL_MATCHES" | sort >"$SEARCH_LIST"
Expand Down
8 changes: 6 additions & 2 deletions findShowsWith.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ while read -r line; do
count=$(cut -f 1 <<<"$line")
match=$(cut -f 2 <<<"$line")
if [ "$count" -eq 1 ]; then
rg "\t$match\t" "$POSSIBLE_MATCHES" >>"$PERSON_RESULTS"
rg "\t$match\t" "$POSSIBLE_MATCHES" | sed -e 's+^+imdb.com/name/+' \
>>"$PERSON_RESULTS"
continue
fi
cat <<EOF
Expand All @@ -188,7 +189,7 @@ EOF
pickOptions=()
# rg --color always -N "\t$match\t" "$POSSIBLE_MATCHES" | xsv table -d "\t"
while IFS=$'\n' read -r line; do
pickOptions+=("$line")
pickOptions+=("imdb.com/name/$line")
done < <(rg -N "\t$match\t" "$POSSIBLE_MATCHES" |
sort -f -t$'\t' --key=3,3r --key=5)
pickOptions+=("Skip \"$match\"" "Quit")
Expand Down Expand Up @@ -236,6 +237,9 @@ else
cat "$PERSON_RESULTS"
fi

# Get rid of the URL preface we added
sed -I -e s+imdb.com/name/++ "$PERSON_RESULTS"

if ! waitUntil "$YN_PREF" -Y; then
loopOrExitP
fi
Expand Down

0 comments on commit 219f13e

Please sign in to comment.