movie and tvshow list

This commit is contained in:
2024-04-11 22:15:38 +02:00
parent e510934934
commit 493accc6d5
14 changed files with 962 additions and 64 deletions
+40
View File
@@ -42,22 +42,49 @@ class Season {
class TVShow {
int seriesID;
String seriesName;
String overview;
String backdropPath;
DateTime firstAired;
int seriesState;
String resolution;
int cliffhanger;
String status;
String languages;
String networks;
String originCountries;
String productionCompanies;
double voteAverage;
int voteCount;
String cast;
String crew;
String genre;
String download;
String localPath;
List<Season> seasonStatus;
TVShow({
required this.seriesID,
required this.seriesName,
required this.overview,
required this.backdropPath,
required this.firstAired,
required this.seriesState,
required this.resolution,
required this.cliffhanger,
required this.status,
required this.seasonStatus,
required this.languages,
required this.networks,
required this.originCountries,
required this.productionCompanies,
required this.voteAverage,
required this.voteCount,
required this.cast,
required this.crew,
required this.genre,
required this.download,
required this.localPath,
});
factory TVShow.fromJson(Map<String, dynamic> json) {
@@ -89,6 +116,8 @@ class TVShow {
return TVShow(
seriesID: int.parse(json['seriesID']),
seriesName: json['seriesName'],
overview: json['overview'],
backdropPath: json['backdropPath'],
firstAired: DateTime.parse(json['firstAired']),
seriesState: seriesState,
resolution: json['resolution'],
@@ -96,6 +125,17 @@ class TVShow {
cliffhanger: int.parse(json['cliffhanger']),
seasonStatus:
json['seasons'].map<Season>((json) => Season.fromJson(json)).toList(),
languages: json['languages'],
networks: json['networks'],
originCountries: json['originCountries'],
productionCompanies: json['productionCompanies'],
voteAverage: double.parse(json['voteAverage']),
voteCount: int.parse(json['voteCount']),
cast: json['cast'],
crew: json['crew'],
genre: json['genre'],
download: json['download'],
localPath: json['localPath'],
);
}
}