Add TMDB localization updates

This commit is contained in:
tapframe 2026-04-26 00:46:54 +05:30
parent b5b5554f47
commit acf76f30c4
3 changed files with 473 additions and 104 deletions

View file

@ -90,6 +90,9 @@
<string name="collections_editor_select_catalogs_description">Elige los catálogos del complemento que debe agrupar esta carpeta.</string>
<string name="collections_editor_select_catalogs">Seleccionar catálogos</string>
<string name="collections_editor_select_genre">Seleccionar género</string>
<string name="collections_editor_selected_count">%1$d seleccionados</string>
<string name="collections_editor_catalog_count">%1$d catálogos</string>
<string name="collections_editor_catalog_selected_count">%1$d seleccionados</string>
<string name="collections_editor_shape_poster">Póster</string>
<string name="collections_editor_shape_square">Cuadrado</string>
<string name="collections_editor_shape_wide">Panorámico</string>
@ -102,6 +105,121 @@
<string name="collections_editor_view_mode_rows">Filas</string>
<string name="collections_editor_view_mode_tabs">Pestañas</string>
<string name="collections_editor_view_mode">Modo de vista</string>
<string name="collections_editor_tmdb_sources">Fuentes de TMDB</string>
<string name="collections_editor_tmdb_public_list_mode">Lista pública</string>
<string name="collections_editor_tmdb_production_mode">Producción</string>
<string name="collections_editor_tmdb_network_mode">Cadena</string>
<string name="collections_editor_tmdb_collection_mode">Colección</string>
<string name="collections_editor_tmdb_custom_mode">Personalizado</string>
<string name="collections_editor_tmdb_help_presets">Elige una fuente preparada. Puedes editarla o quitarla después de añadirla.</string>
<string name="collections_editor_tmdb_help_list">Pega una URL de lista pública de TMDB o solo el número de la URL.</string>
<string name="collections_editor_tmdb_help_production">Busca por nombre de estudio, o pega un ID/URL de compañía de TMDB y añádelo directamente.</string>
<string name="collections_editor_tmdb_help_network">Introduce un ID de cadena. Las cadenas comunes están disponibles en ajustes predefinidos y filtros rápidos.</string>
<string name="collections_editor_tmdb_help_collection">Busca el nombre de una colección de películas o pega el ID de colección de TMDB.</string>
<string name="collections_editor_tmdb_help_discover">Crea una fila dinámica de TMDB con filtros opcionales. Deja los campos vacíos cuando no necesites ese filtro.</string>
<string name="collections_editor_tmdb_public_list">Lista pública de TMDB</string>
<string name="collections_editor_tmdb_network_id">ID de cadena</string>
<string name="collections_editor_tmdb_collection_id">ID de colección</string>
<string name="collections_editor_tmdb_company_search">Nombre, ID o URL de compañía de producción</string>
<string name="collections_editor_tmdb_id_or_url">ID o URL de TMDB</string>
<string name="collections_editor_tmdb_list_placeholder">https://www.themoviedb.org/list/8504994 o 8504994</string>
<string name="collections_editor_tmdb_network_placeholder">213 para Netflix, 49 para HBO, 2739 para Disney+</string>
<string name="collections_editor_tmdb_collection_placeholder">10 para Star Wars Collection</string>
<string name="collections_editor_tmdb_company_placeholder">Marvel Studios, 420 o URL de compañía</string>
<string name="collections_editor_tmdb_search_helper">Ejemplos: Marvel Studios, 420 o https://www.themoviedb.org/company/420.</string>
<string name="collections_editor_tmdb_collection_helper">Ejemplo: Star Wars Collection, Harry Potter Collection o una URL de colección.</string>
<string name="collections_editor_tmdb_network_helper">IDs de ejemplo: Netflix 213, HBO 49, Disney+ 2739.</string>
<string name="collections_editor_tmdb_list_helper">Ejemplo: https://www.themoviedb.org/list/8504994 o 8504994.</string>
<string name="collections_editor_tmdb_display_title">Título visible</string>
<string name="collections_editor_tmdb_title_helper">Se muestra como nombre de fila/pestaña. Si queda vacío, Nuvio crea uno desde la fuente.</string>
<string name="collections_editor_tmdb_title_placeholder">Películas de Marvel, Originales de Netflix, Pixar</string>
<string name="collections_editor_tmdb_discover_title_placeholder">Mejores películas de acción, dramas coreanos, animación 2024</string>
<string name="collections_editor_tmdb_search_results">Resultados de búsqueda</string>
<string name="collections_editor_tmdb_collection">Colección de TMDB</string>
<string name="collections_editor_tmdb_company_fallback">Compañía de TMDB %1$d</string>
<string name="collections_editor_tmdb_collection_fallback">Colección de TMDB %1$d</string>
<string name="collections_editor_tmdb_type">Tipo</string>
<string name="collections_editor_tmdb_movies">Películas</string>
<string name="collections_editor_tmdb_series">Series</string>
<string name="collections_editor_tmdb_both">Ambos</string>
<string name="collections_editor_tmdb_sort">Orden</string>
<string name="collections_editor_tmdb_filters">Filtros</string>
<string name="collections_editor_tmdb_filters_helper">Deja los campos vacíos cuando no necesites ese filtro.</string>
<string name="collections_editor_tmdb_quick_genres">Géneros rápidos</string>
<string name="collections_editor_tmdb_quick_languages">Idiomas rápidos</string>
<string name="collections_editor_tmdb_quick_countries">Países rápidos</string>
<string name="collections_editor_tmdb_quick_keywords">Palabras clave rápidas</string>
<string name="collections_editor_tmdb_quick_studios">Estudios rápidos</string>
<string name="collections_editor_tmdb_quick_networks">Cadenas rápidas</string>
<string name="collections_editor_tmdb_genres">IDs de género</string>
<string name="collections_editor_tmdb_genres_helper">Usa números de género de TMDB. Separa varios con comas para AND, o barras verticales para OR.</string>
<string name="collections_editor_tmdb_date_from">Fecha de estreno o emisión desde</string>
<string name="collections_editor_tmdb_date_to">Fecha de estreno o emisión hasta</string>
<string name="collections_editor_tmdb_date_helper">Usa YYYY-MM-DD, por ejemplo 2024-01-01.</string>
<string name="collections_editor_tmdb_rating_min">Calificación mínima</string>
<string name="collections_editor_tmdb_rating_max">Calificación máxima</string>
<string name="collections_editor_tmdb_rating_helper">Calificación de TMDB de 0 a 10. Ejemplo: 7.0.</string>
<string name="collections_editor_tmdb_votes_min">Votos mínimos</string>
<string name="collections_editor_tmdb_votes_helper">Úsalo para evitar títulos poco conocidos con pocos votos. Ejemplo: 100.</string>
<string name="collections_editor_tmdb_language">Idioma original</string>
<string name="collections_editor_tmdb_language_helper">Usa códigos de idioma de dos letras, por ejemplo en, ko, ja, hi.</string>
<string name="collections_editor_tmdb_country">País de origen</string>
<string name="collections_editor_tmdb_country_helper">Usa códigos de país de dos letras, por ejemplo US, KR, JP, IN.</string>
<string name="collections_editor_tmdb_keywords">IDs de palabra clave</string>
<string name="collections_editor_tmdb_keywords_helper">Usa números de palabra clave de TMDB. Los chips rápidos rellenan ejemplos comunes.</string>
<string name="collections_editor_tmdb_keywords_placeholder">9715 para superhéroes</string>
<string name="collections_editor_tmdb_companies">IDs de compañía</string>
<string name="collections_editor_tmdb_companies_helper">Usa IDs de estudio/compañía. Los chips rápidos rellenan ejemplos comunes.</string>
<string name="collections_editor_tmdb_companies_placeholder">420 para Marvel Studios</string>
<string name="collections_editor_tmdb_networks">IDs de cadena</string>
<string name="collections_editor_tmdb_networks_helper">Solo para series. Usa IDs de cadena como Netflix 213 o HBO 49.</string>
<string name="collections_editor_tmdb_networks_placeholder">213 para Netflix</string>
<string name="collections_editor_tmdb_year">Año</string>
<string name="collections_editor_tmdb_year_helper">Usa un año de cuatro dígitos, por ejemplo 2024.</string>
<string name="collections_editor_tmdb_presets">Predefinidos</string>
<string name="collections_editor_tmdb_search">Buscar</string>
<string name="collections_editor_add_source">Añadir fuente</string>
<string name="collections_editor_tmdb_genre_action">Acción</string>
<string name="collections_editor_tmdb_genre_adventure">Aventura</string>
<string name="collections_editor_tmdb_genre_animation">Animación</string>
<string name="collections_editor_tmdb_genre_comedy">Comedia</string>
<string name="collections_editor_tmdb_genre_horror">Terror</string>
<string name="collections_editor_tmdb_genre_scifi">Ciencia ficción</string>
<string name="collections_editor_tmdb_genre_drama">Drama</string>
<string name="collections_editor_tmdb_genre_crime">Crimen</string>
<string name="collections_editor_tmdb_genre_reality">Reality</string>
<string name="collections_editor_tmdb_language_english">Inglés</string>
<string name="collections_editor_tmdb_language_korean">Coreano</string>
<string name="collections_editor_tmdb_language_japanese">Japonés</string>
<string name="collections_editor_tmdb_language_hindi">Hindi</string>
<string name="collections_editor_tmdb_language_spanish">Español</string>
<string name="collections_editor_tmdb_country_us">Estados Unidos</string>
<string name="collections_editor_tmdb_country_korea">Corea</string>
<string name="collections_editor_tmdb_country_japan">Japón</string>
<string name="collections_editor_tmdb_country_india">India</string>
<string name="collections_editor_tmdb_country_uk">Reino Unido</string>
<string name="collections_editor_tmdb_keyword_superhero">Superhéroes</string>
<string name="collections_editor_tmdb_keyword_based_on_novel">Basado en novela</string>
<string name="collections_editor_tmdb_keyword_time_travel">Viaje en el tiempo</string>
<string name="collections_editor_tmdb_keyword_space">Espacio</string>
<string name="collections_editor_tmdb_studio_marvel">Marvel</string>
<string name="collections_editor_tmdb_studio_disney">Disney</string>
<string name="collections_editor_tmdb_studio_pixar">Pixar</string>
<string name="collections_editor_tmdb_studio_lucasfilm">Lucasfilm</string>
<string name="collections_editor_tmdb_studio_warner">Warner Bros.</string>
<string name="collections_editor_tmdb_network_netflix">Netflix</string>
<string name="collections_editor_tmdb_network_hbo">HBO</string>
<string name="collections_editor_tmdb_network_disney_plus">Disney+</string>
<string name="collections_editor_tmdb_network_prime_video">Prime Video</string>
<string name="collections_editor_tmdb_network_hulu">Hulu</string>
<string name="collections_editor_tmdb_sort_popular">Popular</string>
<string name="collections_editor_tmdb_sort_top_rated">Mejor valoradas</string>
<string name="collections_editor_tmdb_sort_recent">Reciente</string>
<string name="collections_editor_tmdb_subtitle_list">Lista de TMDB</string>
<string name="collections_editor_tmdb_subtitle_movie_collection">Colección de películas de TMDB</string>
<string name="collections_editor_tmdb_subtitle_production">Producción</string>
<string name="collections_editor_tmdb_subtitle_network">Cadena</string>
<string name="collections_editor_tmdb_subtitle_discover">Discover de TMDB</string>
<string name="collections_empty_subtitle">Crea una para organizar tus catálogos.</string>
<string name="collections_empty_title">Aún no hay colecciones</string>
<string name="collections_folder_count">%1$d carpeta(s)</string>

View file

@ -90,6 +90,9 @@
<string name="collections_editor_select_catalogs_description">Choose the addon catalogs this folder should aggregate.</string>
<string name="collections_editor_select_catalogs">Select Catalogs</string>
<string name="collections_editor_select_genre">Select genre</string>
<string name="collections_editor_selected_count">%1$d selected</string>
<string name="collections_editor_catalog_count">%1$d catalogs</string>
<string name="collections_editor_catalog_selected_count">%1$d selected</string>
<string name="collections_editor_shape_poster">Poster</string>
<string name="collections_editor_shape_square">Square</string>
<string name="collections_editor_shape_wide">Wide</string>
@ -102,6 +105,121 @@
<string name="collections_editor_view_mode_rows">Rows</string>
<string name="collections_editor_view_mode_tabs">Tabs</string>
<string name="collections_editor_view_mode">View Mode</string>
<string name="collections_editor_tmdb_sources">TMDB Sources</string>
<string name="collections_editor_tmdb_public_list_mode">Public List</string>
<string name="collections_editor_tmdb_production_mode">Production</string>
<string name="collections_editor_tmdb_network_mode">Network</string>
<string name="collections_editor_tmdb_collection_mode">Collection</string>
<string name="collections_editor_tmdb_custom_mode">Custom</string>
<string name="collections_editor_tmdb_help_presets">Pick a ready-made source. You can edit or remove it after adding.</string>
<string name="collections_editor_tmdb_help_list">Paste a public TMDB list URL or only the number from the URL.</string>
<string name="collections_editor_tmdb_help_production">Search by studio name, or paste a TMDB company ID/URL and add it directly.</string>
<string name="collections_editor_tmdb_help_network">Enter a network ID. Common networks are available in Presets and quick filters.</string>
<string name="collections_editor_tmdb_help_collection">Search a movie collection name or paste the collection ID from TMDB.</string>
<string name="collections_editor_tmdb_help_discover">Build a live TMDB row using optional filters. Leave fields empty when you do not need that filter.</string>
<string name="collections_editor_tmdb_public_list">Public TMDB list</string>
<string name="collections_editor_tmdb_network_id">Network ID</string>
<string name="collections_editor_tmdb_collection_id">Collection ID</string>
<string name="collections_editor_tmdb_company_search">Production company name, ID, or URL</string>
<string name="collections_editor_tmdb_id_or_url">TMDB ID or URL</string>
<string name="collections_editor_tmdb_list_placeholder">https://www.themoviedb.org/list/8504994 or 8504994</string>
<string name="collections_editor_tmdb_network_placeholder">213 for Netflix, 49 for HBO, 2739 for Disney+</string>
<string name="collections_editor_tmdb_collection_placeholder">10 for Star Wars Collection</string>
<string name="collections_editor_tmdb_company_placeholder">Marvel Studios, 420, or company URL</string>
<string name="collections_editor_tmdb_search_helper">Examples: Marvel Studios, 420, or https://www.themoviedb.org/company/420.</string>
<string name="collections_editor_tmdb_collection_helper">Example: Star Wars Collection, Harry Potter Collection, or a collection URL.</string>
<string name="collections_editor_tmdb_network_helper">Example IDs: Netflix 213, HBO 49, Disney+ 2739.</string>
<string name="collections_editor_tmdb_list_helper">Example: https://www.themoviedb.org/list/8504994 or 8504994.</string>
<string name="collections_editor_tmdb_display_title">Display title</string>
<string name="collections_editor_tmdb_title_helper">Shown as the row/tab name. If blank, Nuvio creates one from the source.</string>
<string name="collections_editor_tmdb_title_placeholder">Marvel Movies, Netflix Originals, Pixar</string>
<string name="collections_editor_tmdb_discover_title_placeholder">Best Action Movies, Korean Dramas, 2024 Animation</string>
<string name="collections_editor_tmdb_search_results">Search Results</string>
<string name="collections_editor_tmdb_collection">TMDB Collection</string>
<string name="collections_editor_tmdb_company_fallback">TMDB Company %1$d</string>
<string name="collections_editor_tmdb_collection_fallback">TMDB Collection %1$d</string>
<string name="collections_editor_tmdb_type">Type</string>
<string name="collections_editor_tmdb_movies">Movies</string>
<string name="collections_editor_tmdb_series">Series</string>
<string name="collections_editor_tmdb_both">Both</string>
<string name="collections_editor_tmdb_sort">Sort</string>
<string name="collections_editor_tmdb_filters">Filters</string>
<string name="collections_editor_tmdb_filters_helper">Leave fields empty when you do not need that filter.</string>
<string name="collections_editor_tmdb_quick_genres">Quick genres</string>
<string name="collections_editor_tmdb_quick_languages">Quick languages</string>
<string name="collections_editor_tmdb_quick_countries">Quick countries</string>
<string name="collections_editor_tmdb_quick_keywords">Quick keywords</string>
<string name="collections_editor_tmdb_quick_studios">Quick studios</string>
<string name="collections_editor_tmdb_quick_networks">Quick networks</string>
<string name="collections_editor_tmdb_genres">Genre IDs</string>
<string name="collections_editor_tmdb_genres_helper">Use TMDB genre numbers. Separate multiple with commas for AND, or pipes for OR.</string>
<string name="collections_editor_tmdb_date_from">Release or air date from</string>
<string name="collections_editor_tmdb_date_to">Release or air date to</string>
<string name="collections_editor_tmdb_date_helper">Use YYYY-MM-DD, for example 2024-01-01.</string>
<string name="collections_editor_tmdb_rating_min">Minimum rating</string>
<string name="collections_editor_tmdb_rating_max">Maximum rating</string>
<string name="collections_editor_tmdb_rating_helper">TMDB rating from 0 to 10. Example: 7.0.</string>
<string name="collections_editor_tmdb_votes_min">Minimum votes</string>
<string name="collections_editor_tmdb_votes_helper">Use this to avoid obscure low-vote titles. Example: 100.</string>
<string name="collections_editor_tmdb_language">Original language</string>
<string name="collections_editor_tmdb_language_helper">Use two-letter language codes, for example en, ko, ja, hi.</string>
<string name="collections_editor_tmdb_country">Origin country</string>
<string name="collections_editor_tmdb_country_helper">Use two-letter country codes, for example US, KR, JP, IN.</string>
<string name="collections_editor_tmdb_keywords">Keyword IDs</string>
<string name="collections_editor_tmdb_keywords_helper">Use TMDB keyword numbers. Quick chips fill common examples.</string>
<string name="collections_editor_tmdb_keywords_placeholder">9715 for superhero</string>
<string name="collections_editor_tmdb_companies">Company IDs</string>
<string name="collections_editor_tmdb_companies_helper">Use studio/company IDs. Quick chips fill common examples.</string>
<string name="collections_editor_tmdb_companies_placeholder">420 for Marvel Studios</string>
<string name="collections_editor_tmdb_networks">Network IDs</string>
<string name="collections_editor_tmdb_networks_helper">For series only. Use network IDs like Netflix 213 or HBO 49.</string>
<string name="collections_editor_tmdb_networks_placeholder">213 for Netflix</string>
<string name="collections_editor_tmdb_year">Year</string>
<string name="collections_editor_tmdb_year_helper">Use a four-digit year, for example 2024.</string>
<string name="collections_editor_tmdb_presets">Presets</string>
<string name="collections_editor_tmdb_search">Search</string>
<string name="collections_editor_add_source">Add Source</string>
<string name="collections_editor_tmdb_genre_action">Action</string>
<string name="collections_editor_tmdb_genre_adventure">Adventure</string>
<string name="collections_editor_tmdb_genre_animation">Animation</string>
<string name="collections_editor_tmdb_genre_comedy">Comedy</string>
<string name="collections_editor_tmdb_genre_horror">Horror</string>
<string name="collections_editor_tmdb_genre_scifi">Sci-Fi</string>
<string name="collections_editor_tmdb_genre_drama">Drama</string>
<string name="collections_editor_tmdb_genre_crime">Crime</string>
<string name="collections_editor_tmdb_genre_reality">Reality</string>
<string name="collections_editor_tmdb_language_english">English</string>
<string name="collections_editor_tmdb_language_korean">Korean</string>
<string name="collections_editor_tmdb_language_japanese">Japanese</string>
<string name="collections_editor_tmdb_language_hindi">Hindi</string>
<string name="collections_editor_tmdb_language_spanish">Spanish</string>
<string name="collections_editor_tmdb_country_us">United States</string>
<string name="collections_editor_tmdb_country_korea">Korea</string>
<string name="collections_editor_tmdb_country_japan">Japan</string>
<string name="collections_editor_tmdb_country_india">India</string>
<string name="collections_editor_tmdb_country_uk">United Kingdom</string>
<string name="collections_editor_tmdb_keyword_superhero">Superhero</string>
<string name="collections_editor_tmdb_keyword_based_on_novel">Based on Novel</string>
<string name="collections_editor_tmdb_keyword_time_travel">Time Travel</string>
<string name="collections_editor_tmdb_keyword_space">Space</string>
<string name="collections_editor_tmdb_studio_marvel">Marvel</string>
<string name="collections_editor_tmdb_studio_disney">Disney</string>
<string name="collections_editor_tmdb_studio_pixar">Pixar</string>
<string name="collections_editor_tmdb_studio_lucasfilm">Lucasfilm</string>
<string name="collections_editor_tmdb_studio_warner">Warner Bros.</string>
<string name="collections_editor_tmdb_network_netflix">Netflix</string>
<string name="collections_editor_tmdb_network_hbo">HBO</string>
<string name="collections_editor_tmdb_network_disney_plus">Disney+</string>
<string name="collections_editor_tmdb_network_prime_video">Prime Video</string>
<string name="collections_editor_tmdb_network_hulu">Hulu</string>
<string name="collections_editor_tmdb_sort_popular">Popular</string>
<string name="collections_editor_tmdb_sort_top_rated">Top Rated</string>
<string name="collections_editor_tmdb_sort_recent">Recent</string>
<string name="collections_editor_tmdb_subtitle_list">TMDB List</string>
<string name="collections_editor_tmdb_subtitle_movie_collection">TMDB Movie Collection</string>
<string name="collections_editor_tmdb_subtitle_production">Production</string>
<string name="collections_editor_tmdb_subtitle_network">Network</string>
<string name="collections_editor_tmdb_subtitle_discover">TMDB Discover</string>
<string name="collections_empty_subtitle">Create one to organize your catalogs.</string>
<string name="collections_empty_title">No collections yet</string>
<string name="collections_folder_count">%1$d folder(s)</string>

View file

@ -714,7 +714,7 @@ private fun FolderEditorPage(
modifier = Modifier.size(18.dp),
)
Spacer(modifier = Modifier.width(4.dp))
Text("TMDB")
Text(stringResource(Res.string.source_tmdb))
}
TextButton(onClick = { CollectionEditorRepository.showCatalogPicker() }) {
Icon(
@ -829,7 +829,7 @@ private fun CatalogPickerScreen(
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
Text(
text = "${selectedSources.size} selected",
text = stringResource(Res.string.collections_editor_selected_count, selectedSources.size),
style = MaterialTheme.typography.bodyMedium,
fontWeight = FontWeight.SemiBold,
color = MaterialTheme.colorScheme.primary,
@ -850,7 +850,11 @@ private fun CatalogPickerScreen(
}
PickerPanel(
title = addonName,
subtitle = if (selectedCount > 0) "$selectedCount selected" else "${catalogs.size} catalogs",
subtitle = if (selectedCount > 0) {
stringResource(Res.string.collections_editor_catalog_selected_count, selectedCount)
} else {
stringResource(Res.string.collections_editor_catalog_count, catalogs.size)
},
) {
catalogs.forEachIndexed { index, catalog ->
val isSelected = selectedSources.any {
@ -896,6 +900,12 @@ private fun TmdbSourcePickerScreen(
TmdbBuilderMode.DISCOVER -> TmdbCollectionSourceType.DISCOVER
}
val requiresId = sourceType != TmdbCollectionSourceType.DISCOVER
val showMediaControls = state.tmdbBuilderMode == TmdbBuilderMode.PRODUCTION ||
state.tmdbBuilderMode == TmdbBuilderMode.DISCOVER
val showSortControls = state.tmdbBuilderMode == TmdbBuilderMode.PRODUCTION ||
state.tmdbBuilderMode == TmdbBuilderMode.NETWORK ||
state.tmdbBuilderMode == TmdbBuilderMode.DISCOVER
val showFilterControls = state.tmdbBuilderMode == TmdbBuilderMode.DISCOVER
PlatformBackHandler(enabled = true) {
onBack()
@ -905,7 +915,7 @@ private fun TmdbSourcePickerScreen(
NuvioScreen(modifier = Modifier.fillMaxSize()) {
stickyHeader {
NuvioScreenHeader(
title = "TMDB Sources",
title = stringResource(Res.string.collections_editor_tmdb_sources),
onBack = onBack,
)
}
@ -957,11 +967,11 @@ private fun TmdbSourcePickerScreen(
)
}
TmdbLabeledField(
label = "Display title",
label = stringResource(Res.string.collections_editor_tmdb_display_title),
value = state.tmdbTitleInput,
onValueChange = { CollectionEditorRepository.setTmdbTitleInput(it) },
placeholder = tmdbTitlePlaceholder(state.tmdbBuilderMode),
helper = "Shown as the row/tab name. If blank, Nuvio creates one from the source.",
helper = stringResource(Res.string.collections_editor_tmdb_title_helper),
)
if (state.tmdbSearchError != null) {
Text(
@ -976,20 +986,25 @@ private fun TmdbSourcePickerScreen(
if (state.tmdbBuilderMode == TmdbBuilderMode.PRODUCTION && state.tmdbCompanyResults.isNotEmpty()) {
item {
PickerSectionLabel("Search Results")
PickerSectionLabel(stringResource(Res.string.collections_editor_tmdb_search_results))
}
itemsIndexed(state.tmdbCompanyResults) { _, result ->
val title = result.name ?: "TMDB Company ${result.id}"
val title = result.name ?: stringResource(Res.string.collections_editor_tmdb_company_fallback, result.id)
val movieSuffix = stringResource(Res.string.collections_editor_tmdb_movies)
val seriesSuffix = stringResource(Res.string.collections_editor_tmdb_series)
PickerOptionRow(
title = title,
subtitle = listOfNotNull("Production", result.originCountry).joinToString(""),
subtitle = listOfNotNull(
stringResource(Res.string.collections_editor_tmdb_subtitle_production),
result.originCountry,
).joinToString(""),
selected = false,
onClick = {
val sources = tmdbSelectedMediaTypes(state).map { mediaType ->
CollectionSource(
provider = "tmdb",
tmdbSourceType = TmdbCollectionSourceType.COMPANY.name,
title = tmdbTitleForMedia(title, mediaType, state.tmdbMediaBoth),
title = tmdbTitleForMedia(title, mediaType, state.tmdbMediaBoth, movieSuffix, seriesSuffix),
tmdbId = result.id,
mediaType = mediaType.name,
sortBy = state.tmdbSortBy,
@ -1004,13 +1019,13 @@ private fun TmdbSourcePickerScreen(
if (state.tmdbBuilderMode == TmdbBuilderMode.COLLECTION && state.tmdbCollectionResults.isNotEmpty()) {
item {
PickerSectionLabel("Search Results")
PickerSectionLabel(stringResource(Res.string.collections_editor_tmdb_search_results))
}
itemsIndexed(state.tmdbCollectionResults) { _, result ->
val title = result.name ?: "TMDB Collection ${result.id}"
val title = result.name ?: stringResource(Res.string.collections_editor_tmdb_collection_fallback, result.id)
PickerOptionRow(
title = title,
subtitle = "TMDB Movie Collection",
subtitle = stringResource(Res.string.collections_editor_tmdb_collection),
selected = false,
onClick = {
CollectionEditorRepository.addTmdbSource(
@ -1028,11 +1043,10 @@ private fun TmdbSourcePickerScreen(
}
}
if (sourceType == TmdbCollectionSourceType.COMPANY || sourceType == TmdbCollectionSourceType.DISCOVER) {
if (showMediaControls) {
item {
PickerPanel(
title = "Media",
subtitle = "Create one source or split it into movie and series feeds.",
title = stringResource(Res.string.collections_editor_tmdb_type),
) {
FlowRow(
horizontalArrangement = Arrangement.spacedBy(8.dp),
@ -1044,7 +1058,7 @@ private fun TmdbSourcePickerScreen(
CollectionEditorRepository.setTmdbMediaBoth(false)
CollectionEditorRepository.setTmdbMediaType(TmdbCollectionMediaType.MOVIE)
},
label = { Text("Movies") },
label = { Text(stringResource(Res.string.collections_editor_tmdb_movies)) },
)
FilterChip(
selected = state.tmdbMediaType == TmdbCollectionMediaType.TV && !state.tmdbMediaBoth,
@ -1052,26 +1066,22 @@ private fun TmdbSourcePickerScreen(
CollectionEditorRepository.setTmdbMediaBoth(false)
CollectionEditorRepository.setTmdbMediaType(TmdbCollectionMediaType.TV)
},
label = { Text("Series") },
label = { Text(stringResource(Res.string.collections_editor_tmdb_series)) },
)
FilterChip(
selected = state.tmdbMediaBoth,
onClick = { CollectionEditorRepository.setTmdbMediaBoth(true) },
label = { Text("Both") },
label = { Text(stringResource(Res.string.collections_editor_tmdb_both)) },
)
}
}
}
}
if (sourceType == TmdbCollectionSourceType.COMPANY ||
sourceType == TmdbCollectionSourceType.NETWORK ||
sourceType == TmdbCollectionSourceType.DISCOVER
) {
if (showSortControls) {
item {
PickerPanel(
title = "Sort",
subtitle = "Controls the default order TMDB returns.",
title = stringResource(Res.string.collections_editor_tmdb_sort),
) {
FlowRow(
horizontalArrangement = Arrangement.spacedBy(8.dp),
@ -1096,23 +1106,27 @@ private fun TmdbSourcePickerScreen(
}
}
}
}
if (showFilterControls) {
item {
PickerPanel(
title = "Filters",
subtitle = "Combine TMDB IDs and date/rating constraints for exact feeds.",
title = stringResource(Res.string.collections_editor_tmdb_filters),
subtitle = stringResource(Res.string.collections_editor_tmdb_filters_helper),
) {
Column(verticalArrangement = Arrangement.spacedBy(10.dp)) {
TmdbQuickChips(
label = "Quick genres",
label = stringResource(Res.string.collections_editor_tmdb_quick_genres),
chips = tmdbGenreQuickChips(state.tmdbMediaType),
onSelect = { value ->
CollectionEditorRepository.updateTmdbFilters { it.copy(withGenres = value) }
},
)
TmdbFilterField(
label = stringResource(Res.string.collections_editor_tmdb_genres),
helper = stringResource(Res.string.collections_editor_tmdb_genres_helper),
value = state.tmdbFilters.withGenres.orEmpty(),
placeholder = "Genre IDs, comma-separated",
placeholder = if (state.tmdbMediaType == TmdbCollectionMediaType.MOVIE) "28,12" else "18,35",
onValueChange = { value ->
CollectionEditorRepository.updateTmdbFilters {
it.copy(withGenres = value.ifBlank { null })
@ -1120,17 +1134,10 @@ private fun TmdbSourcePickerScreen(
},
)
TmdbFilterField(
value = state.tmdbFilters.year?.toString().orEmpty(),
placeholder = "Year",
onValueChange = { value ->
CollectionEditorRepository.updateTmdbFilters {
it.copy(year = value.toIntOrNull())
}
},
)
TmdbFilterField(
label = stringResource(Res.string.collections_editor_tmdb_date_from),
helper = stringResource(Res.string.collections_editor_tmdb_date_helper),
value = state.tmdbFilters.releaseDateGte.orEmpty(),
placeholder = "Release from YYYY-MM-DD",
placeholder = "2020-01-01",
onValueChange = { value ->
CollectionEditorRepository.updateTmdbFilters {
it.copy(releaseDateGte = value.ifBlank { null })
@ -1138,8 +1145,10 @@ private fun TmdbSourcePickerScreen(
},
)
TmdbFilterField(
label = stringResource(Res.string.collections_editor_tmdb_date_to),
helper = stringResource(Res.string.collections_editor_tmdb_date_helper),
value = state.tmdbFilters.releaseDateLte.orEmpty(),
placeholder = "Release until YYYY-MM-DD",
placeholder = "2024-12-31",
onValueChange = { value ->
CollectionEditorRepository.updateTmdbFilters {
it.copy(releaseDateLte = value.ifBlank { null })
@ -1147,8 +1156,10 @@ private fun TmdbSourcePickerScreen(
},
)
TmdbFilterField(
label = stringResource(Res.string.collections_editor_tmdb_rating_min),
helper = stringResource(Res.string.collections_editor_tmdb_rating_helper),
value = state.tmdbFilters.voteAverageGte?.toString().orEmpty(),
placeholder = "Minimum rating",
placeholder = "7.0",
onValueChange = { value ->
CollectionEditorRepository.updateTmdbFilters {
it.copy(voteAverageGte = value.toDoubleOrNull())
@ -1156,33 +1167,45 @@ private fun TmdbSourcePickerScreen(
},
)
TmdbFilterField(
value = state.tmdbFilters.voteCountGte?.toString().orEmpty(),
placeholder = "Minimum vote count",
onValueChange = { value ->
CollectionEditorRepository.updateTmdbFilters {
it.copy(voteCountGte = value.toIntOrNull())
}
},
)
TmdbFilterField(
label = stringResource(Res.string.collections_editor_tmdb_rating_max),
helper = stringResource(Res.string.collections_editor_tmdb_rating_helper),
value = state.tmdbFilters.voteAverageLte?.toString().orEmpty(),
placeholder = "Maximum rating",
placeholder = "10",
onValueChange = { value ->
CollectionEditorRepository.updateTmdbFilters {
it.copy(voteAverageLte = value.toDoubleOrNull())
}
},
)
TmdbFilterField(
label = stringResource(Res.string.collections_editor_tmdb_votes_min),
helper = stringResource(Res.string.collections_editor_tmdb_votes_helper),
value = state.tmdbFilters.voteCountGte?.toString().orEmpty(),
placeholder = "100",
onValueChange = { value ->
CollectionEditorRepository.updateTmdbFilters {
it.copy(voteCountGte = value.toIntOrNull())
}
},
)
TmdbQuickChips(
label = "Quick languages",
chips = listOf("English" to "en", "Korean" to "ko", "Japanese" to "ja", "Hindi" to "hi", "Spanish" to "es"),
label = stringResource(Res.string.collections_editor_tmdb_quick_languages),
chips = listOf(
stringResource(Res.string.collections_editor_tmdb_language_english) to "en",
stringResource(Res.string.collections_editor_tmdb_language_korean) to "ko",
stringResource(Res.string.collections_editor_tmdb_language_japanese) to "ja",
stringResource(Res.string.collections_editor_tmdb_language_hindi) to "hi",
stringResource(Res.string.collections_editor_tmdb_language_spanish) to "es",
),
onSelect = { value ->
CollectionEditorRepository.updateTmdbFilters { it.copy(withOriginalLanguage = value) }
},
)
TmdbFilterField(
label = stringResource(Res.string.collections_editor_tmdb_language),
helper = stringResource(Res.string.collections_editor_tmdb_language_helper),
value = state.tmdbFilters.withOriginalLanguage.orEmpty(),
placeholder = "Original language, e.g. en",
placeholder = "en, ko, ja, hi",
onValueChange = { value ->
CollectionEditorRepository.updateTmdbFilters {
it.copy(withOriginalLanguage = value.ifBlank { null })
@ -1190,15 +1213,23 @@ private fun TmdbSourcePickerScreen(
},
)
TmdbQuickChips(
label = "Quick countries",
chips = listOf("United States" to "US", "Korea" to "KR", "Japan" to "JP", "India" to "IN", "United Kingdom" to "GB"),
label = stringResource(Res.string.collections_editor_tmdb_quick_countries),
chips = listOf(
stringResource(Res.string.collections_editor_tmdb_country_us) to "US",
stringResource(Res.string.collections_editor_tmdb_country_korea) to "KR",
stringResource(Res.string.collections_editor_tmdb_country_japan) to "JP",
stringResource(Res.string.collections_editor_tmdb_country_india) to "IN",
stringResource(Res.string.collections_editor_tmdb_country_uk) to "GB",
),
onSelect = { value ->
CollectionEditorRepository.updateTmdbFilters { it.copy(withOriginCountry = value) }
},
)
TmdbFilterField(
label = stringResource(Res.string.collections_editor_tmdb_country),
helper = stringResource(Res.string.collections_editor_tmdb_country_helper),
value = state.tmdbFilters.withOriginCountry.orEmpty(),
placeholder = "Origin country, e.g. US",
placeholder = "US, KR, JP, IN",
onValueChange = { value ->
CollectionEditorRepository.updateTmdbFilters {
it.copy(withOriginCountry = value.ifBlank { null })
@ -1206,15 +1237,22 @@ private fun TmdbSourcePickerScreen(
},
)
TmdbQuickChips(
label = "Quick keywords",
chips = listOf("Superhero" to "9715", "Based on Novel" to "818", "Time Travel" to "4379", "Space" to "9882"),
label = stringResource(Res.string.collections_editor_tmdb_quick_keywords),
chips = listOf(
stringResource(Res.string.collections_editor_tmdb_keyword_superhero) to "9715",
stringResource(Res.string.collections_editor_tmdb_keyword_based_on_novel) to "818",
stringResource(Res.string.collections_editor_tmdb_keyword_time_travel) to "4379",
stringResource(Res.string.collections_editor_tmdb_keyword_space) to "9882",
),
onSelect = { value ->
CollectionEditorRepository.updateTmdbFilters { it.copy(withKeywords = value) }
},
)
TmdbFilterField(
label = stringResource(Res.string.collections_editor_tmdb_keywords),
helper = stringResource(Res.string.collections_editor_tmdb_keywords_helper),
value = state.tmdbFilters.withKeywords.orEmpty(),
placeholder = "Keyword IDs",
placeholder = stringResource(Res.string.collections_editor_tmdb_keywords_placeholder),
onValueChange = { value ->
CollectionEditorRepository.updateTmdbFilters {
it.copy(withKeywords = value.ifBlank { null })
@ -1222,15 +1260,23 @@ private fun TmdbSourcePickerScreen(
},
)
TmdbQuickChips(
label = "Quick companies",
chips = listOf("Marvel" to "420", "Disney" to "2", "Pixar" to "3", "Lucasfilm" to "1", "Warner Bros." to "174"),
label = stringResource(Res.string.collections_editor_tmdb_quick_studios),
chips = listOf(
stringResource(Res.string.collections_editor_tmdb_studio_marvel) to "420",
stringResource(Res.string.collections_editor_tmdb_studio_disney) to "2",
stringResource(Res.string.collections_editor_tmdb_studio_pixar) to "3",
stringResource(Res.string.collections_editor_tmdb_studio_lucasfilm) to "1",
stringResource(Res.string.collections_editor_tmdb_studio_warner) to "174",
),
onSelect = { value ->
CollectionEditorRepository.updateTmdbFilters { it.copy(withCompanies = value) }
},
)
TmdbFilterField(
label = stringResource(Res.string.collections_editor_tmdb_companies),
helper = stringResource(Res.string.collections_editor_tmdb_companies_helper),
value = state.tmdbFilters.withCompanies.orEmpty(),
placeholder = "Company IDs, e.g. 420",
placeholder = stringResource(Res.string.collections_editor_tmdb_companies_placeholder),
onValueChange = { value ->
CollectionEditorRepository.updateTmdbFilters {
it.copy(withCompanies = value.ifBlank { null })
@ -1238,28 +1284,47 @@ private fun TmdbSourcePickerScreen(
},
)
TmdbQuickChips(
label = "Quick networks",
chips = listOf("Netflix" to "213", "HBO" to "49", "Disney+" to "2739", "Prime Video" to "1024", "Hulu" to "453"),
label = stringResource(Res.string.collections_editor_tmdb_quick_networks),
chips = listOf(
stringResource(Res.string.collections_editor_tmdb_network_netflix) to "213",
stringResource(Res.string.collections_editor_tmdb_network_hbo) to "49",
stringResource(Res.string.collections_editor_tmdb_network_disney_plus) to "2739",
stringResource(Res.string.collections_editor_tmdb_network_prime_video) to "1024",
stringResource(Res.string.collections_editor_tmdb_network_hulu) to "453",
),
onSelect = { value ->
CollectionEditorRepository.updateTmdbFilters { it.copy(withNetworks = value) }
},
)
TmdbFilterField(
label = stringResource(Res.string.collections_editor_tmdb_networks),
helper = stringResource(Res.string.collections_editor_tmdb_networks_helper),
value = state.tmdbFilters.withNetworks.orEmpty(),
placeholder = "Network IDs, e.g. 213",
placeholder = stringResource(Res.string.collections_editor_tmdb_networks_placeholder),
onValueChange = { value ->
CollectionEditorRepository.updateTmdbFilters {
it.copy(withNetworks = value.ifBlank { null })
}
},
)
TmdbFilterField(
label = stringResource(Res.string.collections_editor_tmdb_year),
helper = stringResource(Res.string.collections_editor_tmdb_year_helper),
value = state.tmdbFilters.year?.toString().orEmpty(),
placeholder = "2024",
onValueChange = { value ->
CollectionEditorRepository.updateTmdbFilters {
it.copy(year = value.toIntOrNull())
}
},
)
}
}
}
}
if (state.tmdbBuilderMode == TmdbBuilderMode.PRESETS) item {
PickerSectionLabel("Presets")
PickerSectionLabel(stringResource(Res.string.collections_editor_tmdb_presets))
}
if (state.tmdbBuilderMode == TmdbBuilderMode.PRESETS) {
itemsIndexed(TmdbCollectionSourceResolver.presets()) { _, preset ->
@ -1313,11 +1378,11 @@ private fun TmdbSourcePickerScreen(
modifier = Modifier.size(18.dp),
)
Spacer(modifier = Modifier.width(4.dp))
Text("Search")
Text(stringResource(Res.string.collections_editor_tmdb_search))
}
}
NuvioPrimaryButton(
text = "Add TMDB source",
text = stringResource(Res.string.collections_editor_add_source),
modifier = Modifier.weight(1f),
enabled = !requiresId || state.tmdbInput.isNotBlank(),
onClick = { CollectionEditorRepository.addTmdbSourceFromInput() },
@ -1510,23 +1575,24 @@ private fun TmdbQuickChips(
}
}
@Composable
private fun tmdbGenreQuickChips(mediaType: TmdbCollectionMediaType): List<Pair<String, String>> =
when (mediaType) {
TmdbCollectionMediaType.MOVIE -> listOf(
"Action" to "28",
"Adventure" to "12",
"Animation" to "16",
"Comedy" to "35",
"Horror" to "27",
"Sci-Fi" to "878",
stringResource(Res.string.collections_editor_tmdb_genre_action) to "28",
stringResource(Res.string.collections_editor_tmdb_genre_adventure) to "12",
stringResource(Res.string.collections_editor_tmdb_genre_animation) to "16",
stringResource(Res.string.collections_editor_tmdb_genre_comedy) to "35",
stringResource(Res.string.collections_editor_tmdb_genre_horror) to "27",
stringResource(Res.string.collections_editor_tmdb_genre_scifi) to "878",
)
TmdbCollectionMediaType.TV -> listOf(
"Drama" to "18",
"Comedy" to "35",
"Animation" to "16",
"Crime" to "80",
"Sci-Fi" to "10765",
"Reality" to "10764",
stringResource(Res.string.collections_editor_tmdb_genre_drama) to "18",
stringResource(Res.string.collections_editor_tmdb_genre_comedy) to "35",
stringResource(Res.string.collections_editor_tmdb_genre_animation) to "16",
stringResource(Res.string.collections_editor_tmdb_genre_crime) to "80",
stringResource(Res.string.collections_editor_tmdb_genre_scifi) to "10765",
stringResource(Res.string.collections_editor_tmdb_genre_reality) to "10764",
)
}
@ -1541,11 +1607,13 @@ private fun tmdbTitleForMedia(
title: String,
mediaType: TmdbCollectionMediaType,
addSuffix: Boolean,
movieSuffix: String,
seriesSuffix: String,
): String {
if (!addSuffix) return title
val suffix = when (mediaType) {
TmdbCollectionMediaType.MOVIE -> "Movies"
TmdbCollectionMediaType.TV -> "Series"
TmdbCollectionMediaType.MOVIE -> movieSuffix
TmdbCollectionMediaType.TV -> seriesSuffix
}
return "$title $suffix"
}
@ -1687,7 +1755,7 @@ private fun FolderTmdbSourceCard(
Row(verticalAlignment = Alignment.CenterVertically) {
Column(modifier = Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(2.dp)) {
Text(
text = source.title?.takeIf { it.isNotBlank() } ?: "TMDB",
text = source.title?.takeIf { it.isNotBlank() } ?: stringResource(Res.string.source_tmdb),
style = MaterialTheme.typography.bodyLarge,
fontWeight = FontWeight.Medium,
color = MaterialTheme.colorScheme.onSurface,
@ -1695,7 +1763,7 @@ private fun FolderTmdbSourceCard(
overflow = TextOverflow.Ellipsis,
)
Text(
text = "TMDB",
text = stringResource(Res.string.source_tmdb),
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
@ -1816,41 +1884,106 @@ private fun FolderCatalogSourceCard(
}
}
@Composable
private fun tmdbBuilderModeLabel(mode: TmdbBuilderMode): String =
when (mode) {
TmdbBuilderMode.PRESETS -> "Presets"
TmdbBuilderMode.LIST -> "List"
TmdbBuilderMode.COLLECTION -> "Collection"
TmdbBuilderMode.PRODUCTION -> "Production"
TmdbBuilderMode.NETWORK -> "Network"
TmdbBuilderMode.DISCOVER -> "Discover"
TmdbBuilderMode.PRESETS -> stringResource(Res.string.collections_editor_tmdb_presets)
TmdbBuilderMode.LIST -> stringResource(Res.string.collections_editor_tmdb_public_list_mode)
TmdbBuilderMode.PRODUCTION -> stringResource(Res.string.collections_editor_tmdb_production_mode)
TmdbBuilderMode.NETWORK -> stringResource(Res.string.collections_editor_tmdb_network_mode)
TmdbBuilderMode.COLLECTION -> stringResource(Res.string.collections_editor_tmdb_collection_mode)
TmdbBuilderMode.DISCOVER -> stringResource(Res.string.collections_editor_tmdb_custom_mode)
}
@Composable
private fun tmdbModeHelpText(mode: TmdbBuilderMode): String =
when (mode) {
TmdbBuilderMode.PRESETS -> stringResource(Res.string.collections_editor_tmdb_help_presets)
TmdbBuilderMode.LIST -> stringResource(Res.string.collections_editor_tmdb_help_list)
TmdbBuilderMode.PRODUCTION -> stringResource(Res.string.collections_editor_tmdb_help_production)
TmdbBuilderMode.NETWORK -> stringResource(Res.string.collections_editor_tmdb_help_network)
TmdbBuilderMode.COLLECTION -> stringResource(Res.string.collections_editor_tmdb_help_collection)
TmdbBuilderMode.DISCOVER -> stringResource(Res.string.collections_editor_tmdb_help_discover)
}
@Composable
private fun tmdbInputLabel(mode: TmdbBuilderMode): String =
when (mode) {
TmdbBuilderMode.LIST -> stringResource(Res.string.collections_editor_tmdb_public_list)
TmdbBuilderMode.NETWORK -> stringResource(Res.string.collections_editor_tmdb_network_id)
TmdbBuilderMode.COLLECTION -> stringResource(Res.string.collections_editor_tmdb_collection_id)
TmdbBuilderMode.PRODUCTION -> stringResource(Res.string.collections_editor_tmdb_company_search)
else -> stringResource(Res.string.collections_editor_tmdb_id_or_url)
}
@Composable
private fun tmdbInputPlaceholder(mode: TmdbBuilderMode): String =
when (mode) {
TmdbBuilderMode.LIST -> stringResource(Res.string.collections_editor_tmdb_list_placeholder)
TmdbBuilderMode.NETWORK -> stringResource(Res.string.collections_editor_tmdb_network_placeholder)
TmdbBuilderMode.COLLECTION -> stringResource(Res.string.collections_editor_tmdb_collection_placeholder)
TmdbBuilderMode.PRODUCTION -> stringResource(Res.string.collections_editor_tmdb_company_placeholder)
else -> stringResource(Res.string.collections_editor_tmdb_id_or_url)
}
@Composable
private fun tmdbInputHelper(mode: TmdbBuilderMode): String =
when (mode) {
TmdbBuilderMode.PRODUCTION -> stringResource(Res.string.collections_editor_tmdb_search_helper)
TmdbBuilderMode.COLLECTION -> stringResource(Res.string.collections_editor_tmdb_collection_helper)
TmdbBuilderMode.NETWORK -> stringResource(Res.string.collections_editor_tmdb_network_helper)
TmdbBuilderMode.LIST -> stringResource(Res.string.collections_editor_tmdb_list_helper)
else -> ""
}
@Composable
private fun tmdbTitlePlaceholder(mode: TmdbBuilderMode): String =
when (mode) {
TmdbBuilderMode.DISCOVER -> stringResource(Res.string.collections_editor_tmdb_discover_title_placeholder)
else -> stringResource(Res.string.collections_editor_tmdb_title_placeholder)
}
@Composable
private fun tmdbSortLabel(sort: TmdbCollectionSort): String =
when (sort) {
TmdbCollectionSort.POPULAR_DESC -> "Popular"
TmdbCollectionSort.VOTE_AVERAGE_DESC -> "Top rated"
TmdbCollectionSort.RELEASE_DATE_DESC -> "Newest movies"
TmdbCollectionSort.FIRST_AIR_DATE_DESC -> "Newest series"
TmdbCollectionSort.POPULAR_DESC -> stringResource(Res.string.collections_editor_tmdb_sort_popular)
TmdbCollectionSort.VOTE_AVERAGE_DESC -> stringResource(Res.string.collections_editor_tmdb_sort_top_rated)
TmdbCollectionSort.RELEASE_DATE_DESC -> stringResource(Res.string.collections_editor_tmdb_sort_recent)
TmdbCollectionSort.FIRST_AIR_DATE_DESC -> stringResource(Res.string.collections_editor_tmdb_sort_recent)
}
@Composable
private fun tmdbSourceSubtitle(source: CollectionSource): String {
val media = when (TmdbCollectionMediaType.fromString(source.mediaType)) {
TmdbCollectionMediaType.MOVIE -> "Movies"
TmdbCollectionMediaType.TV -> "Series"
TmdbCollectionMediaType.MOVIE -> stringResource(Res.string.collections_editor_tmdb_movies)
TmdbCollectionMediaType.TV -> stringResource(Res.string.collections_editor_tmdb_series)
}
val sort = source.sortBy?.let { value ->
TmdbCollectionSort.entries.firstOrNull { it.value == value }?.let(::tmdbSortLabel)
} ?: "Popular"
TmdbCollectionSort.entries.firstOrNull { it.value == value }?.let { sort ->
tmdbSortLabel(sort)
}
} ?: stringResource(Res.string.collections_editor_tmdb_sort_popular)
val sourceType = runCatching {
TmdbCollectionSourceType.valueOf(source.tmdbSourceType.orEmpty())
}.getOrDefault(TmdbCollectionSourceType.DISCOVER)
return when (sourceType) {
TmdbCollectionSourceType.LIST -> "TMDB List"
TmdbCollectionSourceType.COLLECTION -> "TMDB Movie Collection"
TmdbCollectionSourceType.COMPANY -> listOf("Production", media, sort).joinToString("")
TmdbCollectionSourceType.NETWORK -> listOf("Network", "Series", sort).joinToString("")
TmdbCollectionSourceType.DISCOVER -> listOf("TMDB Discover", media, sort).joinToString("")
TmdbCollectionSourceType.LIST -> stringResource(Res.string.collections_editor_tmdb_subtitle_list)
TmdbCollectionSourceType.COLLECTION -> stringResource(Res.string.collections_editor_tmdb_subtitle_movie_collection)
TmdbCollectionSourceType.COMPANY -> listOf(
stringResource(Res.string.collections_editor_tmdb_subtitle_production),
media,
sort,
).joinToString("")
TmdbCollectionSourceType.NETWORK -> listOf(
stringResource(Res.string.collections_editor_tmdb_subtitle_network),
stringResource(Res.string.collections_editor_tmdb_series),
sort,
).joinToString("")
TmdbCollectionSourceType.DISCOVER -> listOf(
stringResource(Res.string.collections_editor_tmdb_subtitle_discover),
media,
sort,
).joinToString("")
}
}