예제 #1
0
def parse_stream_names(spec):
    info = TrackInfo()
    if spec:
        tracks = parse_int_string(spec[0])
        names = [''] * len(tracks)
        if len(spec) > 1:
            tokens = csv_split(spec[1])
            names[0:len(tokens)] = tokens
        for t, n in zip(tracks, names):
            info.add_track(t, n)
    return info
예제 #2
0
        mkv.run()
        print mkv
        encoder = HandBrakeEncoder(source, scan, filename, dvd_title, global_options)
        prop = MkvPropEdit(filename, options=options, dvd_title=dvd_title, scan=scan, mkv=mkv, encoder=encoder)
        prop.run()
        sys.exit()

    if len(title_options) > 0:
        episode_number = 1
        bonus_number = 1
        seen_film_series = False
        for options in title_options:
            dvd_title_spec = options.dvd_title
            if not dvd_title_spec:
                title_parser.error("DVD title number must be specified.") 
            dvd_titles = parse_int_string(dvd_title_spec)
            
            audio = parse_stream_names(options.audio)
            subtitles = parse_stream_names(options.subtitles)
            
            # Force episodes if multiple titles are given but neither episodes
            # or bonus numbers are specified
            if len(dvd_titles) > 1:
                if options.bonus is None and options.episode is None:
                    options.episode = []
            
            if options.episode is not None:
                if len(options.episode) == 0:
                    next = find_next_episode_number(options.name, options.season, "e", source, media_paths)
                    numbers = range(next, next + len(dvd_titles))
                    names = [""] * len(dvd_titles)