9f238ebafc
Removed unnecessary inline comments from SearchMovies.razor, SearchShows.razor, Movie.cs, and MovieService.cs to improve code readability. Also updated Movie.Results list initialization to use collection expression syntax.
98 lines
2.5 KiB
C#
98 lines
2.5 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace MovieActorLookup.Models.Movies
|
|
{
|
|
public class Movie
|
|
{
|
|
[JsonPropertyName("id")]
|
|
public int Id { get; set; }
|
|
|
|
[JsonPropertyName("title")]
|
|
public string? Title { get; set; }
|
|
|
|
[JsonPropertyName("original_title")]
|
|
public string? OriginalTitle { get; set; }
|
|
|
|
[JsonPropertyName("overview")]
|
|
public string? Overview { get; set; }
|
|
|
|
[JsonPropertyName("adult")]
|
|
public bool Adult { get; set; }
|
|
|
|
[JsonPropertyName("backdrop_path")]
|
|
public string? BackdropPath { get; set; }
|
|
|
|
[JsonPropertyName("genre_ids")]
|
|
public List<int> GenreIds { get; set; } = new List<int>();
|
|
|
|
[JsonPropertyName("original_language")]
|
|
public string? OriginalLanguage { get; set; }
|
|
|
|
[JsonPropertyName("popularity")]
|
|
public double Popularity { get; set; }
|
|
|
|
[JsonPropertyName("poster_path")]
|
|
public string? PosterPath { get; set; }
|
|
|
|
[JsonPropertyName("release_date")]
|
|
public string? ReleaseDate { get; set; }
|
|
|
|
[JsonPropertyName("video")]
|
|
public bool Video { get; set; }
|
|
|
|
[JsonPropertyName("vote_average")]
|
|
public double VoteAverage { get; set; }
|
|
|
|
[JsonPropertyName("vote_count")]
|
|
public int VoteCount { get; set; }
|
|
|
|
[JsonPropertyName("belongs_to_collection")]
|
|
public CollectionInfo BelongsToCollection { get; set; }
|
|
|
|
public Movie()
|
|
{
|
|
GenreIds = new List<int>();
|
|
}
|
|
}
|
|
|
|
public class CollectionInfo
|
|
{
|
|
[JsonPropertyName("id")]
|
|
public int Id { get; set; }
|
|
|
|
[JsonPropertyName("name")]
|
|
public string Name { get; set; }
|
|
|
|
[JsonPropertyName("poster_path")]
|
|
public string PosterPath { get; set; }
|
|
|
|
[JsonPropertyName("backdrop_path")]
|
|
public string BackdropPath { get; set; }
|
|
}
|
|
|
|
public class MovieResponse
|
|
{
|
|
[JsonPropertyName("page")]
|
|
public int Page { get; set; }
|
|
|
|
[JsonPropertyName("results")]
|
|
public List<Movie> Results { get; set; } = [];
|
|
|
|
[JsonPropertyName("total_pages")]
|
|
public int TotalPages { get; set; }
|
|
|
|
[JsonPropertyName("total_results")]
|
|
public int TotalResults { get; set; }
|
|
public MovieResponse()
|
|
{
|
|
Results = new List<Movie>();
|
|
}
|
|
}
|
|
|
|
public class Genre
|
|
{
|
|
public int? Id { get; set; }
|
|
public string? Name { get; set; }
|
|
}
|
|
}
|