Updated for Ubuntu 22.04. Also fixed merge videos cmin check
[videoscripts/.git] / save_movie
1 #!/bin/bash
2
3 DROPBOX="/naspool/dropbox/New Movies"
4 ENCODED="/naspool/dropbox/Encoded"
5 MOVIE="$1"
6 CATEGORY=$2
7
8 if [[ -z $MOVIE ]] || [[ -z $CATEGORY ]]; then
9   echo "Usage: $0 <movie.mkv> <Children|Collection|Holiday|Family|Church|Mobile>"
10   exit 1
11 fi
12
13 if [[ ! -e "$MOVIE" ]]; then
14   echo "-E- Bad movie name: $MOVIE"
15   exit 1
16 fi
17
18 if [[ ! -d "$DROPBOX/$CATEGORY" ]] ; then
19   echo "-E- Unsupported category: $CATEGORY"
20   exit 1
21 fi
22
23 echo "-> Saving movie \"$MOVIE\" to our movie library: $CATEGORY"
24 mv "$MOVIE" "$DROPBOX/$CATEGORY"
25