diff options
| -rwxr-xr-x | cutter | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -587,6 +587,15 @@ class CueSplitter: trackname = self.track_name(track) printf("%s\n", os.path.join(self.dest, trackname)) +def find_cuefile(path): + for file in os.listdir(path): + fullname = os.path.join(path, file) + if os.path.isfile(fullname) and file.endswith(".cue"): + return fullname + + printerr("no cue file") + sys.exit(1) + def main(): options, args = parse_args() process_options(options) @@ -601,6 +610,11 @@ def main(): raise StopIteration cuepath = to_unicode(args[0]) + if os.path.isdir(cuepath): + cuepath = find_cuefile(cuepath) + if options.dry_run: + debug("use cue file %s", quote(cuepath)) + try: cue = read_cue(cuepath, on_error=on_error) except StopIteration: |
