mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
fix: Keyboard controls and translations (#79)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
7394077726
commit
1babf05834
11 changed files with 796 additions and 745 deletions
|
|
@ -1,14 +1,15 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:fladder/jellyfin/jellyfin_open_api.enums.swagger.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// ignore_for_file: public_member_api_docs, sort_constructors_first
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import 'package:fladder/jellyfin/jellyfin_open_api.enums.swagger.dart';
|
||||
import 'package:fladder/jellyfin/jellyfin_open_api.swagger.dart' as dto;
|
||||
import 'package:fladder/providers/user_provider.dart';
|
||||
import 'package:fladder/util/localization_helper.dart';
|
||||
import 'package:fladder/util/video_properties.dart';
|
||||
|
||||
class MediaStreamsModel {
|
||||
|
|
@ -233,6 +234,14 @@ class AudioStreamModel extends StreamModel {
|
|||
);
|
||||
}
|
||||
|
||||
String label(BuildContext context) {
|
||||
if (index == -1) {
|
||||
return context.localized.off;
|
||||
} else {
|
||||
return displayTitle;
|
||||
}
|
||||
}
|
||||
|
||||
String get title =>
|
||||
[name, language, codec, channelLayout].whereNotNull().where((element) => element.isNotEmpty).join(' - ');
|
||||
|
||||
|
|
@ -283,6 +292,14 @@ class SubStreamModel extends StreamModel {
|
|||
this.supportsExternalStream = false,
|
||||
});
|
||||
|
||||
String label(BuildContext context) {
|
||||
if (index == -1) {
|
||||
return context.localized.off;
|
||||
} else {
|
||||
return displayTitle;
|
||||
}
|
||||
}
|
||||
|
||||
factory SubStreamModel.fromMediaStream(dto.MediaStream stream, Ref ref) {
|
||||
return SubStreamModel(
|
||||
name: stream.title ?? "",
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ class MediaPlaybackModel {
|
|||
final bool completed;
|
||||
final bool errorPlaying;
|
||||
final bool buffering;
|
||||
final bool fullScreen;
|
||||
MediaPlaybackModel({
|
||||
this.state = VideoPlayerState.disposed,
|
||||
this.playing = false,
|
||||
|
|
@ -24,6 +25,7 @@ class MediaPlaybackModel {
|
|||
this.completed = false,
|
||||
this.errorPlaying = false,
|
||||
this.buffering = false,
|
||||
this.fullScreen = false,
|
||||
});
|
||||
|
||||
MediaPlaybackModel copyWith({
|
||||
|
|
@ -36,6 +38,7 @@ class MediaPlaybackModel {
|
|||
bool? completed,
|
||||
bool? errorPlaying,
|
||||
bool? buffering,
|
||||
bool? fullScreen,
|
||||
}) {
|
||||
return MediaPlaybackModel(
|
||||
state: state ?? this.state,
|
||||
|
|
@ -47,6 +50,7 @@ class MediaPlaybackModel {
|
|||
completed: completed ?? this.completed,
|
||||
errorPlaying: errorPlaying ?? this.errorPlaying,
|
||||
buffering: buffering ?? this.buffering,
|
||||
fullScreen: fullScreen ?? this.fullScreen,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue