mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
feat: Android TV support (#503)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
7ab8c015b9
commit
c299492d6d
168 changed files with 12019 additions and 3073 deletions
|
|
@ -181,7 +181,7 @@ class EpisodeModel extends ItemStreamModel with EpisodeModelMappable {
|
|||
playlistId: item.playlistItemId,
|
||||
dateAired: item.premiereDate,
|
||||
chapters: Chapter.chaptersFromInfo(item.id ?? "", item.chapters ?? [], ref),
|
||||
images: ImagesData.fromBaseItem(item, ref, getOriginalSize: true),
|
||||
images: ImagesData.fromBaseItem(item, ref),
|
||||
primaryRatio: item.primaryImageAspectRatio,
|
||||
season: item.parentIndexNumber ?? 0,
|
||||
episode: item.indexNumber ?? 0,
|
||||
|
|
|
|||
|
|
@ -38,10 +38,9 @@ class ImagesData {
|
|||
dto.BaseItemDto item,
|
||||
Ref ref, {
|
||||
Size backDrop = const Size(2000, 2000),
|
||||
Size logo = const Size(1000, 1000),
|
||||
Size logo = const Size(500, 500),
|
||||
Size primary = const Size(600, 600),
|
||||
bool getOriginalSize = false,
|
||||
int quality = 95,
|
||||
}) {
|
||||
final itemid = item.id;
|
||||
if (itemid == null) return null;
|
||||
|
|
@ -59,7 +58,6 @@ class ImagesData {
|
|||
type: enums.ImageType.primary,
|
||||
maxHeight: primary.height.toInt(),
|
||||
maxWidth: primary.width.toInt(),
|
||||
quality: quality,
|
||||
),
|
||||
key: "${itemid}_primary_${item.imageTags?['Primary']}",
|
||||
hash: item.imageBlurHashes?.primary?[item.imageTags?['Primary']] ?? "",
|
||||
|
|
@ -77,7 +75,6 @@ class ImagesData {
|
|||
type: enums.ImageType.logo,
|
||||
maxHeight: logo.height.toInt(),
|
||||
maxWidth: logo.width.toInt(),
|
||||
quality: quality,
|
||||
),
|
||||
key: "${itemid}_logo_${item.imageTags?['Logo']}",
|
||||
hash: item.imageBlurHashes?.logo?[item.imageTags?['Logo']] ?? "")
|
||||
|
|
@ -98,7 +95,6 @@ class ImagesData {
|
|||
backdrop,
|
||||
maxHeight: backDrop.height.toInt(),
|
||||
maxWidth: backDrop.width.toInt(),
|
||||
quality: quality,
|
||||
),
|
||||
key: "${itemid}_backdrop_${index}_$backdrop",
|
||||
hash: item.imageBlurHashes?.backdrop?[backdrop] ?? "",
|
||||
|
|
@ -116,9 +112,8 @@ class ImagesData {
|
|||
dto.BaseItemDto item,
|
||||
Ref ref, {
|
||||
Size backDrop = const Size(2000, 2000),
|
||||
Size logo = const Size(1000, 1000),
|
||||
Size logo = const Size(500, 500),
|
||||
Size primary = const Size(600, 600),
|
||||
int quality = 95,
|
||||
}) {
|
||||
if (item.seriesId == null && item.parentId == null) return null;
|
||||
|
||||
|
|
@ -132,7 +127,6 @@ class ImagesData {
|
|||
type: enums.ImageType.primary,
|
||||
maxHeight: primary.height.toInt(),
|
||||
maxWidth: primary.width.toInt(),
|
||||
quality: quality,
|
||||
),
|
||||
key: "${item.seriesId}_primary_${item.seriesPrimaryImageTag ?? ""}",
|
||||
hash: item.imageBlurHashes?.primary?[item.seriesPrimaryImageTag] ?? "")
|
||||
|
|
@ -144,7 +138,6 @@ class ImagesData {
|
|||
type: enums.ImageType.logo,
|
||||
maxHeight: logo.height.toInt(),
|
||||
maxWidth: logo.width.toInt(),
|
||||
quality: quality,
|
||||
),
|
||||
key: "${item.seriesId}_logo_${item.parentLogoImageTag ?? ""}",
|
||||
hash: item.imageBlurHashes?.logo?[item.parentLogoImageTag] ?? "")
|
||||
|
|
@ -161,7 +154,6 @@ class ImagesData {
|
|||
backdrop,
|
||||
maxHeight: backDrop.height.toInt(),
|
||||
maxWidth: backDrop.width.toInt(),
|
||||
quality: quality,
|
||||
),
|
||||
key: "${itemId}_backdrop_${index}_$backdrop",
|
||||
hash: item.imageBlurHashes?.backdrop?[backdrop] ?? "",
|
||||
|
|
@ -180,8 +172,7 @@ class ImagesData {
|
|||
Ref ref, {
|
||||
Size backDrop = const Size(2000, 2000),
|
||||
Size logo = const Size(1000, 1000),
|
||||
Size primary = const Size(2000, 2000),
|
||||
int quality = 95,
|
||||
Size primary = const Size(500, 500),
|
||||
}) {
|
||||
return ImagesData(
|
||||
primary: (item.primaryImageTag != null && item.imageBlurHashes != null)
|
||||
|
|
@ -191,7 +182,6 @@ class ImagesData {
|
|||
type: enums.ImageType.primary,
|
||||
maxHeight: primary.height.toInt(),
|
||||
maxWidth: primary.width.toInt(),
|
||||
quality: quality,
|
||||
),
|
||||
key: "${item.id ?? ""}_primary_${item.primaryImageTag ?? ''}",
|
||||
hash: item.imageBlurHashes?.primary?[item.primaryImageTag] ?? '')
|
||||
|
|
|
|||
|
|
@ -74,6 +74,11 @@ class MovieModel extends ItemStreamModel with MovieModelMappable {
|
|||
@override
|
||||
MediaStreamsModel? get streamModel => mediaStreams;
|
||||
|
||||
@override
|
||||
String? label(BuildContext context) {
|
||||
return name;
|
||||
}
|
||||
|
||||
@override
|
||||
bool get syncAble => true;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
import 'package:fladder/models/items/images_models.dart';
|
||||
import 'package:fladder/models/items/overview_model.dart';
|
||||
import 'package:dart_mappable/dart_mappable.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import 'package:fladder/jellyfin/jellyfin_open_api.swagger.dart';
|
||||
import 'package:fladder/models/item_base_model.dart';
|
||||
import 'package:fladder/models/items/images_models.dart';
|
||||
import 'package:fladder/models/items/item_shared_models.dart';
|
||||
import 'package:fladder/models/items/movie_model.dart';
|
||||
import 'package:fladder/models/items/overview_model.dart';
|
||||
import 'package:fladder/models/items/series_model.dart';
|
||||
|
||||
import 'package:dart_mappable/dart_mappable.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
part 'person_model.mapper.dart';
|
||||
|
||||
@MappableClass()
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class SeriesModel extends ItemBaseModel with SeriesModelMappable {
|
|||
userData: UserData.fromDto(item.userData),
|
||||
parentId: item.parentId,
|
||||
playlistId: item.playlistItemId,
|
||||
images: ImagesData.fromBaseItem(item, ref, getOriginalSize: true),
|
||||
images: ImagesData.fromBaseItem(item, ref),
|
||||
primaryRatio: item.primaryImageAspectRatio,
|
||||
originalTitle: item.originalTitle ?? "",
|
||||
sortName: item.sortName ?? "",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue