Skip to content

Commit 7baee13

Browse files
authored
fix: bangumi history (#80)
1 parent 4e3cbd8 commit 7baee13

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

lib/pages/watch/video_controller.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'dart:async';
2+
import 'dart:convert';
23
import 'dart:io';
34

45
import 'package:dio/dio.dart';
@@ -22,6 +23,7 @@ import 'package:miru_app/utils/layout.dart';
2223
import 'package:miru_app/utils/miru_directory.dart';
2324
import 'package:window_manager/window_manager.dart';
2425
import 'package:path/path.dart' as path;
26+
import 'package:crypto/crypto.dart';
2527

2628
class VideoPlayerController extends GetxController {
2729
final String title;
@@ -266,15 +268,16 @@ class VideoPlayerController extends GetxController {
266268
Directory(coverDir).createSync(recursive: true);
267269
final epName = playList[index.value].name;
268270
final filename = '${title}_$epName';
269-
final file = File(path.join(coverDir, filename));
271+
final file = File(
272+
path.join(coverDir, md5.convert(utf8.encode(filename)).toString()));
270273
if (file.existsSync()) {
271274
file.deleteSync(recursive: true);
272275
}
273276

274277
player.screenshot().then((value) {
275278
file.writeAsBytes(value!).then(
276279
(value) async {
277-
debugPrint("save..");
280+
debugPrint("save.. ${value.path}");
278281
await DatabaseUtils.putHistory(
279282
History()
280283
..url = detailUrl

pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ packages:
234234
source: hosted
235235
version: "1.6.3"
236236
crypto:
237-
dependency: transitive
237+
dependency: "direct main"
238238
description:
239239
name: crypto
240240
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab

pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ dependencies:
5454
xpath_selector_html_parser: ^3.0.1
5555
device_info_plus: ^9.0.3
5656
android_intent_plus: ^4.0.2
57+
crypto: ^3.0.3
5758

5859

5960
dev_dependencies:

0 commit comments

Comments
 (0)