Fixed the way we handle creation dates in videos missing timezones
[videoscripts/.git] / check_phone_videos_are_in_originals
1 #!/bin/bash
2 # Checks to make sure all videos off of phone have been copied to the Originals directory
3 # If they are missing, it means Nextcloud missed them somehow. Copy them to New Memories then.
4
5 dcim_path="/storage/emulated/0/DCIM/Camera"
6 originals="/naspool/dropbox/Originals"
7 new_memories="/naspool/dropbox/New Memories"
8
9 adb connect 192.168.0.23
10 if [[ $? != 0 ]]; then
11   echo "#ERROR: Unable to connect to phone at 192.168.0.23"
12   exit 1
13 fi
14
15 mp4s_on_phone=$(adb -e shell ls -1 $dcim_path/*.mp4 | xargs -n 1 basename)
16 mp4s_in_originals=$(/bin/ls -1 $originals/*.mp4 | xargs -n 1 basename)
17
18 for i in $mp4s_on_phone; do
19   echo "$mp4s_in_originals" | grep -q $i
20   if [[ $? == 1 ]]; then
21     echo "mp4 not found in originals: $i"
22     adb -e pull "$dcim_path/$i" "$new_memories"
23   fi
24 done