Discover transcript files in a directory. Args: input_path: Directory path to search pattern: File pattern to match (default: "*.*t" for .srt, .vtt, .txt, etc.) Returns: List of transcript file paths Raises: ValueError: If no transcript files are f
(input_path: FilePath, pattern: str = "*.*t")
| 165 | |
| 166 | |
| 167 | def discover_transcript_files(input_path: FilePath, pattern: str = "*.*t") -> FileList: |
| 168 | """ |
| 169 | Discover transcript files in a directory. |
| 170 | |
| 171 | Args: |
| 172 | input_path: Directory path to search |
| 173 | pattern: File pattern to match (default: "*.*t" for .srt, .vtt, .txt, etc.) |
| 174 | |
| 175 | Returns: |
| 176 | List of transcript file paths |
| 177 | |
| 178 | Raises: |
| 179 | ValueError: If no transcript files are found |
| 180 | """ |
| 181 | if not os.path.isdir(input_path): |
| 182 | raise ValueError(f"Input path is not a directory: {input_path}") |
| 183 | |
| 184 | files = glob.glob(os.path.join(input_path, pattern)) |
| 185 | |
| 186 | if not files: |
| 187 | raise ValueError( |
| 188 | f"No transcript files found in {input_path} with pattern {pattern}" |
| 189 | ) |
| 190 | |
| 191 | return sorted(files) |
| 192 | |
| 193 | |
| 194 | def prepare_input_files(input_path: Union[str, List[str]]) -> FileList: |
no outgoing calls
no test coverage detected