MCPcopy Create free account
hub / github.com/smacke/ffsubsync / _resolve_srtout

Function _resolve_srtout

ffsubsync/ffsubsync.py:104–115  ·  view source on GitHub ↗

Decide where the synced subtitles for ``srtin`` should be written. Overwriting the input takes precedence; otherwise, when subtitles were auto-detected from the reference, write a ` .synced.srt` next to each input; otherwise fall back to the explicit (possibly ``None``) output.

(args: argparse.Namespace, srtin: Optional[str])

Source from the content-addressed store, hash-verified

102
103
104def _resolve_srtout(args: argparse.Namespace, srtin: Optional[str]) -> Optional[str]:
105 """Decide where the synced subtitles for ``srtin`` should be written.
106
107 Overwriting the input takes precedence; otherwise, when subtitles were
108 auto-detected from the reference, write a `<name>.synced.srt` next to each
109 input; otherwise fall back to the explicit (possibly ``None``) output.
110 """
111 if args.overwrite_input:
112 return srtin
113 if getattr(args, "auto_srtout", False) and srtin is not None:
114 return "{}.synced.srt".format(os.path.splitext(srtin)[0])
115 return args.srtout
116
117
118def get_srt_pipe_maker(

Callers 2

test_resolve_srtoutFunction · 0.90
try_syncFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_resolve_srtoutFunction · 0.72