import '../contracts/danmaku.dart';
import 'danmaku_episode_parser.dart';


int pickBestMatchIndex(List<DanmakuMatch> matches, int? targetEpisode) {
  if (targetEpisode == null) return 0;
  for (var i = 0; i < matches.length; i++) {
    final n = extractEpisodeNumberFromTitle(matches[i].episodeTitle);
    if (n == targetEpisode) return i;
  }
  return 0;
}
