Skip to content

Commit

Permalink
Probably time for a new build, we will see how this goes
Browse files Browse the repository at this point in the history
  • Loading branch information
femalemonkeyman committed Jun 22, 2023
1 parent fb65031 commit 7723c81
Show file tree
Hide file tree
Showing 13 changed files with 519 additions and 443 deletions.
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void main() async {
MaterialApp.router(
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(
seedColor: Color.fromARGB(255, 119, 0, 255),
seedColor: const Color.fromARGB(255, 119, 0, 255),
brightness: Brightness.dark,
),
useMaterial3: true,
Expand Down
434 changes: 235 additions & 199 deletions lib/media/media_anime.dart

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions lib/media/providers/anime/animepahe.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'dart:math';

import 'package:dio/dio.dart';
import 'package:html/dom.dart';
import 'package:html/parser.dart';
Expand Down Expand Up @@ -79,7 +78,6 @@ Future<Source> paheInfo(final String id) async {
);
}
}
print(qualities);
return Source(qualities: qualities, subtitles: [], headers: headers);
}

Expand Down Expand Up @@ -156,7 +154,7 @@ class JsUnpack {
if (v < symtab.length) {
try {
lookUp = symtab[v];
} catch (e) {}
} catch (_) {}
if (lookUp.isEmpty) lookUp = word;
} else {
lookUp = word;
Expand Down
5 changes: 0 additions & 5 deletions lib/media/providers/anime/hanime.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ import 'package:string_similarity/string_similarity.dart';
import '../../../models/info_models.dart';

Future<List<MediaProv>> haniList(final AniData data) async {
print((
(data.title.split(" ").length > 3)
? data.title.split(" ").getRange(0, 3).join(" ")
: data.title,
).toString().replaceAll(RegExp('[^A-Za-z0-9 -]'), ''));
Response json = await Dio().post(
"https://search.htv-services.com/",
data: jsonEncode(
Expand Down
1 change: 0 additions & 1 deletion lib/media/providers/anime/zoro.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ Future<Source> zoroInfo(final id) async {
sources['sourcesBackup'] =
jsonDecode(decrypt(sources['sourcesBackup'], key));
}
print(sources['tracks']);
return Source(
qualities: {
'default': sources['sources'][0]['file'],
Expand Down
42 changes: 23 additions & 19 deletions lib/media/providers/manga/mangadex.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,29 @@ Future<List<MediaProv>> dexReader(final AniData data) async {
const mangadex = "https://api.mangadex.org/manga";
const String syncLink =
'https://raw.githubusercontent.com/MALSync/MAL-Sync-Backup/master/data/anilist/manga/';
final Map syncResponse = jsonDecode(
(await Dio().get('$syncLink${data.mediaId}.json')).data,
);
final Map json = (await Dio().get(
"$mangadex/${syncResponse['Pages']['Mangadex'].keys.first}/feed?limit=500&translatedLanguage[]=en&order[chapter]=asc",
))
.data;
return List.generate(
json['data'].length,
(index) {
return MediaProv(
provider: 'mangadex',
provId: json['data'][index]['id'],
title: json['data'][index]['attributes']['title'] ?? "",
number: json['data'][index]['attributes']['chapter'],
call: () => dexPages(json['data'][index]['id']),
);
},
);
try {
final Map syncResponse = jsonDecode(
(await Dio().get('$syncLink${data.mediaId}.json')).data,
);
final Map json = (await Dio().get(
"$mangadex/${syncResponse['Pages']['Mangadex'].keys.first}/feed?limit=500&translatedLanguage[]=en&order[chapter]=asc",
))
.data;
return List.generate(
json['data'].length,
(index) {
return MediaProv(
provider: 'mangadex',
provId: json['data'][index]['id'],
title: json['data'][index]['attributes']['title'] ?? "",
number: json['data'][index]['attributes']['chapter'],
call: () => dexPages(json['data'][index]['id']),
);
},
);
} catch (_) {
return [];
}
}

Future<List> dexPages(final String id) async {
Expand Down
3 changes: 1 addition & 2 deletions lib/novel/novel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class NovelPageState extends State<NovelPage> {
if (await Permission.storage.isDenied) {
permission =
(await Permission.manageExternalStorage.request()).isGranted;
print("uwu");
}
}
if (permission) {
Expand All @@ -50,7 +49,7 @@ class NovelPageState extends State<NovelPage> {
);
List<NovData> data = [];
for (File i in epubs) {
print(i);
//print(i);
final Novel novel = Novel(path: i.path);
await novel.parse();
await novel.writeCover();
Expand Down
4 changes: 2 additions & 2 deletions lib/novel/novel_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ class Novel {
for (Map s in spine!['itemref']) {
for (Map c in content!['manifest']['item']) {
if (c.containsValue(s['idref'])) {
print(c);
print('${current.path}/${c['href']}');
//print(c);
//print('${current.path}/${c['href']}');
chapters.add(
Html(
data: File('${current.path}/${c['href']}').readAsStringSync(),
Expand Down
2 changes: 1 addition & 1 deletion lib/novel/novel_reader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class NovelControlsState extends State<NovelControls> {
child: GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
print("left");
//print("left");
// widget.controller.jumpToPage(
// (widget.controller.page! + 1).toInt(),
// );
Expand Down
Loading

0 comments on commit 7723c81

Please sign in to comment.