Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RadiationX committed May 5, 2020
1 parent 32742d7 commit aa86fd1
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
1 change: 0 additions & 1 deletion app-tv/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
<provider android:name=".contentprovider.suggestions.SuggestionsContentProvider"
android:authorities="ru.radiationx.anilibria.contentprovider.suggestions"
android:exported="true"
android:initOrder="900"
tools:ignore="ExportedContentProvider" />

</application>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class CardsDataConverter(
id,
title.orEmpty(),
"${seasons.firstOrNull()} год • ${genres.firstOrNull()
?.capitalize()} • Серии: ${series} • Обновлен ${Date(torrentUpdate * 1000L).relativeDate(context).decapitalize()}",
?.capitalize()} • Серии: ${series?.trim() ?: "Не доступно"} • Обновлен ${Date(torrentUpdate * 1000L).relativeDate(context)
.decapitalize()}",
poster.orEmpty(),
LibriaCard.Type.RELEASE
).apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ class DetailDataConverter(
genres.firstOrNull()?.capitalize()?.trim(),
"${seasons.firstOrNull()} год",
types.firstOrNull()?.trim(),
"Серии: ${series?.trim()}"
"Серии: ${series?.trim() ?: "Не доступно"}"
).joinToString(""),
Html.fromHtml(description.orEmpty()).toString().trim().trim('"')/*.replace('\n', ' ')*/,
getAnnounce(),
poster.orEmpty(),
NumberFormat.getNumberInstance().format(favoriteInfo.rating),
(releaseItem as? ReleaseFull)?.episodes?.any { it.urlFullHd != null } ?: false,
favoriteInfo.isAdded,
(releaseItem as? ReleaseFull)?.episodes?.isNotEmpty() ?: false,
(releaseItem as? ReleaseFull)?.episodes?.any { it.isViewed } ?: false,
false && (releaseItem as? ReleaseFull)?.moonwalkLink != null
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ data class LibriaDetails(
val favoriteCount: String,
val hasFullHd: Boolean,
val isFavorite: Boolean,
val hasEpisodes: Boolean,
val hasViewed: Boolean,
val hasWebPlayer: Boolean
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ class DetailHeaderViewModel(

fun onPlayClick() {
val release = currentRelease as? ReleaseFull ?: return
if (release.episodes.size > 1) {
if (release.episodes.isEmpty()) return
if (release.episodes.size == 1) {
router.navigateTo(PlayerScreen(releaseId))
} else {
val episodeId = releaseInteractor.getEpisodes(releaseId).maxBy { it.lastAccess }?.id ?: -1
guidedRouter.open(PlayerEpisodesGuidedScreen(releaseId, episodeId))
} else {
router.navigateTo(PlayerScreen(releaseId))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class LibriaReleaseViewHolder(
)
rowReleaseHQMarker.isVisible = details.hasFullHd

rowReleaseActionPlay.isVisible = details.hasEpisodes
rowReleaseActionContinue.isVisible = details.hasViewed
rowReleaseActionPlayWeb.isVisible = details.hasWebPlayer
rowReleaseActionFavorite.text = if (details.isFavorite) {
Expand Down

0 comments on commit aa86fd1

Please sign in to comment.