mirror of
https://github.com/owenlejeune/TVTime.git
synced 2025-11-09 13:22:44 -05:00
replace tv credits with aggregate credits API
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class BaseEpisode(
|
class BaseEpisode(
|
||||||
@SerializedName("air_date") val airDate: String,
|
@SerializedName("air_date") val airDate: Date?,
|
||||||
@SerializedName("episode_number") val episodeNumber: Int,
|
@SerializedName("episode_number") val episodeNumber: Int,
|
||||||
@SerializedName("id") val id: Int,
|
@SerializedName("id") val id: Int,
|
||||||
@SerializedName("name") val name: String,
|
@SerializedName("name") val name: String,
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
data class BaseSeason(
|
data class BaseSeason(
|
||||||
@SerializedName("id") val id: Int,
|
@SerializedName("id") val id: Int,
|
||||||
@SerializedName("air_date") val airDate: String,
|
@SerializedName("air_date") val airDate: Date?,
|
||||||
@SerializedName("episode_count") val episodeCount: Int,
|
@SerializedName("episode_count") val episodeCount: Int,
|
||||||
@SerializedName("name") val name: String,
|
@SerializedName("name") val name: String,
|
||||||
@SerializedName("overview") val overview: String,
|
@SerializedName("overview") val overview: String,
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ abstract class CreditMedia(
|
|||||||
@SerializedName("media_type") val mediaType: MediaViewType,
|
@SerializedName("media_type") val mediaType: MediaViewType,
|
||||||
@SerializedName("genre_ids") val genreIds: List<Int>,
|
@SerializedName("genre_ids") val genreIds: List<Int>,
|
||||||
@SerializedName("popularity") val popularity: Float,
|
@SerializedName("popularity") val popularity: Float,
|
||||||
@SerializedName("release_date", alternate = ["first_air_date"]) val releaseDate: Date,
|
@SerializedName("release_date", alternate = ["first_air_date"]) val releaseDate: Date?,
|
||||||
@SerializedName("vote_average") val voteAverage: Float,
|
@SerializedName("vote_average") val voteAverage: Float,
|
||||||
@SerializedName("vote_count") val voteCount: Int,
|
@SerializedName("vote_count") val voteCount: Int,
|
||||||
@SerializedName("character") val character: String
|
@SerializedName("character") val character: String
|
||||||
@@ -73,7 +73,7 @@ class CreditTv(
|
|||||||
MediaViewType.TV, genreIds, popularity, releaseDate, voteAverage, voteCount, character)
|
MediaViewType.TV, genreIds, popularity, releaseDate, voteAverage, voteCount, character)
|
||||||
|
|
||||||
class CreditEpisode(
|
class CreditEpisode(
|
||||||
@SerializedName("air_date") val airDate: Date,
|
@SerializedName("air_date") val airDate: Date?,
|
||||||
@SerializedName("episode_number") val episodeNumber: Int,
|
@SerializedName("episode_number") val episodeNumber: Int,
|
||||||
@SerializedName("id") val id: Int,
|
@SerializedName("id") val id: Int,
|
||||||
@SerializedName("name") val name: String,
|
@SerializedName("name") val name: String,
|
||||||
@@ -86,7 +86,7 @@ class CreditEpisode(
|
|||||||
)
|
)
|
||||||
|
|
||||||
class CreditSeason(
|
class CreditSeason(
|
||||||
@SerializedName("air_date") val airDate: Date,
|
@SerializedName("air_date") val airDate: Date?,
|
||||||
@SerializedName("episode_count") val episodeCount: Int,
|
@SerializedName("episode_count") val episodeCount: Int,
|
||||||
@SerializedName("id") val id: Int,
|
@SerializedName("id") val id: Int,
|
||||||
@SerializedName("name") val name: String,
|
@SerializedName("name") val name: String,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class DetailedMovie(
|
class DetailedMovie(
|
||||||
id: Int,
|
id: Int,
|
||||||
@@ -21,7 +22,7 @@ class DetailedMovie(
|
|||||||
spokenLanguages: List<SpokenLanguage>,
|
spokenLanguages: List<SpokenLanguage>,
|
||||||
@SerializedName("adult") val isAdult: Boolean,
|
@SerializedName("adult") val isAdult: Boolean,
|
||||||
@SerializedName("budget") val budget: Int,
|
@SerializedName("budget") val budget: Int,
|
||||||
@SerializedName("release_date") val releaseDate: String,
|
@SerializedName("release_date") val releaseDate: Date?,
|
||||||
@SerializedName("revenue") val revenue: Long,
|
@SerializedName("revenue") val revenue: Long,
|
||||||
@SerializedName("runtime") val runtime: Int?,
|
@SerializedName("runtime") val runtime: Int?,
|
||||||
@SerializedName("imdb_id") val imdbId: String?,
|
@SerializedName("imdb_id") val imdbId: String?,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class DetailedTv(
|
class DetailedTv(
|
||||||
id: Int,
|
id: Int,
|
||||||
@@ -20,8 +21,8 @@ class DetailedTv(
|
|||||||
popularity: Float,
|
popularity: Float,
|
||||||
spokenLanguages: List<SpokenLanguage>,
|
spokenLanguages: List<SpokenLanguage>,
|
||||||
@SerializedName("created_by") val createdBy: List<Person>,
|
@SerializedName("created_by") val createdBy: List<Person>,
|
||||||
@SerializedName("first_air_date") val firstAirDate: String,
|
@SerializedName("first_air_date") val firstAirDate: Date?,
|
||||||
@SerializedName("last_air_date") val lastAirDate: String,
|
@SerializedName("last_air_date") val lastAirDate: Date?,
|
||||||
@SerializedName("in_production") val inProduction: Boolean,
|
@SerializedName("in_production") val inProduction: Boolean,
|
||||||
@SerializedName("networks") val networks: List<Network>,
|
@SerializedName("networks") val networks: List<Network>,
|
||||||
@SerializedName("number_of_episodes") val numberOfEpisodes: Int,
|
@SerializedName("number_of_episodes") val numberOfEpisodes: Int,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
abstract class FavoriteMedia(
|
abstract class FavoriteMedia(
|
||||||
@SerializedName("poster_path") val posterPath: String?,
|
@SerializedName("poster_path") val posterPath: String?,
|
||||||
@@ -9,7 +10,7 @@ abstract class FavoriteMedia(
|
|||||||
@SerializedName("backdrop_path") val backdropPath: String?,
|
@SerializedName("backdrop_path") val backdropPath: String?,
|
||||||
@SerializedName("vote_average") val voteAverage: Float,
|
@SerializedName("vote_average") val voteAverage: Float,
|
||||||
@SerializedName("overview") val overview: String,
|
@SerializedName("overview") val overview: String,
|
||||||
@SerializedName("release_date", alternate = ["first_air_date"]) val releaseDate: String,
|
@SerializedName("release_date", alternate = ["first_air_date"]) val releaseDate: Date?,
|
||||||
@SerializedName("genre_ids") val genreIds: List<Int>,
|
@SerializedName("genre_ids") val genreIds: List<Int>,
|
||||||
@SerializedName("original_language") val originalLanguage: String,
|
@SerializedName("original_language") val originalLanguage: String,
|
||||||
@SerializedName("vote_count") val voteCount: Int,
|
@SerializedName("vote_count") val voteCount: Int,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class FavoriteMovie(
|
class FavoriteMovie(
|
||||||
posterPath: String?,
|
posterPath: String?,
|
||||||
@@ -9,7 +10,7 @@ class FavoriteMovie(
|
|||||||
backdropPath: String?,
|
backdropPath: String?,
|
||||||
voteAverage: Float,
|
voteAverage: Float,
|
||||||
overview: String,
|
overview: String,
|
||||||
releaseDate: String,
|
releaseDate: Date?,
|
||||||
genreIds: List<Int>,
|
genreIds: List<Int>,
|
||||||
originalLanguage: String,
|
originalLanguage: String,
|
||||||
voteCount: Int,
|
voteCount: Int,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class FavoriteTvSeries(
|
class FavoriteTvSeries(
|
||||||
posterPath: String?,
|
posterPath: String?,
|
||||||
@@ -9,7 +10,7 @@ class FavoriteTvSeries(
|
|||||||
backdropPath: String?,
|
backdropPath: String?,
|
||||||
voteAverage: Float,
|
voteAverage: Float,
|
||||||
overview: String,
|
overview: String,
|
||||||
releaseDate: String,
|
releaseDate: Date?,
|
||||||
genreIds: List<Int>,
|
genreIds: List<Int>,
|
||||||
originalLanguage: String,
|
originalLanguage: String,
|
||||||
voteCount: Int,
|
voteCount: Int,
|
||||||
|
|||||||
@@ -2,10 +2,11 @@ package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
|||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
abstract class KnownFor(
|
abstract class KnownFor(
|
||||||
@SerializedName("backdrop_path") val backdropPath: String?,
|
@SerializedName("backdrop_path") val backdropPath: String?,
|
||||||
@SerializedName("release_date", alternate = ["first_air_date"]) val releaseDate: String,
|
@SerializedName("release_date", alternate = ["first_air_date"]) val releaseDate: Date?,
|
||||||
@SerializedName("genre_ids") val genreIds: List<Int>,
|
@SerializedName("genre_ids") val genreIds: List<Int>,
|
||||||
@SerializedName("id") val id: Int,
|
@SerializedName("id") val id: Int,
|
||||||
@SerializedName("media_type") val mediaType: MediaViewType,
|
@SerializedName("media_type") val mediaType: MediaViewType,
|
||||||
|
|||||||
@@ -2,10 +2,11 @@ package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
|||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class KnownForMovie(
|
class KnownForMovie(
|
||||||
backdropPath: String?,
|
backdropPath: String?,
|
||||||
releaseDate: String,
|
releaseDate: Date?,
|
||||||
genreIds: List<Int>,
|
genreIds: List<Int>,
|
||||||
id: Int,
|
id: Int,
|
||||||
mediaType: MediaViewType,
|
mediaType: MediaViewType,
|
||||||
|
|||||||
@@ -2,10 +2,11 @@ package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
|||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class KnownForTv(
|
class KnownForTv(
|
||||||
backdropPath: String?,
|
backdropPath: String?,
|
||||||
releaseDate: String,
|
releaseDate: Date?,
|
||||||
genreIds: List<Int>,
|
genreIds: List<Int>,
|
||||||
id: Int,
|
id: Int,
|
||||||
mediaType: MediaViewType,
|
mediaType: MediaViewType,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
data class MovieReleaseResults(
|
data class MovieReleaseResults(
|
||||||
@SerializedName("results") val releaseDates: List<ReleaseDateResult>
|
@SerializedName("results") val releaseDates: List<ReleaseDateResult>
|
||||||
@@ -13,7 +14,7 @@ data class MovieReleaseResults(
|
|||||||
|
|
||||||
inner class ReleaseDate(
|
inner class ReleaseDate(
|
||||||
@SerializedName("certification") val certification: String,
|
@SerializedName("certification") val certification: String,
|
||||||
@SerializedName("release_date") val releaseDate: String
|
@SerializedName("release_date") val releaseDate: Date?
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class Review(
|
class Review(
|
||||||
@SerializedName("id") val id: String,
|
@SerializedName("id") val id: String,
|
||||||
@SerializedName("author") val author: String,
|
@SerializedName("author") val author: String,
|
||||||
@SerializedName("author_details") val authorDetails: AuthorDetails,
|
@SerializedName("author_details") val authorDetails: AuthorDetails,
|
||||||
@SerializedName("content") val content: String,
|
@SerializedName("content") val content: String,
|
||||||
@SerializedName("created_at") val createdAt: String,
|
@SerializedName("created_at") val createdAt: Date?,
|
||||||
@SerializedName("updated_at") val updatedAt: String
|
@SerializedName("updated_at") val updatedAt: Date?
|
||||||
)
|
)
|
||||||
@@ -2,12 +2,13 @@ package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
|||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
abstract class SearchResultMedia(
|
abstract class SearchResultMedia(
|
||||||
@SerializedName("overview") val overview: String,
|
@SerializedName("overview") val overview: String,
|
||||||
@SerializedName("vote_average") val voteAverage: Float,
|
@SerializedName("vote_average") val voteAverage: Float,
|
||||||
@SerializedName("vote_count") val voteCount: Int,
|
@SerializedName("vote_count") val voteCount: Int,
|
||||||
@SerializedName("release_date", alternate = ["first_air_date", "air_date"]) val releaseDate: String,
|
@SerializedName("release_date", alternate = ["first_air_date", "air_date"]) val releaseDate: Date?,
|
||||||
@SerializedName("backdrop_path") val backdropPath: String?,
|
@SerializedName("backdrop_path") val backdropPath: String?,
|
||||||
@SerializedName("genre_ids") val genreIds: List<Int>,
|
@SerializedName("genre_ids") val genreIds: List<Int>,
|
||||||
@SerializedName("original_language") val originalLanguage: String,
|
@SerializedName("original_language") val originalLanguage: String,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
|||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class SearchResultMovie(
|
class SearchResultMovie(
|
||||||
id: Int,
|
id: Int,
|
||||||
@@ -15,7 +16,7 @@ class SearchResultMovie(
|
|||||||
originalName: String,
|
originalName: String,
|
||||||
posterPath: String?,
|
posterPath: String?,
|
||||||
popularity: Float,
|
popularity: Float,
|
||||||
releaseDate: String,
|
releaseDate: Date?,
|
||||||
@SerializedName("adult") val isAdult: Boolean,
|
@SerializedName("adult") val isAdult: Boolean,
|
||||||
@SerializedName("video") val video: Boolean,
|
@SerializedName("video") val video: Boolean,
|
||||||
): SearchResultMedia(
|
): SearchResultMedia(
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
|||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class SearchResultTv(
|
class SearchResultTv(
|
||||||
id: Int,
|
id: Int,
|
||||||
@@ -15,7 +16,7 @@ class SearchResultTv(
|
|||||||
originalName: String,
|
originalName: String,
|
||||||
posterPath: String?,
|
posterPath: String?,
|
||||||
popularity: Float,
|
popularity: Float,
|
||||||
releaseDate: String,
|
releaseDate: Date?,
|
||||||
@SerializedName("origin_country") val originCountry: List<String>,
|
@SerializedName("origin_country") val originCountry: List<String>,
|
||||||
): SearchResultMedia(
|
): SearchResultMedia(
|
||||||
overview, voteAverage, voteCount, releaseDate, backdropPath, genreIds,
|
overview, voteAverage, voteCount, releaseDate, backdropPath, genreIds,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
abstract class WatchlistMedia(
|
abstract class WatchlistMedia(
|
||||||
@SerializedName("poster_path") val posterPath: String?,
|
@SerializedName("poster_path") val posterPath: String?,
|
||||||
@@ -9,7 +10,7 @@ abstract class WatchlistMedia(
|
|||||||
@SerializedName("backdrop_path") val backdropPath: String?,
|
@SerializedName("backdrop_path") val backdropPath: String?,
|
||||||
@SerializedName("vote_average") val voteAverage: Float,
|
@SerializedName("vote_average") val voteAverage: Float,
|
||||||
@SerializedName("overview") val overview: String,
|
@SerializedName("overview") val overview: String,
|
||||||
@SerializedName("release_date", alternate = ["first_air_date"]) val releaseDate: String,
|
@SerializedName("release_date", alternate = ["first_air_date"]) val releaseDate: Date?,
|
||||||
@SerializedName("genre_ids") val genreIds: List<Int>,
|
@SerializedName("genre_ids") val genreIds: List<Int>,
|
||||||
@SerializedName("original_language") val originalLanguage: String,
|
@SerializedName("original_language") val originalLanguage: String,
|
||||||
@SerializedName("vote_count") val voteCount: Int,
|
@SerializedName("vote_count") val voteCount: Int,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class WatchlistMovie(
|
class WatchlistMovie(
|
||||||
posterPath: String?,
|
posterPath: String?,
|
||||||
@@ -9,7 +10,7 @@ class WatchlistMovie(
|
|||||||
backdropPath: String?,
|
backdropPath: String?,
|
||||||
voteAverage: Float,
|
voteAverage: Float,
|
||||||
overview: String,
|
overview: String,
|
||||||
releaseDate: String,
|
releaseDate: Date?,
|
||||||
genreIds: List<Int>,
|
genreIds: List<Int>,
|
||||||
originalLanguage: String,
|
originalLanguage: String,
|
||||||
voteCount: Int,
|
voteCount: Int,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
package com.owenlejeune.tvtime.api.tmdb.api.v3.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class WatchlistTvSeries(
|
class WatchlistTvSeries(
|
||||||
posterPath: String?,
|
posterPath: String?,
|
||||||
@@ -9,7 +10,7 @@ class WatchlistTvSeries(
|
|||||||
backdropPath: String?,
|
backdropPath: String?,
|
||||||
voteAverage: Float,
|
voteAverage: Float,
|
||||||
overview: String,
|
overview: String,
|
||||||
releaseDate: String,
|
releaseDate: Date?,
|
||||||
genreIds: List<Int>,
|
genreIds: List<Int>,
|
||||||
originalLanguage: String,
|
originalLanguage: String,
|
||||||
voteCount: Int,
|
voteCount: Int,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.api.v4.model
|
package com.owenlejeune.tvtime.api.tmdb.api.v4.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class AccountList(
|
class AccountList(
|
||||||
@SerializedName("iso_639_1") val languageCode: String,
|
@SerializedName("iso_639_1") val languageCode: String,
|
||||||
@@ -10,8 +11,8 @@ class AccountList(
|
|||||||
@SerializedName("revenue") val revenue: String,
|
@SerializedName("revenue") val revenue: String,
|
||||||
@SerializedName("public") val public: Int,
|
@SerializedName("public") val public: Int,
|
||||||
@SerializedName("name") val name: String,
|
@SerializedName("name") val name: String,
|
||||||
@SerializedName("updated_at") val updatedAt: String,
|
@SerializedName("updated_at") val updatedAt: Date?,
|
||||||
@SerializedName("created_at") val createdAt: String,
|
@SerializedName("created_at") val createdAt: Date?,
|
||||||
// @SerializedName("sort_by")
|
// @SerializedName("sort_by")
|
||||||
@SerializedName("backdrop_path") val backdropPath: String,
|
@SerializedName("backdrop_path") val backdropPath: String,
|
||||||
@SerializedName("runtime") val runtime: Int,
|
@SerializedName("runtime") val runtime: Int,
|
||||||
|
|||||||
@@ -2,10 +2,11 @@ package com.owenlejeune.tvtime.api.tmdb.api.v4.model
|
|||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
abstract class ListItem(
|
abstract class ListItem(
|
||||||
@SerializedName("backdrop_path") val backdropPath: String?,
|
@SerializedName("backdrop_path") val backdropPath: String?,
|
||||||
@SerializedName("release_date", alternate = ["first_air_date"]) val releaseDate: String,
|
@SerializedName("release_date", alternate = ["first_air_date"]) val releaseDate: Date?,
|
||||||
@SerializedName("genre_ids") val genreIds: List<Int>,
|
@SerializedName("genre_ids") val genreIds: List<Int>,
|
||||||
@SerializedName("id") val id: Int,
|
@SerializedName("id") val id: Int,
|
||||||
@SerializedName("media_type") val mediaType: MediaViewType,
|
@SerializedName("media_type") val mediaType: MediaViewType,
|
||||||
|
|||||||
@@ -2,10 +2,11 @@ package com.owenlejeune.tvtime.api.tmdb.api.v4.model
|
|||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class ListMovie(
|
class ListMovie(
|
||||||
backdropPath: String?,
|
backdropPath: String?,
|
||||||
releaseDate: String,
|
releaseDate: Date?,
|
||||||
genreIds: List<Int>,
|
genreIds: List<Int>,
|
||||||
id: Int,
|
id: Int,
|
||||||
mediaType: MediaViewType,
|
mediaType: MediaViewType,
|
||||||
|
|||||||
@@ -2,10 +2,11 @@ package com.owenlejeune.tvtime.api.tmdb.api.v4.model
|
|||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class ListTv(
|
class ListTv(
|
||||||
backdropPath: String?,
|
backdropPath: String?,
|
||||||
releaseDate: String,
|
releaseDate: Date?,
|
||||||
genreIds: List<Int>,
|
genreIds: List<Int>,
|
||||||
id: Int,
|
id: Int,
|
||||||
mediaType: MediaViewType,
|
mediaType: MediaViewType,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.api.v4.model
|
package com.owenlejeune.tvtime.api.tmdb.api.v4.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
abstract class RatedMedia(
|
abstract class RatedMedia(
|
||||||
var type: RatedType,
|
var type: RatedType,
|
||||||
@@ -10,7 +11,7 @@ abstract class RatedMedia(
|
|||||||
@SerializedName("vote_average") val voteAverage: Float,
|
@SerializedName("vote_average") val voteAverage: Float,
|
||||||
@SerializedName("vote_count") val voteCount: Int,
|
@SerializedName("vote_count") val voteCount: Int,
|
||||||
@SerializedName("account_rating") val rating: AccountRating,
|
@SerializedName("account_rating") val rating: AccountRating,
|
||||||
@SerializedName("release_date", alternate = ["first_air_date", "air_date"]) val releaseDate: String,
|
@SerializedName("release_date", alternate = ["first_air_date", "air_date"]) val releaseDate: Date?,
|
||||||
@SerializedName("backdrop_path") val backdropPath: String?,
|
@SerializedName("backdrop_path") val backdropPath: String?,
|
||||||
@SerializedName("genre_ids") val genreIds: List<Int>,
|
@SerializedName("genre_ids") val genreIds: List<Int>,
|
||||||
@SerializedName("original_language") val originalLanguage: String,
|
@SerializedName("original_language") val originalLanguage: String,
|
||||||
@@ -26,6 +27,6 @@ abstract class RatedMedia(
|
|||||||
|
|
||||||
inner class AccountRating(
|
inner class AccountRating(
|
||||||
@SerializedName("value") val value: Float,
|
@SerializedName("value") val value: Float,
|
||||||
@SerializedName("created_at") val createdAt: String
|
@SerializedName("created_at") val createdAt: Date?
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.api.v4.model
|
package com.owenlejeune.tvtime.api.tmdb.api.v4.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class RatedMovie(
|
class RatedMovie(
|
||||||
id: Int,
|
id: Int,
|
||||||
@@ -15,7 +16,7 @@ class RatedMovie(
|
|||||||
originalName: String,
|
originalName: String,
|
||||||
posterPath: String?,
|
posterPath: String?,
|
||||||
popularity: Float,
|
popularity: Float,
|
||||||
releaseDate: String,
|
releaseDate: Date?,
|
||||||
@SerializedName("adult") val isAdult: Boolean,
|
@SerializedName("adult") val isAdult: Boolean,
|
||||||
@SerializedName("video") val video: Boolean
|
@SerializedName("video") val video: Boolean
|
||||||
): RatedMedia(
|
): RatedMedia(
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.api.v4.model
|
package com.owenlejeune.tvtime.api.tmdb.api.v4.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class RatedTv(
|
class RatedTv(
|
||||||
id: Int,
|
id: Int,
|
||||||
@@ -15,7 +16,7 @@ class RatedTv(
|
|||||||
originalName: String,
|
originalName: String,
|
||||||
posterPath: String?,
|
posterPath: String?,
|
||||||
popularity: Float,
|
popularity: Float,
|
||||||
releaseDate: String,
|
releaseDate: Date?,
|
||||||
@SerializedName("origin_country") val originCountry: List<String>,
|
@SerializedName("origin_country") val originCountry: List<String>,
|
||||||
): RatedMedia(
|
): RatedMedia(
|
||||||
RatedType.SERIES, id, overview, name, voteAverage, voteCount, rating, releaseDate,
|
RatedType.SERIES, id, overview, name, voteAverage, voteCount, rating, releaseDate,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.owenlejeune.tvtime.api.tmdb.api.v4.model
|
|||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
import com.owenlejeune.tvtime.api.tmdb.api.v3.model.TmdbItem
|
import com.owenlejeune.tvtime.api.tmdb.api.v3.model.TmdbItem
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
abstract class RecommendedMedia(
|
abstract class RecommendedMedia(
|
||||||
id: Int,
|
id: Int,
|
||||||
@@ -25,7 +26,7 @@ abstract class RecommendedMedia(
|
|||||||
@SerializedName("popularity")
|
@SerializedName("popularity")
|
||||||
val popularity: Float,
|
val popularity: Float,
|
||||||
@SerializedName("release_date", alternate = ["first_air_date"])
|
@SerializedName("release_date", alternate = ["first_air_date"])
|
||||||
val releaseDate: String,
|
val releaseDate: Date?,
|
||||||
@SerializedName("vote_average")
|
@SerializedName("vote_average")
|
||||||
val voteAverage: Float,
|
val voteAverage: Float,
|
||||||
@SerializedName("vote_count")
|
@SerializedName("vote_count")
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.api.v4.model
|
package com.owenlejeune.tvtime.api.tmdb.api.v4.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class RecommendedMovie (
|
class RecommendedMovie (
|
||||||
id: Int,
|
id: Int,
|
||||||
@@ -14,7 +15,7 @@ class RecommendedMovie (
|
|||||||
mediaType: String,
|
mediaType: String,
|
||||||
genreIds: List<Int>,
|
genreIds: List<Int>,
|
||||||
popularity: Float,
|
popularity: Float,
|
||||||
releaseDate: String,
|
releaseDate: Date?,
|
||||||
voteAverage: Float,
|
voteAverage: Float,
|
||||||
voteCount: Int,
|
voteCount: Int,
|
||||||
@SerializedName("video")
|
@SerializedName("video")
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.api.v4.model
|
package com.owenlejeune.tvtime.api.tmdb.api.v4.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class RecommendedTv(
|
class RecommendedTv(
|
||||||
id: Int,
|
id: Int,
|
||||||
@@ -14,7 +15,7 @@ class RecommendedTv(
|
|||||||
mediaType: String,
|
mediaType: String,
|
||||||
genreIds: List<Int>,
|
genreIds: List<Int>,
|
||||||
popularity: Float,
|
popularity: Float,
|
||||||
releaseDate: String,
|
releaseDate: Date?,
|
||||||
voteAverage: Float,
|
voteAverage: Float,
|
||||||
voteCount: Int,
|
voteCount: Int,
|
||||||
@SerializedName("origin_country")
|
@SerializedName("origin_country")
|
||||||
|
|||||||
@@ -145,12 +145,12 @@ fun PosterItem(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
|
||||||
@Composable
|
@Composable
|
||||||
fun PosterItem(
|
fun PosterItem(
|
||||||
url: String?,
|
url: String?,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
width: Dp = POSTER_WIDTH,
|
width: Dp = POSTER_WIDTH,
|
||||||
|
height: Dp = POSTER_HEIGHT,
|
||||||
onClick: () -> Unit = {},
|
onClick: () -> Unit = {},
|
||||||
enabled: Boolean = true,
|
enabled: Boolean = true,
|
||||||
placeholder: ImageVector = Icons.Filled.Movie,
|
placeholder: ImageVector = Icons.Filled.Movie,
|
||||||
@@ -164,6 +164,7 @@ fun PosterItem(
|
|||||||
elevation = CardDefaults.elevatedCardElevation(defaultElevation = elevation),
|
elevation = CardDefaults.elevatedCardElevation(defaultElevation = elevation),
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.width(width = width)
|
.width(width = width)
|
||||||
|
.height(height = height)
|
||||||
.wrapContentHeight()
|
.wrapContentHeight()
|
||||||
.clickable(
|
.clickable(
|
||||||
enabled = enabled,
|
enabled = enabled,
|
||||||
@@ -176,7 +177,7 @@ fun PosterItem(
|
|||||||
val m = if (backgroundColor == Color.Transparent) {
|
val m = if (backgroundColor == Color.Transparent) {
|
||||||
Modifier.wrapContentHeight()
|
Modifier.wrapContentHeight()
|
||||||
} else {
|
} else {
|
||||||
Modifier.height(POSTER_HEIGHT)
|
Modifier.height(height)
|
||||||
}
|
}
|
||||||
Box(
|
Box(
|
||||||
modifier = m
|
modifier = m
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import com.owenlejeune.tvtime.api.tmdb.api.v4.model.AccountList
|
|||||||
import com.owenlejeune.tvtime.api.tmdb.api.v4.model.RatedMedia
|
import com.owenlejeune.tvtime.api.tmdb.api.v4.model.RatedMedia
|
||||||
import com.owenlejeune.tvtime.api.tmdb.api.v4.model.RatedMovie
|
import com.owenlejeune.tvtime.api.tmdb.api.v4.model.RatedMovie
|
||||||
import com.owenlejeune.tvtime.api.tmdb.api.v4.model.RatedTv
|
import com.owenlejeune.tvtime.api.tmdb.api.v4.model.RatedTv
|
||||||
|
import com.owenlejeune.tvtime.extensions.getCalendarYear
|
||||||
import com.owenlejeune.tvtime.extensions.lazyPagingItems
|
import com.owenlejeune.tvtime.extensions.lazyPagingItems
|
||||||
import com.owenlejeune.tvtime.extensions.unlessEmpty
|
import com.owenlejeune.tvtime.extensions.unlessEmpty
|
||||||
import com.owenlejeune.tvtime.ui.components.AccountIcon
|
import com.owenlejeune.tvtime.ui.components.AccountIcon
|
||||||
@@ -47,6 +48,7 @@ import com.owenlejeune.tvtime.utils.SessionManager
|
|||||||
import com.owenlejeune.tvtime.utils.TmdbUtils
|
import com.owenlejeune.tvtime.utils.TmdbUtils
|
||||||
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
import com.owenlejeune.tvtime.utils.types.MediaViewType
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import java.util.Date
|
||||||
import kotlin.reflect.KClass
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@@ -281,19 +283,23 @@ private fun MediaItemRow(
|
|||||||
mediaViewType: MediaViewType,
|
mediaViewType: MediaViewType,
|
||||||
id: Int,
|
id: Int,
|
||||||
name: String,
|
name: String,
|
||||||
date: String,
|
date: Date?,
|
||||||
description: String,
|
description: String,
|
||||||
posterPath: String? = null,
|
posterPath: String? = null,
|
||||||
backdropPath: String? = null,
|
backdropPath: String? = null,
|
||||||
rating: Float? = null
|
rating: Float? = null
|
||||||
) {
|
) {
|
||||||
|
var title = "$name •"
|
||||||
|
date?.let {
|
||||||
|
title += " (${date.getCalendarYear()})"
|
||||||
|
}
|
||||||
MediaResultCard(
|
MediaResultCard(
|
||||||
appNavController = appNavController,
|
appNavController = appNavController,
|
||||||
mediaViewType = mediaViewType,
|
mediaViewType = mediaViewType,
|
||||||
id = id,
|
id = id,
|
||||||
backdropPath = backdropPath,
|
backdropPath = backdropPath,
|
||||||
posterPath = posterPath,
|
posterPath = posterPath,
|
||||||
title = "$name (${date.split("-")[0]})",
|
title = title,
|
||||||
additionalDetails = listOf(description),
|
additionalDetails = listOf(description),
|
||||||
rating = rating
|
rating = rating
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ private fun MiscMovieDetails(
|
|||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.wrapContentHeight()
|
.wrapContentHeight()
|
||||||
.padding(horizontal = 16.dp),
|
.padding(horizontal = 16.dp),
|
||||||
year = TmdbUtils.getMovieReleaseYear(movie),
|
year = movie.releaseDate?.getCalendarYear()?.toString() ?: "",
|
||||||
runtime = TmdbUtils.convertRuntimeToHoursMinutes(movie),
|
runtime = TmdbUtils.convertRuntimeToHoursMinutes(movie),
|
||||||
genres = movie.genres,
|
genres = movie.genres,
|
||||||
contentRating = contentRating
|
contentRating = contentRating
|
||||||
@@ -673,7 +673,7 @@ private fun SeasonCard(
|
|||||||
|
|
||||||
lastSeason?.let {
|
lastSeason?.let {
|
||||||
ContentCard(
|
ContentCard(
|
||||||
title = "Latest Season"
|
title = stringResource(R.string.latest_season_title)
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
horizontalArrangement = Arrangement.spacedBy(12.dp),
|
horizontalArrangement = Arrangement.spacedBy(12.dp),
|
||||||
@@ -696,7 +696,7 @@ private fun SeasonCard(
|
|||||||
style = MaterialTheme.typography.titleMedium
|
style = MaterialTheme.typography.titleMedium
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
text = "${it.airDate?.getCalendarYear()} | ${it.episodes.size} Episodes"
|
text = stringResource(id = R.string.season_ep_count, it.airDate?.getCalendarYear() ?: 0, it.episodes.size)
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
text = it.overview,
|
text = it.overview,
|
||||||
@@ -715,7 +715,7 @@ private fun SeasonCard(
|
|||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = "See all seasons",
|
text = stringResource(id = R.string.see_all_seasons_text),
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
modifier = Modifier.padding(4.dp)
|
modifier = Modifier.padding(4.dp)
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import com.owenlejeune.tvtime.R
|
|||||||
import com.owenlejeune.tvtime.api.tmdb.api.v3.MoviesService
|
import com.owenlejeune.tvtime.api.tmdb.api.v3.MoviesService
|
||||||
import com.owenlejeune.tvtime.api.tmdb.api.v3.TvService
|
import com.owenlejeune.tvtime.api.tmdb.api.v3.TvService
|
||||||
import com.owenlejeune.tvtime.api.tmdb.api.v3.model.*
|
import com.owenlejeune.tvtime.api.tmdb.api.v3.model.*
|
||||||
|
import com.owenlejeune.tvtime.extensions.getCalendarYear
|
||||||
import com.owenlejeune.tvtime.extensions.lazyPagingItems
|
import com.owenlejeune.tvtime.extensions.lazyPagingItems
|
||||||
import com.owenlejeune.tvtime.ui.components.MediaResultCard
|
import com.owenlejeune.tvtime.ui.components.MediaResultCard
|
||||||
import com.owenlejeune.tvtime.ui.components.SelectableTextChip
|
import com.owenlejeune.tvtime.ui.components.SelectableTextChip
|
||||||
@@ -400,7 +401,7 @@ private fun MovieSearchResultView(
|
|||||||
backdropModel = { TmdbUtils.getFullBackdropPath(result.backdropPath) },
|
backdropModel = { TmdbUtils.getFullBackdropPath(result.backdropPath) },
|
||||||
additionalDetails = {
|
additionalDetails = {
|
||||||
listOf(
|
listOf(
|
||||||
TmdbUtils.releaseYearFromData(result.releaseDate),
|
result.releaseDate?.getCalendarYear()?.toString() ?: "",
|
||||||
cast?.joinToString(separator = ", ") { it.name } ?: ""
|
cast?.joinToString(separator = ", ") { it.name } ?: ""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -429,7 +430,7 @@ private fun TvSearchResultView(
|
|||||||
backdropModel = { TmdbUtils.getFullBackdropPath(result.backdropPath) },
|
backdropModel = { TmdbUtils.getFullBackdropPath(result.backdropPath) },
|
||||||
additionalDetails = {
|
additionalDetails = {
|
||||||
listOf(
|
listOf(
|
||||||
"${TmdbUtils.releaseYearFromData(result.releaseDate)} ${context.getString(R.string.search_result_tv_series)}",
|
"${result.releaseDate?.getCalendarYear() ?: ""} ${context.getString(R.string.search_result_tv_series)}",
|
||||||
cast?.joinToString(separator = ", ") { it.name } ?: ""
|
cast?.joinToString(separator = ", ") { it.name } ?: ""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -445,7 +446,7 @@ private fun PeopleSearchResultView(
|
|||||||
|
|
||||||
val additional = mostKnownFor?.let {
|
val additional = mostKnownFor?.let {
|
||||||
listOf(
|
listOf(
|
||||||
"${mostKnownFor.title} (${TmdbUtils.releaseYearFromData(mostKnownFor.releaseDate)})"
|
"${mostKnownFor.title} (${mostKnownFor.releaseDate?.getCalendarYear()})"
|
||||||
)
|
)
|
||||||
} ?: emptyList()
|
} ?: emptyList()
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.owenlejeune.tvtime.api.tmdb.api.v3.model.Status
|
|||||||
import com.owenlejeune.tvtime.api.tmdb.api.v3.model.TmdbItem
|
import com.owenlejeune.tvtime.api.tmdb.api.v3.model.TmdbItem
|
||||||
import com.owenlejeune.tvtime.api.tmdb.api.v3.model.TvContentRatings
|
import com.owenlejeune.tvtime.api.tmdb.api.v3.model.TvContentRatings
|
||||||
import com.owenlejeune.tvtime.api.tmdb.api.v3.model.Video
|
import com.owenlejeune.tvtime.api.tmdb.api.v3.model.Video
|
||||||
|
import com.owenlejeune.tvtime.extensions.getCalendarYear
|
||||||
import com.owenlejeune.tvtime.ui.viewmodel.ConfigurationViewModel
|
import com.owenlejeune.tvtime.ui.viewmodel.ConfigurationViewModel
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
@@ -93,32 +94,16 @@ object TmdbUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getFullEpisodeStillPath(episode: Episode): String? {
|
|
||||||
return getFullEpisodeStillPath(episode.stillPath)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getMovieReleaseYear(movie: DetailedMovie): String {
|
|
||||||
return movie.releaseDate.split("-")[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getSeriesRun(series: DetailedTv): String {
|
fun getSeriesRun(series: DetailedTv): String {
|
||||||
val startYear = getTvStartYear(series)
|
val startYear = series.firstAirDate?.getCalendarYear() ?: ""
|
||||||
val endYear = if (series.status == Status.ACTIVE) {
|
val endYear = if (series.status == Status.ACTIVE) {
|
||||||
getTvEndYear(series)
|
series.lastAirDate?.getCalendarYear() ?: ""
|
||||||
} else {
|
} else {
|
||||||
""
|
""
|
||||||
}
|
}
|
||||||
return "${startYear}-${endYear}"
|
return "${startYear}-${endYear}"
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getTvStartYear(series: DetailedTv): String {
|
|
||||||
return series.firstAirDate.split("-")[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getTvEndYear(series: DetailedTv): String {
|
|
||||||
return series.lastAirDate.split("-")[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
fun convertRuntimeToHoursMinutes(movie: DetailedMovie): String {
|
fun convertRuntimeToHoursMinutes(movie: DetailedMovie): String {
|
||||||
movie.runtime?.let { runtime ->
|
movie.runtime?.let { runtime ->
|
||||||
return convertRuntimeToHoursAndMinutes(runtime)
|
return convertRuntimeToHoursAndMinutes(runtime)
|
||||||
@@ -197,12 +182,12 @@ object TmdbUtils {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
fun formatDate(inDate: String): String {
|
fun formatDate(inDate: Date?): String {
|
||||||
val orig = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", java.util.Locale.US)
|
if (inDate == null) {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
val formatter = SimpleDateFormat("yyyy-MM-dd HH:mm", java.util.Locale.US)
|
val formatter = SimpleDateFormat("yyyy-MM-dd HH:mm", java.util.Locale.US)
|
||||||
|
return formatter.format(inDate)
|
||||||
val date = orig.parse(inDate)//.replace("Z", "+0000"))
|
|
||||||
return formatter.format(date)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getAccountGravatarUrl(accountDetails: AccountDetails): String {
|
fun getAccountGravatarUrl(accountDetails: AccountDetails): String {
|
||||||
@@ -219,13 +204,6 @@ object TmdbUtils {
|
|||||||
return IMAGE_BASE.plus(LOGO_SIZE).plus(path)
|
return IMAGE_BASE.plus(LOGO_SIZE).plus(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun releaseYearFromData(releaseDate: String): String {
|
|
||||||
if (releaseDate.length >=4) {
|
|
||||||
return releaseDate.split("-").first { it.length == 4 }
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
fun formatRevenue(revenue: Long): String {
|
fun formatRevenue(revenue: Long): String {
|
||||||
val decFormat = "%.1f"
|
val decFormat = "%.1f"
|
||||||
val thousands = revenue.toFloat() / 1000f
|
val thousands = revenue.toFloat() / 1000f
|
||||||
|
|||||||
@@ -238,4 +238,7 @@
|
|||||||
<string name="cast_tv_character_template">as %1$s (%2$d eps.)</string>
|
<string name="cast_tv_character_template">as %1$s (%2$d eps.)</string>
|
||||||
<string name="crew_template">… %1$s</string>
|
<string name="crew_template">… %1$s</string>
|
||||||
<string name="images_title">Images</string>
|
<string name="images_title">Images</string>
|
||||||
|
<string name="latest_season_title">Latest Season</string>
|
||||||
|
<string name="season_ep_count">%1$d | %2$d Episodes</string>
|
||||||
|
<string name="see_all_seasons_text">See all seasons</string>
|
||||||
</resources>
|
</resources>
|
||||||
Reference in New Issue
Block a user