mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-03-11 17:25:32 +00:00
fix file path handling
This commit is contained in:
parent
0f430f80d9
commit
d4a0354143
2 changed files with 9 additions and 4 deletions
|
|
@ -79,11 +79,13 @@ Future<GetChapterPagesModel> getChapterPages(
|
|||
}
|
||||
|
||||
if (pageUrls.isNotEmpty || isLocalArchive) {
|
||||
if (await File("${mangaDirectory!.path}${chapter.name}.cbz").exists() ||
|
||||
if (await File(
|
||||
p.join(mangaDirectory!.path, "${chapter.name}.cbz"),
|
||||
).exists() ||
|
||||
isLocalArchive) {
|
||||
final path = isLocalArchive
|
||||
? chapter.archivePath
|
||||
: "${mangaDirectory.path}${chapter.name}.cbz";
|
||||
: p.join(mangaDirectory.path, "${chapter.name}.cbz");
|
||||
final local = await ref.watch(
|
||||
getArchiveDataFromFileProvider(path!).future,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import 'package:mangayomi/utils/utils.dart';
|
|||
import 'package:mangayomi/utils/extensions/string_extensions.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
part 'get_video_list.g.dart';
|
||||
|
||||
@riverpod
|
||||
|
|
@ -21,8 +22,10 @@ Future<(List<Video>, bool, List<String>)> getVideoList(
|
|||
final isLocalArchive =
|
||||
episode.manga.value!.isLocalArchive! &&
|
||||
episode.manga.value!.source != "torrent";
|
||||
final mp4animePath =
|
||||
"${mangaDirectory!.path}${episode.name!.replaceForbiddenCharacters(' ')}.mp4";
|
||||
final mp4animePath = p.join(
|
||||
mangaDirectory!.path,
|
||||
"${episode.name!.replaceForbiddenCharacters(' ')}.mp4",
|
||||
);
|
||||
List<String> infoHashes = [];
|
||||
if (await File(mp4animePath).exists() || isLocalArchive) {
|
||||
final path = isLocalArchive ? episode.archivePath : mp4animePath;
|
||||
|
|
|
|||
Loading…
Reference in a new issue