mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
fix: Incorrect playback reporting (#221)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
f259151336
commit
3b4b8a9101
5 changed files with 13 additions and 27 deletions
|
|
@ -17,7 +17,6 @@ import 'package:fladder/models/items/trick_play_model.dart';
|
|||
import 'package:fladder/providers/auth_provider.dart';
|
||||
import 'package:fladder/providers/image_provider.dart';
|
||||
import 'package:fladder/providers/user_provider.dart';
|
||||
import 'package:fladder/util/duration_extensions.dart';
|
||||
import 'package:fladder/util/jellyfin_extension.dart';
|
||||
|
||||
class ServerQueryResult {
|
||||
|
|
@ -492,25 +491,8 @@ class JellyService {
|
|||
|
||||
Future<Response> sessionsPlayingStoppedPost({
|
||||
required PlaybackStopInfo? body,
|
||||
Duration? totalDuration,
|
||||
}) async {
|
||||
final position = body?.positionTicks;
|
||||
final totalTime = totalDuration?.toRuntimeTicks;
|
||||
final maxTime = ref.read(userProvider.select((value) => value?.serverConfiguration?.maxResumePct ?? 90));
|
||||
|
||||
final response = await api.sessionsPlayingStoppedPost(
|
||||
body: body?.copyWith(
|
||||
failed: false,
|
||||
),
|
||||
);
|
||||
|
||||
//This is a temporary fix
|
||||
if (totalTime != null && position != null && position > (totalTime * (maxTime / 100))) {
|
||||
await usersUserIdPlayedItemsItemIdPost(itemId: body?.itemId, datePlayed: DateTime.now());
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
}) =>
|
||||
api.sessionsPlayingStoppedPost(body: body);
|
||||
|
||||
Future<Response> sessionsPlayingProgressPost({required PlaybackProgressInfo? body}) async =>
|
||||
api.sessionsPlayingProgressPost(body: body);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue