Fix condition for adding to null_files in apply. Add some more notes
authorCameron Ball <cameron@cameron1729.xyz>
Mon, 15 Apr 2019 15:28:04 +0000 (23:28 +0800)
committerCameron Ball <cameron@cameron1729.xyz>
Mon, 15 Apr 2019 15:28:04 +0000 (23:28 +0800)
ScoreSync.sh

index ed49d6b..1ff80a8 100755 (executable)
@@ -329,7 +329,8 @@ if [ "$1" = "apply" ]; then
 
                     # Then later on when we process the pranks, unset any hashes that turn out to have a score elsewhere
                     # before finally adding the null nodes
-                    if [ "$person" = "$me_highscore_name" ]; then
+                    if [ "$person" = "$me" ]; then
+                        # this represents files that __should not__ be copied, that is, we know they have nothing in stats.xml at their original location
                         null_files[$(echo $i | cut -sd : -f1)]+="$person"
                     fi
                 else
@@ -388,6 +389,9 @@ if [ "$1" = "apply" ]; then
             done
         done
 
+        # TODO: Really this should happen __before__ the bros algorithm (and the unset from the bros algorithm should be removed)
+        # that way any scores I have locally for something a friend faved, will be considered. As it stands, scores from a friends
+        # scores.txt will always trump anything I have in the original directory
         # only try find files for which there is actually nothing in scores.txt
         if [ "$had_score" = false ] && [ -z "${null_files[${hash}]}" ]; then
             echo "$hash had no score and is not in nulls"