Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
NedoPrograMax committed Nov 6, 2023
1 parent 156a74a commit da7cb55
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions lib/src/epub_reader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,22 @@ class EpubReader {
if (manifestItems != null) {
for (var i = 0; i < manifestItems.length; i++) {
final manifestItem = manifestItems[i];
final realChapter = realChapters.firstWhere(
(element) => element.Anchor == manifestItem.Href,
orElse: () => EpubChapter()..Title = 'Fake1 | 9Title',
);
if (realChapter.Title != 'Fake1 | 9Title') {
mixedList.add(realChapter);
} else {
final chapter = allChapters
.firstWhere((element) => element.Anchor == manifestItem.Href);
if (chapter.ContentFileName?.contains('note') != true) {
chapter.Title = '\$ empty-title \$';
mixedList.add(chapter);
if (manifestItem.MediaType?.endsWith('html') == true ||
manifestItem.MediaType?.endsWith('xml') == true) {
final realChapter = realChapters.firstWhere(
(element) => element.ContentFileName == manifestItem.Href,
orElse: () => EpubChapter()..Title = 'Fake1 | 9Title',
);

if (realChapter.Title != 'Fake1 | 9Title') {
mixedList.add(realChapter);
} else {
final chapter = allChapters.firstWhere(
(element) => element.ContentFileName == manifestItem.Href);
if (chapter.ContentFileName?.contains('note') != true) {
chapter.Title = '\$ empty-title \$';
mixedList.add(chapter);
}
}
}
}
Expand Down

0 comments on commit da7cb55

Please sign in to comment.