Reorganized commands a little

This commit is contained in:
Jamie Hardt
2021-05-19 18:24:42 -07:00
parent 35f7672d61
commit efcb0acd08
4 changed files with 119 additions and 110 deletions

View File

@@ -11,7 +11,7 @@ class ValidationError:
return f"{self.message}: event at {self.event['PT.Clip.Start']} on track {self.event['PT.Track.Name']}"
def validate_unique_count(input_dict, field='Title', count=1):
values = set(list(map(lambda e: e[field], input_dict['events'])))
values = set(list(map(lambda e: e.get(field, None), input_dict['events'])))
if len(values) > count:
yield ValidationError(message="Field {} has too many values (max={}): {}".format(field, count, values))