fi
file="$(findfile "$base - " "$ep" "$qual")"
-if [ -z "$file" ]; then
+if [ -z "$file" -o ! -r "$file" ]; then
echo "planime: no matching file found" >&2
exit 1
fi
-echo "$file"
-exit 0
-
-if [ ! -r "$ep" ]; then
- if [ -z "$qual" ]; then
- ep="$(basename "$(pwd)") - ${ep}"
- else
- ep="$(basename "$(pwd)") ${qual} - ${ep}"
- fi
- if [ -r "${ep}.ogm" ]; then
- ep="${ep}.ogm"
+case "${file##*.}" in
+ ogm)
defopts=(-aid 1 -sid 0)
- elif [ -r "${ep}.mkv" ]; then
- ep="${ep}.mkv"
+ ;;
+ mkv)
defopts=(-slang eng -alang jpn)
- elif [ -r "${ep}.mpg" ]; then
- ep="${ep}.mpg"
- elif [ -r "${ep}.mp4" ]; then
- ep="${ep}.mp4"
- elif [ -r "${ep}.avi" ]; then
- ep="${ep}.avi"
- fi
-fi
-
-if [ ! -r "$ep" ]; then
- echo "no such episode: $ep" >&2
- exit 1
-fi
+ ;;
+esac
ifile=".${ep}.info"
if [ "`hostname`" = pc6 ]; then chwp=y; fi
if [ "$chwp" = y ]; then (sleep 2; randomwp) & fi
-"${cmdline[@]}" "$ep"
+"${cmdline[@]}" "$file"