From 8421f194c6c860d4c1162b63bc1f8a4ddaa7502c Mon Sep 17 00:00:00 2001 From: bulatova_karina Date: Tue, 19 Nov 2024 15:41:39 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B2=20=D0=BF=D1=80=D0=BE=D1=86=D0=B5=D1=81?= =?UTF-8?q?=D1=81=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/data/dtos/films_dto.dart | 2 ++ lib/data/dtos/films_dto.g.dart | 1 + lib/data/mappers/films_mapper.dart | 1 + 3 files changed, 4 insertions(+) diff --git a/lib/data/dtos/films_dto.dart b/lib/data/dtos/films_dto.dart index 6a84462..e1035c9 100644 --- a/lib/data/dtos/films_dto.dart +++ b/lib/data/dtos/films_dto.dart @@ -17,12 +17,14 @@ class FilmsDto { @JsonSerializable(createToJson: false) class FilmDataDto { + final int? kinopoiskId; final String nameRu; final int year; final List genres; final String posterUrl; const FilmDataDto({ + required this.kinopoiskId, required this.nameRu, required this.year, required this.genres, diff --git a/lib/data/dtos/films_dto.g.dart b/lib/data/dtos/films_dto.g.dart index 3507b0c..cc417b9 100644 --- a/lib/data/dtos/films_dto.g.dart +++ b/lib/data/dtos/films_dto.g.dart @@ -14,6 +14,7 @@ FilmsDto _$FilmsDtoFromJson(Map json) => FilmsDto( ); FilmDataDto _$FilmDataDtoFromJson(Map json) => FilmDataDto( + kinopoiskId: (json['kinopoiskId'] as num?)?.toInt(), nameRu: json['nameRu'] as String, year: (json['year'] as num).toInt(), genres: (json['genres'] as List) diff --git a/lib/data/mappers/films_mapper.dart b/lib/data/mappers/films_mapper.dart index c3013cc..4a22a91 100644 --- a/lib/data/mappers/films_mapper.dart +++ b/lib/data/mappers/films_mapper.dart @@ -17,6 +17,7 @@ extension FilmDataDtoToModel on FilmDataDto { nameRu, imageUrl: posterUrl ?? _imagePlaceholder, descriptionText: _makeDescriptionText(year, genres), + id: kinopoiskId.toString(), ); String _makeDescriptionText(int? year, List genres) {