Skip to content

Commit

Permalink
Fix broken subtitles won't import
Browse files Browse the repository at this point in the history
  • Loading branch information
arianneorpilla committed Jul 11, 2021
1 parent 070348e commit d059e4a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<p align="center">A mobile video player, reader assistant and card creation toolkit tailored for language learners.</p>

<p align="center" style="margin:0"><b>Latest GitHub Release:<br>
<a href="https://github.com/lrorpilla/jidoujisho/releases/tag/0.25.3-beta">0.25.3-beta 🇯🇵 → 🇬🇧</a><br>
<a href="https://github.com/lrorpilla/jidoujisho/releases/tag/0.25.4-beta">0.25.4-beta 🇯🇵 → 🇬🇧</a><br>
<a href="https://github.com/lrorpilla/jidoujisho/releases/tag/0.16.8-beta-kren">0.16.8-beta 🇰🇷 → 🇬🇧</a></b><br>
</p>

Expand All @@ -34,7 +34,7 @@
<a href="https://github.com/lrorpilla/jidoujisho/releases/tag/0.22.1-beta">0.22</a> ·
<a href="https://github.com/lrorpilla/jidoujisho/releases/tag/0.23.2-beta">0.23</a> ·
<a href="https://github.com/lrorpilla/jidoujisho/releases/tag/0.24.5-beta">0.24</a> ·
<a href="https://github.com/lrorpilla/jidoujisho/releases/tag/0.25.3-beta">0.25</a>
<a href="https://github.com/lrorpilla/jidoujisho/releases/tag/0.25.4-beta">0.25</a>
</b></p>

# 📚 Uninterrupted language immersion at your fingertips
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: jidoujisho
description: A mobile video player tailored for Japanese language learners.
publish_to: none

version: 0.25.3+66
version: 0.25.4+67

environment:
sdk: ">=2.7.0 <3.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class SubtitleDataRepository extends SubtitleRepository {
);
} else if (subtitleType == SubtitleType.srt) {
regExp = RegExp(
r'((\d{2}):(\d{2}):(\d{2})\,(\d+)) +--> +((\d{2}):(\d{2}):(\d{2})\,(\d{3})).*[\r\n]+\s*(^[\s\S]*?(?=\n{2,}))',
r'((\d{2}):(\d{2}):(\d{2})\,(\d+)) +--> +((\d{2}):(\d{2}):(\d{2})\,(\d{3})).*[\r\n]+\s*(.*(?:\r?\n(?!\r?\n).*)*)',
caseSensitive: false,
multiLine: true,
);
Expand All @@ -164,6 +164,7 @@ class SubtitleDataRepository extends SubtitleRepository {
}

var matches = regExp.allMatches(subtitlesContent).toList();
print(matches);
List<Subtitle> subtitleList = [];

matches.forEach((RegExpMatch regExpMatch) {
Expand Down Expand Up @@ -194,6 +195,7 @@ class SubtitleDataRepository extends SubtitleRepository {
});

for (var i = 1; i < subtitleList.length; i++) {
print(subtitleList[i].text);
var previousSubtitle = subtitleList[i - 1];
var currentSubtitle = subtitleList[i];

Expand Down

0 comments on commit d059e4a

Please sign in to comment.