Skip to content

Commit

Permalink
Change check to fail on sound file not ogg (#49)
Browse files Browse the repository at this point in the history
* Change check to fail on sound file not ogg

* add patch

Co-authored-by: David Seguin <[email protected]>

Co-authored-by: David Seguin <[email protected]>
  • Loading branch information
Fris0uman and dseguin authored Jul 19, 2022
1 parent 6616eb6 commit 31c64b7
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions tools/validate_unreferenced_sndfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,10 @@
args.add_argument("fmt", action="store", help="escapes output if set to GHA")
args_dict = vars(args.parse_args())


snd_exts = {
".ogg",
".wav",
".mp3",
".aac",
".opus",
".flac",
".midi",
".aax",
".m4a",
".bnk",
".wma",
".aiff",
".raw",
".fla",
".mpa",
".oga",
".m3a",
".aif",
".mpega"
txt_exts = {
".json",
".txt",
".md"
}


Expand Down Expand Up @@ -120,14 +103,19 @@ def check_credits(path) -> bool:
for filename in filenames:
path = os.path.join(root, filename)
ext = os.path.splitext(filename)
if ext[1].lower() in snd_exts:
if ext[1].lower() == ".ogg" :
at_least_one = True
shortpath = path.split(args_dict["dir"]).pop()
print("\nSearching for references to {} ...".format(shortpath))
if not match_file(shortpath):
retval = 1
if not check_credits(shortpath):
retval = 1
elif ext[1].lower() not in txt_exts:
printout("Unrecognized file extension \"{}\" for file \"{}\". "
"Sound files expected in OGG format."
.format(ext[1], filename), 2)
retval = 1

if at_least_one == False:
printout("No sound files processed", 2)
Expand Down

0 comments on commit 31c64b7

Please sign in to comment.