Skip to content

Commit

Permalink
Implement min parameter supplied by ttu and update youtube_explode_dart
Browse files Browse the repository at this point in the history
  • Loading branch information
arianneorpilla committed Aug 1, 2021
1 parent 60f6bd1 commit 0fde595
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 15 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.10-beta">0.25.10-beta 🇯🇵 → 🇬🇧</a></b><br>
<a href="https://github.com/lrorpilla/jidoujisho/releases/tag/0.25.11-beta">0.25.11-beta 🇯🇵 → 🇬🇧</a></b><br>
</p>

<p align="center" style="margin:0"><b>Release Archive:<br>
Expand All @@ -33,7 +33,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.10-beta">0.25</a>
<a href="https://github.com/lrorpilla/jidoujisho/releases/tag/0.25.11-beta">0.25</a>
</b></p>

# 📚 Uninterrupted language immersion at your fingertips
Expand Down
6 changes: 5 additions & 1 deletion lib/preferences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,11 @@ Future<void> addBookHistory(HistoryItem bookHistory) async {
bookHistory.thumbnail = photoFileNameDir;
}

bookHistories.removeWhere((entry) => entry.url == bookHistory.url);
bookHistories.removeWhere(
(entry) =>
entry.url.replaceAll("?min=", "") ==
bookHistory.url.replaceAll("?min=", ""),
);
bookHistories.add(bookHistory);

if (bookHistories.length >= 20) {
Expand Down
14 changes: 9 additions & 5 deletions lib/reader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,8 @@ reader.addEventListener('click', (e) => {
children: [
InAppWebView(
initialUrlRequest: URLRequest(
url: Uri.parse(initialURL ?? "https://ttu-ebook.web.app/")),
url: Uri.parse(initialURL ?? "https://ttu-ebook.web.app/?min="),
),
initialOptions: options,
androidOnPermissionRequest:
(controller, origin, resources) async {
Expand Down Expand Up @@ -647,7 +648,8 @@ reader.addEventListener('click', (e) => {

String currentIndexText = (await controller.getUrl())
.toString()
.replaceAll("https://ttu-ebook.web.app/b/", "");
.replaceAll("https://ttu-ebook.web.app/b/", "")
.replaceAll("?min=", "");
currentIndex = int.parse(currentIndexText);
HistoryItem bookHistory = HistoryItem(
"https://ttu-ebook.web.app/b/$currentIndex",
Expand Down Expand Up @@ -681,10 +683,11 @@ reader.addEventListener('click', (e) => {

String currentIndexText = (await controller.getUrl())
.toString()
.replaceAll("https://ttu-ebook.web.app/b/", "");
.replaceAll("https://ttu-ebook.web.app/b/", "")
.replaceAll("?min=", "");
currentIndex = int.parse(currentIndexText);
HistoryItem bookHistory = HistoryItem(
"https://ttu-ebook.web.app/b/$currentIndex",
"https://ttu-ebook.web.app/b/$currentIndex?min=",
currentTitle,
currentBookmarkDiv,
currentBase64Image,
Expand Down Expand Up @@ -713,7 +716,8 @@ reader.addEventListener('click', (e) => {

String currentIndexText = (await controller.getUrl())
.toString()
.replaceAll("https://ttu-ebook.web.app/b/", "");
.replaceAll("https://ttu-ebook.web.app/b/", "")
.replaceAll("?min=", "");
currentIndex = int.tryParse(currentIndexText) ?? -1;

print("NEW CURRENT INDEX: $currentIndex");
Expand Down
4 changes: 2 additions & 2 deletions lib/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ Future<List<File>> extractSubtitles(String inputPath) async {
final FlutterFFmpeg _flutterFFmpeg = FlutterFFmpeg();
final FlutterFFmpegConfig _flutterFFmpegConfig = new FlutterFFmpegConfig();

for (int i = 0; i < 99; i++) {
for (int i = 0; i < 10; i++) {
String outputPath = "\"$gAppDirPath/extractSrt$i.srt\"";
String command =
"-loglevel verbose -i \"$inputPath\" -map 0:s:$i $outputPath";
"-loglevel quiet -i \"$inputPath\" -map 0:s:$i $outputPath";

String subPath = "$gAppDirPath/extractSrt$i.srt";
File subFile = File(subPath);
Expand Down
6 changes: 3 additions & 3 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1159,11 +1159,11 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "73504b2a4405d0aee3967368b9a94bd0eaa22619"
resolved-ref: "73504b2a4405d0aee3967368b9a94bd0eaa22619"
ref: a51e38dcf8299f11271511922dc90ac48e7f5a47
resolved-ref: a51e38dcf8299f11271511922dc90ac48e7f5a47
url: "https://github.com/Hexer10/youtube_explode_dart"
source: git
version: "1.10.0"
version: "1.10.4"
youtube_player_flutter:
dependency: "direct main"
description:
Expand Down
4 changes: 2 additions & 2 deletions 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.10+74
version: 0.25.11+74

environment:
sdk: ">=2.7.0 <3.0.0"
Expand Down Expand Up @@ -81,7 +81,7 @@ dependencies:
youtube_explode_dart:
git:
url: https://github.com/Hexer10/youtube_explode_dart
ref: 73504b2a4405d0aee3967368b9a94bd0eaa22619
ref: a51e38dcf8299f11271511922dc90ac48e7f5a47
youtube_player_flutter:
wakelock:
dependency_overrides:
Expand Down

0 comments on commit 0fde595

Please sign in to comment.