diff --git a/lib/modules/sonarr/routes/series_details/widgets/season_tile.dart b/lib/modules/sonarr/routes/series_details/widgets/season_tile.dart index 1e06036c..2546e543 100644 --- a/lib/modules/sonarr/routes/series_details/widgets/season_tile.dart +++ b/lib/modules/sonarr/routes/series_details/widgets/season_tile.dart @@ -1,5 +1,5 @@ -import 'package:collection/collection.dart' show IterableExtension; import 'package:flutter/material.dart'; +import 'package:collection/collection.dart' show IterableExtension; import 'package:lunasea/core.dart'; import 'package:lunasea/extensions/datetime.dart'; import 'package:lunasea/extensions/int/bytes.dart'; @@ -28,10 +28,7 @@ class _State extends State { Widget build(BuildContext context) { return LunaBlock( posterPlaceholderIcon: LunaIcons.VIDEO_CAM, - posterUrl: widget.season.images - ?.firstWhereOrNull((e) => e.coverType == 'poster') - ?.url ?? - '', + posterUrl: _posterUrl(), posterHeaders: context.read().headers, title: widget.season.lunaTitle, disabled: !widget.season.monitored!, @@ -46,6 +43,12 @@ class _State extends State { ); } + String _posterUrl() { + final images = widget.season.images; + final poster = images?.firstWhereOrNull((e) => e.coverType == 'poster'); + return poster?.remoteUrl ?? poster?.url ?? ''; + } + Future _onTap() async { SonarrRoutes.SERIES_SEASON.go(params: { 'series': (widget.seriesId ?? -1).toString(),