Skip to content

Commit

Permalink
allow missing hayom yom etc
Browse files Browse the repository at this point in the history
  • Loading branch information
yringler committed Jan 23, 2022
1 parent eb56cb2 commit 0cb037f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 5.0.2+12
version: 5.0.4+12

environment:
sdk: '>=2.15.0 <3.0.0'
Expand Down
22 changes: 10 additions & 12 deletions inside_data/lib/src/suggested-content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,10 @@ class SuggestedContentLoader {
/// Get suggested content.
/// Doesn't request new data more than once every few hours.
Future<SuggestedContent> _httpLoad() async {
final content =
await Future.wait([_timelyContent(), _popular(), _featured()]);

final suggestedContent = SuggestedContent(
timelyContent: content[0] as TimelyContent,
popular: content[1] as List<ContentReference>,
featured: content[2] as List<FeaturedSectionVerified>);
timelyContent: await _timelyContent(),
popular: await _popular(),
featured: await _featured());

return suggestedContent;
}
Expand Down Expand Up @@ -144,8 +141,9 @@ class SuggestedContentLoader {
return featuredData;
}

Future<ContentReference?> _content(int id) async =>
ContentReference.fromDataOrNull(
Future<ContentReference?> _content(int? id) async => id == null
? null
: ContentReference.fromDataOrNull(
data: await dataLayer.mediaOrSection(id.toString()));
}

Expand Down Expand Up @@ -227,8 +225,8 @@ class FeaturedSectionVerified {

@JsonSerializable()
class _TimelyContentResponse {
final int parsha;
final int monthly;
final int? parsha;
final int? monthly;

_TimelyContentResponse(this.parsha, this.monthly);

Expand All @@ -238,8 +236,8 @@ class _TimelyContentResponse {

@JsonSerializable(fieldRename: FieldRename.snake)
class _DailyClasses {
final int tanyaId;
final int hayomYomId;
final int? tanyaId;
final int? hayomYomId;

_DailyClasses(this.tanyaId, this.hayomYomId);

Expand Down
8 changes: 4 additions & 4 deletions inside_data/lib/src/suggested-content.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0cb037f

Please sign in to comment.