Merge pull request #575 from Schnitzel5/fix/trakt

fixed trakt episode numbers
This commit is contained in:
Moustapha Kodjo Amadou 2025-09-10 09:12:28 +01:00 committed by GitHub
commit ff694da647
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 33 additions and 46 deletions

View file

@ -38,7 +38,6 @@ import 'package:mangayomi/utils/url_protocol/api.dart';
import 'package:mangayomi/modules/more/settings/appearance/providers/theme_provider.dart';
import 'package:mangayomi/modules/library/providers/file_scanner.dart';
import 'package:media_kit/media_kit.dart';
import 'package:path/path.dart' as path;
import 'package:path_provider/path_provider.dart';
import 'package:window_manager/window_manager.dart';
import 'package:path/path.dart' as p;
@ -70,7 +69,6 @@ void main(List<String> args) async {
);
}
}
await AppLogger.init();
isar = await StorageProvider().initDB(null, inspector: kDebugMode);
await Hive.initFlutter();
Hive.registerAdapter(TrackSearchAdapter());
@ -86,6 +84,7 @@ void main(List<String> args) async {
Future<void> _postLaunchInit() async {
await StorageProvider().requestPermission();
await StorageProvider().deleteBtDirectory();
await AppLogger.init();
}
class MyApp extends ConsumerStatefulWidget {
@ -324,9 +323,9 @@ class _MyAppState extends ConsumerState<MyApp> {
if (filesMissing) {
final bytes = await rootBundle.load("assets/mangayomi_mpv.zip");
final archive = ZipDecoder().decodeBytes(bytes.buffer.asUint8List());
String shadersDir = path.join(dir.path, 'shaders');
String shadersDir = p.join(dir.path, 'shaders');
await Directory(shadersDir).create(recursive: true);
String scriptsDir = path.join(dir.path, 'scripts');
String scriptsDir = p.join(dir.path, 'scripts');
await Directory(scriptsDir).create(recursive: true);
for (final file in archive.files) {
if (file.name == "mpv.conf") {

View file

@ -269,43 +269,33 @@ class AppearanceScreen extends ConsumerWidget {
),
)
.toList();
return Flexible(
return Expanded(
child: Scrollbar(
interactive: true,
thickness: 12,
radius: const Radius.circular(10),
controller: controller,
child: CustomScrollView(
controller: controller,
slivers: [
SliverPadding(
padding: const EdgeInsets.all(0),
sliver: RadioGroup(
groupValue: appFontFamily,
onChanged: (value) {
ref
.read(
appFontFamilyProvider.notifier,
)
.set(value);
Navigator.pop(context);
},
child: SuperSliverList.builder(
itemCount: values.length,
itemBuilder: (context, index) {
final value = values[index];
return RadioListTile(
dense: true,
contentPadding:
const EdgeInsets.all(0),
value: value.value().fontFamily,
title: Text(value.key),
);
},
),
),
),
],
child: RadioGroup<String?>(
groupValue: appFontFamily,
onChanged: (value) {
ref
.read(appFontFamilyProvider.notifier)
.set(value);
Navigator.pop(context);
},
child: SuperListView.builder(
controller: controller,
itemCount: values.length,
itemBuilder: (context, index) {
final value = values[index];
return RadioListTile<String?>(
dense: true,
contentPadding: const EdgeInsets.all(0),
value: value.value().fontFamily,
title: Text(value.key),
);
},
),
),
),
);

View file

@ -164,7 +164,7 @@ class TraktTv extends _$TraktTv implements BaseTracker {
"movies";
final url = Uri.parse(
'$_baseApiUrl/sync/history/${isMovie ? "movies" : "shows"}/${track.mediaId}',
).replace(queryParameters: {"extended": "full"});
).replace(queryParameters: {"extended": "full", "page": "1", "limit": "3000"});
final result = await _makeGetRequest(url, accessToken);
final data = jsonDecode(result.body) as List?;
if (data?.isNotEmpty ?? false) {
@ -239,7 +239,7 @@ class TraktTv extends _$TraktTv implements BaseTracker {
final isMovie =
track.trackingUrl?.replaceAll("https://trakt.tv/", "").split("/")[0] ==
"movies";
final urlRemove = Uri.parse(
/*final urlRemove = Uri.parse(
"$_baseApiUrl/sync/history/remove",
).replace(queryParameters: {'clientId': _clientId});
final bodyRemove = isMovie
@ -257,7 +257,7 @@ class TraktTv extends _$TraktTv implements BaseTracker {
},
],
};
await _makePostRequest(urlRemove, accessToken, bodyRemove);
await _makePostRequest(urlRemove, accessToken, bodyRemove);*/
final url = Uri.parse(
"$_baseApiUrl/sync/history",
).replace(queryParameters: {'extended': 'full', 'clientId': _clientId});
@ -265,7 +265,7 @@ class TraktTv extends _$TraktTv implements BaseTracker {
? {
'movies': [
{
'watched_at': DateTime.now().toIso8601String(),
'watched_at': DateTime.timestamp().toIso8601String(),
'ids': {'trakt': track.mediaId},
},
],
@ -273,7 +273,6 @@ class TraktTv extends _$TraktTv implements BaseTracker {
: {
'shows': [
{
'watched_at': DateTime.now().toIso8601String(),
'ids': {'trakt': track.mediaId},
'seasons': [
{
@ -281,7 +280,7 @@ class TraktTv extends _$TraktTv implements BaseTracker {
'episodes': [
for (int i = 1; i <= (track.lastChapterRead ?? 1); i++)
{
'watched_at': DateTime.now().toIso8601String(),
'watched_at': DateTime.timestamp().toIso8601String(),
'number': i,
},
],

View file

@ -161,4 +161,3 @@ inno_bundle:
- french
- german
admin: false
version: 0.6.5

View file

@ -17,12 +17,12 @@
"version": "0.6.5",
"versionDate": "2025-08-29T15:38:32Z",
"versionDescription": "What's Changed\r\n* Show correct version number on Windows by @NBA2K1 in https://github.com/kodjodevf/mangayomi/pull/542\r\n* re\u2022added full upload and download by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/544\r\n* Fix MAL & Kitsu \"No Cover\" Exception by @NBA2K1 in https://github.com/kodjodevf/mangayomi/pull/555\r\n* allow to swipe pages even if zoomed in by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/553\r\n* added Anibrain recommendations by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/552\r\n* move history to more screen if hidden by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/549\r\n* added downloaded only mode by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/551\r\n* added quick access to source settings by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/550\r\n* added missing arb entry by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/556\r\n* Refactor select bar widget and unify manga read state logic by @NBA2K1 in https://github.com/kodjodevf/mangayomi/pull/536\r\n* enhanced mpv player by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/540\r\n* added support for Mihon extensions via ApkBridge by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/559\r\n* fixed local subtitles by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/565\r\n* enhanced calendar by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/564\r\n* added subtitles search by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/560\r\n* added watch order by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/562\r\n* changed from labels to icons by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/566\r\n* added Simkl tracker by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/561\r\n* add option to download online subtitles by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/567\r\n* fixed Trakt refresh token by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/569\r\n* added button link to the apk by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/570\r\n* added option to turn on/off mpv hardware acceleration by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/571\r\n\r\n\r\n**Full Changelog**: https://github.com/kodjodevf/mangayomi/compare/v0.6.35...v0.6.5",
"downloadURL": null,
"downloadURL": "https://github.com/kodjodevf/mangayomi/releases/download/v0.6.5/Mangayomi-v0.6.5-ios.ipa",
"localizedDescription": "Mangayomi is an open-source Flutter app for reading manga, novels, and watching anime across multiple platforms.",
"iconURL": "https://raw.githubusercontent.com/kodjodevf/mangayomi/refs/heads/main/repo/images/icons/icon_default.webp",
"tintColor": "EF4444",
"category": "entertainment",
"size": 59596148,
"size": 44527742,
"screenshotURLs": [
"https://raw.githubusercontent.com/kodjodevf/mangayomi/refs/heads/main/repo/images/screenshots/image_0_default.webp",
"https://raw.githubusercontent.com/kodjodevf/mangayomi/refs/heads/main/repo/images/screenshots/image_1_default.webp",
@ -34,7 +34,7 @@
"date": "2025-08-29T15:38:32Z",
"localizedDescription": "What's Changed\r\n* Show correct version number on Windows by @NBA2K1 in https://github.com/kodjodevf/mangayomi/pull/542\r\n* re\u2022added full upload and download by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/544\r\n* Fix MAL & Kitsu \"No Cover\" Exception by @NBA2K1 in https://github.com/kodjodevf/mangayomi/pull/555\r\n* allow to swipe pages even if zoomed in by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/553\r\n* added Anibrain recommendations by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/552\r\n* move history to more screen if hidden by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/549\r\n* added downloaded only mode by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/551\r\n* added quick access to source settings by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/550\r\n* added missing arb entry by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/556\r\n* Refactor select bar widget and unify manga read state logic by @NBA2K1 in https://github.com/kodjodevf/mangayomi/pull/536\r\n* enhanced mpv player by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/540\r\n* added support for Mihon extensions via ApkBridge by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/559\r\n* fixed local subtitles by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/565\r\n* enhanced calendar by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/564\r\n* added subtitles search by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/560\r\n* added watch order by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/562\r\n* changed from labels to icons by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/566\r\n* added Simkl tracker by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/561\r\n* add option to download online subtitles by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/567\r\n* fixed Trakt refresh token by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/569\r\n* added button link to the apk by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/570\r\n* added option to turn on/off mpv hardware acceleration by @Schnitzel5 in https://github.com/kodjodevf/mangayomi/pull/571\r\n\r\n\r\n**Full Changelog**: https://github.com/kodjodevf/mangayomi/compare/v0.6.35...v0.6.5",
"downloadURL": "https://github.com/kodjodevf/mangayomi/releases/download/v0.6.5/Mangayomi-v0.6.5-ios.ipa",
"size": 59596148
"size": 44527742
},
{
"version": "0.6.35",