Fix bug where EVNT wasn't detected in ScoreSync push, and multiple scores per chart...
authorCameron Ball <cameron@cameron1729.xyz>
Mon, 15 Apr 2019 13:32:18 +0000 (21:32 +0800)
committerCameron Ball <cameron@cameron1729.xyz>
Mon, 15 Apr 2019 13:32:18 +0000 (21:32 +0800)
ScoreSync.sh

index c785c53..ed49d6b 100755 (executable)
@@ -65,7 +65,7 @@ if [ "$1" = "push" ]; then
             fi
 
             xmlstarlet_meta_cmd="$xmlstarlet_meta_cmd -v \"//SongScores//Song[starts-with(@Dir, \\\"Songs/${persons_folder}\\\")][Steps//PercentDP]//@*\" -n"
-            xmlstarlet_scores_cmd="$xmlstarlet_scores_cmd -o \"SCORES\" -n -v \"//SongScores//Song[starts-with(@Dir, \\\"Songs/${persons_folder}\\\")]//PercentDP\" -n -o \"NAMES\" -n -v \"//SongScores/Song[starts-with(@Dir, \\\"Songs/${persons_folder}\\\")]//Name\" -n"
+            xmlstarlet_scores_cmd="$xmlstarlet_scores_cmd -o \"SCORES\" -n -v \"//SongScores//Song[starts-with(@Dir, \\\"Songs/${persons_folder}\\\")]//HighScore[1]//PercentDP\" -n -o \"NAMES\" -n -v \"//SongScores/Song[starts-with(@Dir, \\\"Songs/${persons_folder}\\\")]//HighScore[1]//Name\" -n"
         done < <(find "${DIR}"/*.favourites.txt -type f -print0)
 
         meta=$(eval "xmlstarlet sel -I -t $xmlstarlet_meta_cmd -o \"Songs\" \"${path_to_stats}\"")
@@ -159,7 +159,7 @@ if [ "$1" = "push" ]; then
             the_scorer=$(echo ${mmeta[$fuck]} | cut -sd : -f2)
             just_hash=$(echo $fuck | cut -sd : -f1)
 
-            if [ "$the_scorer" = "$me_highscore_name" ]; then
+            if [ "$the_scorer" = "$me_highscore_name" ] || [ "$the_scorer" = "EVNT" ]; then
                 writeout="$writeout\n${fuck}:${the_score}"
             else
                 writeout="$writeout\n${just_hash}:NODATA"