Skip to content

Commit

Permalink
instead of checking what part we are, just check we are not trying to…
Browse files Browse the repository at this point in the history
… compare to ourselves and abort if we are
  • Loading branch information
Matt Hamilton committed Jun 29, 2020
1 parent a30e503 commit b7fbc36
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions python/calculate_alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,6 @@ def main(args):
# for a specially named partid, or then via the Choirless API
reference_key = f"{choir_id}+{song_id}+reference.{ext}"

# Abort if we are the reference part
if part_id == 'reference':
args["offset"] = 0
args["err"] = 0
args['rendition_key'] = rendition_key
args['reference_key'] = reference_key
return args

# Ask the API if we have parts for this Song
try:
api_url = args['CHOIRLESS_API_URL']
Expand All @@ -101,6 +93,14 @@ def main(args):
except:
print(f"Could not look up part in API: choidId {choir_id} songId {song_id}")

# Abort if we are the reference part
if rendition_key == reference_key:
args["offset"] = 0
args["err"] = 0
args['rendition_key'] = rendition_key
args['reference_key'] = reference_key
return args

args['rendition_key'] = rendition_key
args['reference_key'] = reference_key

Expand Down

0 comments on commit b7fbc36

Please sign in to comment.