mirror of
https://github.com/jellyfin/jellyfin-androidtv.git
synced 2024-11-26 23:50:27 +00:00
Fix typos
This commit is contained in:
parent
96e39c34f3
commit
8230479059
@ -3,7 +3,7 @@ package org.jellyfin.androidtv.auth.model
|
||||
sealed class QuickConnectState
|
||||
|
||||
/**
|
||||
* State unknown untill first poll completed.
|
||||
* State unknown until first poll completed.
|
||||
*/
|
||||
data object UnknownQuickConnectState : QuickConnectState()
|
||||
|
||||
|
@ -95,7 +95,7 @@ class ServerRepositoryImpl(
|
||||
|
||||
val goodRecommendations = mutableListOf<RecommendedServerInfo>()
|
||||
val badRecommendations = mutableListOf<RecommendedServerInfo>()
|
||||
val greatRecommendaton = jellyfin.discovery.getRecommendedServers(addressCandidates).firstOrNull { recommendedServer ->
|
||||
val greatRecommendation = jellyfin.discovery.getRecommendedServers(addressCandidates).firstOrNull { recommendedServer ->
|
||||
when (recommendedServer.score) {
|
||||
RecommendedServerInfoScore.GREAT -> true
|
||||
RecommendedServerInfoScore.GOOD -> {
|
||||
@ -111,7 +111,7 @@ class ServerRepositoryImpl(
|
||||
|
||||
Timber.d(buildString {
|
||||
append("Recommendations: ")
|
||||
if (greatRecommendaton == null) append(0)
|
||||
if (greatRecommendation == null) append(0)
|
||||
else append(1)
|
||||
append(" great, ")
|
||||
append(goodRecommendations.size)
|
||||
@ -120,7 +120,7 @@ class ServerRepositoryImpl(
|
||||
append(" bad")
|
||||
})
|
||||
|
||||
val chosenRecommendation = greatRecommendaton ?: goodRecommendations.firstOrNull()
|
||||
val chosenRecommendation = greatRecommendation ?: goodRecommendations.firstOrNull()
|
||||
if (chosenRecommendation != null && chosenRecommendation.systemInfo.isSuccess) {
|
||||
// Get system info
|
||||
val systemInfo = chosenRecommendation.systemInfo.getOrThrow()
|
||||
|
@ -45,7 +45,7 @@ class UserPreferences(context: Context) : SharedPreferenceStore(
|
||||
var premieresEnabled = booleanPreference("pref_enable_premieres", false)
|
||||
|
||||
/**
|
||||
* Enable management of media like deleting items when the user has sufficient permisisons.
|
||||
* Enable management of media like deleting items when the user has sufficient permissions.
|
||||
*/
|
||||
var mediaManagementEnabled = booleanPreference("enable_media_management", false)
|
||||
|
||||
|
@ -46,7 +46,7 @@ class ScreensaverViewModel(
|
||||
// Cancel pending timer (if any)
|
||||
timer?.cancel()
|
||||
|
||||
// Hide when interacted with allowed cancelation or when disabled
|
||||
// Hide when interacted with allowed cancellation or when disabled
|
||||
if (_visible.value && (canCancel || !inAppEnabled || activityPaused)) {
|
||||
_visible.value = false
|
||||
}
|
||||
|
@ -473,11 +473,11 @@ public class BrowseGridFragment extends Fragment implements View.OnKeyListener {
|
||||
|
||||
if (numRows > 0) {
|
||||
double paddingPct = cardScaling / numRows;
|
||||
double spaceingPct = ((paddingPct / 2.0) * CARD_SPACING_PCT) * (numRows - 1);
|
||||
double spacingPct = ((paddingPct / 2.0) * CARD_SPACING_PCT) * (numRows - 1);
|
||||
|
||||
double wastedSpacePct = paddingPct + spaceingPct;
|
||||
double useableCardSpace = mGridHeight / (1.0 + wastedSpacePct); // decrease size
|
||||
double cardHeight = useableCardSpace / numRows;
|
||||
double wastedSpacePct = paddingPct + spacingPct;
|
||||
double usableCardSpace = mGridHeight / (1.0 + wastedSpacePct); // decrease size
|
||||
double cardHeight = usableCardSpace / numRows;
|
||||
|
||||
// fix any rounding errors and make pixel perfect
|
||||
cardHeightInt = (int) Math.round(cardHeight);
|
||||
@ -501,14 +501,14 @@ public class BrowseGridFragment extends Fragment implements View.OnKeyListener {
|
||||
mCardsScreenStride = numRows;
|
||||
} else if (numCols > 0) {
|
||||
double paddingPct = cardScaling / numCols;
|
||||
double spaceingPct = ((paddingPct / 2.0) * CARD_SPACING_PCT) * (numCols - 1);
|
||||
double spacingPct = ((paddingPct / 2.0) * CARD_SPACING_PCT) * (numCols - 1);
|
||||
if (mImageType == ImageType.BANNER) {
|
||||
spaceingPct = ((paddingPct / 2.0) * CARD_SPACING_HORIZONTAL_BANNER_PCT) * (numCols - 1);
|
||||
spacingPct = ((paddingPct / 2.0) * CARD_SPACING_HORIZONTAL_BANNER_PCT) * (numCols - 1);
|
||||
}
|
||||
|
||||
double wastedSpacePct = paddingPct + spaceingPct;
|
||||
double useableCardSpace = mGridWidth / (1.0 + wastedSpacePct); // decrease size
|
||||
double cardWidth = useableCardSpace / numCols;
|
||||
double wastedSpacePct = paddingPct + spacingPct;
|
||||
double usableCardSpace = mGridWidth / (1.0 + wastedSpacePct); // decrease size
|
||||
double cardWidth = usableCardSpace / numCols;
|
||||
|
||||
// fix any rounding errors and make pixel perfect
|
||||
cardHeightInt = (int) Math.round(getCardHeightBy(cardWidth, mImageType, mFolder));
|
||||
|
@ -158,7 +158,7 @@ public class LegacyImageCardView extends BaseCardView {
|
||||
}
|
||||
}
|
||||
|
||||
public CharSequence gettitle() {
|
||||
public CharSequence getTitle() {
|
||||
if (binding.title == null) {
|
||||
return null;
|
||||
}
|
||||
@ -212,7 +212,7 @@ public class LegacyImageCardView extends BaseCardView {
|
||||
}
|
||||
|
||||
private void setTextMaxLines() {
|
||||
if (TextUtils.isEmpty(gettitle())) {
|
||||
if (TextUtils.isEmpty(getTitle())) {
|
||||
binding.contentText.setMaxLines(2);
|
||||
} else {
|
||||
binding.contentText.setMaxLines(1);
|
||||
|
@ -52,7 +52,7 @@ class HomeFragmentLatestRow(
|
||||
}
|
||||
|
||||
companion object {
|
||||
// Collections exclused from latest row based on app support and common sense
|
||||
// Collections excluded from latest row based on app support and common sense
|
||||
private val EXCLUDED_COLLECTION_TYPES = arrayOf(
|
||||
CollectionType.PLAYLISTS,
|
||||
CollectionType.LIVETV,
|
||||
@ -60,7 +60,7 @@ class HomeFragmentLatestRow(
|
||||
CollectionType.BOOKS,
|
||||
)
|
||||
|
||||
// Maximum ammount of items loaded for a row
|
||||
// Maximum amount of items loaded for a row
|
||||
private const val ITEM_LIMIT = 50
|
||||
}
|
||||
}
|
||||
|
@ -538,8 +538,8 @@ public class LiveTvGuideFragment extends Fragment implements LiveTvGuide, View.O
|
||||
// set focus parameters if we are not on first row
|
||||
// this makes focus movements more predictable for the grid view
|
||||
if (prevRow != null) {
|
||||
TvManager.setFocusParms(row, prevRow, true);
|
||||
TvManager.setFocusParms(prevRow, row, false);
|
||||
TvManager.setFocusParams(row, prevRow, true);
|
||||
TvManager.setFocusParams(prevRow, row, false);
|
||||
}
|
||||
prevRow = row;
|
||||
|
||||
|
@ -204,7 +204,7 @@ public class TvManager {
|
||||
}
|
||||
|
||||
// this makes focus movements more predictable for the grid view
|
||||
public static void setFocusParms(LinearLayout currentRow, LinearLayout otherRow, boolean up) {
|
||||
public static void setFocusParams(LinearLayout currentRow, LinearLayout otherRow, boolean up) {
|
||||
for (int currentRowNdx = 0; currentRowNdx < currentRow.getChildCount(); currentRowNdx++) {
|
||||
ProgramGridCell cell = (ProgramGridCell) currentRow.getChildAt(currentRowNdx);
|
||||
ProgramGridCell otherCell = getOtherCell(otherRow, cell);
|
||||
|
@ -15,7 +15,7 @@ sealed interface NavigationAction {
|
||||
) : NavigationAction
|
||||
|
||||
/**
|
||||
* Open the activity in [destination] and immediatly call [onOpened] to clear the emitted state.
|
||||
* Open the activity in [destination] and immediately call [onOpened] to clear the emitted state.
|
||||
*/
|
||||
data class NavigateActivity(
|
||||
val destination: Destination.Activity,
|
||||
|
@ -201,7 +201,7 @@ class PictureViewerFragment : Fragment(), View.OnKeyListener {
|
||||
actionHideTimer = lifecycleScope.launch {
|
||||
delay(AUTO_HIDE_ACTIONS_DURATION)
|
||||
|
||||
// Only auto-hide when there is an active presenation
|
||||
// Only auto-hide when there is an active presentation
|
||||
if (pictureViewerViewModel.presentationActive.value) hideActions()
|
||||
}
|
||||
}
|
||||
|
@ -673,7 +673,7 @@ public class CustomPlaybackOverlayFragment extends Fragment implements LiveTvGui
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
// Close player when resuming without a valid playback contoller
|
||||
// Close player when resuming without a valid playback controller
|
||||
if (!playbackControllerContainer.getValue().getPlaybackController().hasFragment()) {
|
||||
if (navigationRepository.getValue().getCanGoBack()) {
|
||||
navigationRepository.getValue().goBack();
|
||||
@ -883,8 +883,8 @@ public class CustomPlaybackOverlayFragment extends Fragment implements LiveTvGui
|
||||
// set focus parameters if we are not on first row
|
||||
// this makes focus movements more predictable for the grid view
|
||||
if (prevRow != null) {
|
||||
TvManager.setFocusParms(row, prevRow, true);
|
||||
TvManager.setFocusParms(prevRow, row, false);
|
||||
TvManager.setFocusParams(row, prevRow, true);
|
||||
TvManager.setFocusParams(prevRow, row, false);
|
||||
}
|
||||
prevRow = row;
|
||||
|
||||
|
@ -305,7 +305,7 @@ public class PlaybackController implements PlaybackControllerNotifiable {
|
||||
if (mode.getPhysicalWidth() < 1280 || mode.getPhysicalHeight() < 720) // Skip non-HD
|
||||
continue;
|
||||
|
||||
if (mode.getPhysicalWidth() < videoStream.getWidth() || mode.getPhysicalHeight() < videoStream.getHeight()) // Disallow reso downgrade
|
||||
if (mode.getPhysicalWidth() < videoStream.getWidth() || mode.getPhysicalHeight() < videoStream.getHeight()) // Disallow resolution downgrade
|
||||
continue;
|
||||
|
||||
int rate = Math.round(mode.getRefreshRate() * 100);
|
||||
|
@ -203,7 +203,7 @@ public class HorizontalGridPresenter extends Presenter {
|
||||
vh.mItemBridgeAdapter.setAdapterListener(new ItemBridgeAdapter.AdapterListener() {
|
||||
@Override
|
||||
public void onBind(final ItemBridgeAdapter.ViewHolder itemViewHolder) {
|
||||
// Only when having an OnItemClickListner, we attach the OnClickListener.
|
||||
// Only when having an OnItemClickListener, we attach the OnClickListener.
|
||||
if (getOnItemViewClickedListener() != null) {
|
||||
final View itemView = itemViewHolder.getViewHolder().view;
|
||||
itemView.setOnClickListener(new View.OnClickListener() {
|
||||
|
@ -8,7 +8,7 @@ import androidx.recyclerview.widget.ListUpdateCallback
|
||||
|
||||
/**
|
||||
* A leanback ObjectAdapter using a Kotlin list as backend. Implements Iterable to allow collection
|
||||
* operations. And uses generics for strong typing. Uses a MutableList as internal stucture.
|
||||
* operations. And uses generics for strong typing. Uses a MutableList as internal structure.
|
||||
*/
|
||||
open class MutableObjectAdapter<T : Any> : ObjectAdapter, Iterable<T> {
|
||||
private val data = mutableListOf<T>()
|
||||
|
@ -70,7 +70,7 @@ class StartupViewModel(
|
||||
fun getUserImage(server: Server, user: User): String? =
|
||||
authenticationRepository.getUserImageUrl(server, user)
|
||||
|
||||
fun loadDiscoveryservers() {
|
||||
fun loadDiscoveryServers() {
|
||||
// Only run one discovery process at a time
|
||||
if (discoveryMutex.isLocked) return
|
||||
|
||||
|
@ -214,7 +214,7 @@ class SelectServerFragment : Fragment() {
|
||||
super.onResume()
|
||||
|
||||
startupViewModel.reloadStoredServers()
|
||||
startupViewModel.loadDiscoveryservers()
|
||||
startupViewModel.loadDiscoveryServers()
|
||||
}
|
||||
|
||||
class ServerAdapter(
|
||||
|
@ -306,7 +306,7 @@ public class KeyProcessor {
|
||||
});
|
||||
return true;
|
||||
case MENU_PLAY_FIRST_UNWATCHED:
|
||||
KeyProcesorHelperKt.playFirstUnwatchedItem(activity, item.getId());
|
||||
KeyProcessorHelperKt.playFirstUnwatchedItem(activity, item.getId());
|
||||
return true;
|
||||
case MENU_MARK_FAVORITE:
|
||||
toggleFavorite(activity, item.getId(), true);
|
||||
|
@ -111,7 +111,7 @@ class VideoSpeedControllerTests : FunSpec({
|
||||
speedController.currentSpeed shouldBe VideoSpeedController.SpeedSteps.SPEED_1_00
|
||||
}
|
||||
|
||||
test("VideoSpeedController.currentSpeed alwats sets the requested speed when LiveTV is off") {
|
||||
test("VideoSpeedController.currentSpeed always sets the requested speed when LiveTV is off") {
|
||||
val mockController = mockk<PlaybackController>(relaxed = true) {
|
||||
every { isLiveTv } returns false
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import io.kotest.core.spec.style.FunSpec
|
||||
import io.kotest.matchers.shouldBe
|
||||
|
||||
class TimeUtilsTests : FunSpec({
|
||||
test("TimeUtils.secondstoMillis() works correctly") {
|
||||
test("TimeUtils.secondsToMillis() works correctly") {
|
||||
TimeUtils.secondsToMillis(0.0) shouldBe 0
|
||||
TimeUtils.secondsToMillis(1.0) shouldBe 1000
|
||||
TimeUtils.secondsToMillis(1.25) shouldBe 1250
|
||||
|
@ -30,7 +30,7 @@ interface PlayerState {
|
||||
/**
|
||||
* The position information for the currently playing item or [PositionInfo.EMPTY]. This
|
||||
* property is not reactive to avoid performance penalties. Manually read the values every
|
||||
* second for UI or read when neccesary.
|
||||
* second for UI or read when necessary.
|
||||
*/
|
||||
val positionInfo: PositionInfo
|
||||
|
||||
|
@ -25,7 +25,7 @@ interface PlayerVolumeState {
|
||||
* Whether the volume and mute state can be changed or not.
|
||||
* Changing the volume/mute state will do nothing when false.
|
||||
*/
|
||||
val modifyable: Boolean
|
||||
val modifiable: Boolean
|
||||
|
||||
/**
|
||||
* Mute the device.
|
||||
@ -38,12 +38,12 @@ interface PlayerVolumeState {
|
||||
fun unmute()
|
||||
|
||||
/**
|
||||
* Increase the device volume by the device prefered amount.
|
||||
* Increase the device volume by the device preferred amount.
|
||||
*/
|
||||
fun increaseVolume()
|
||||
|
||||
/**
|
||||
* Decrease the device volume by the device prefered amount.
|
||||
* Decrease the device volume by the device preferred amount.
|
||||
*/
|
||||
fun decreaseVolume()
|
||||
|
||||
@ -60,7 +60,7 @@ interface PlayerVolumeState {
|
||||
class NoOpPlayerVolumeState : PlayerVolumeState {
|
||||
override val muted = false
|
||||
override val volume = 1f
|
||||
override val modifyable = false
|
||||
override val modifiable = false
|
||||
|
||||
override fun mute() = Unit
|
||||
override fun unmute() = Unit
|
||||
@ -81,11 +81,11 @@ class AndroidPlayerVolumeState(
|
||||
override val volume: Float
|
||||
get() = audioManager.getStreamVolume(stream).toFloat() / audioManager.getStreamMaxVolume(stream)
|
||||
|
||||
override val modifyable: Boolean
|
||||
override val modifiable: Boolean
|
||||
get() = !audioManager.isVolumeFixed
|
||||
|
||||
override fun mute() {
|
||||
if (!modifyable) return
|
||||
if (!modifiable) return
|
||||
audioManager.adjustStreamVolume(
|
||||
stream,
|
||||
AudioManager.ADJUST_MUTE,
|
||||
@ -94,7 +94,7 @@ class AndroidPlayerVolumeState(
|
||||
}
|
||||
|
||||
override fun unmute() {
|
||||
if (!modifyable) return
|
||||
if (!modifiable) return
|
||||
audioManager.adjustStreamVolume(
|
||||
stream,
|
||||
AudioManager.ADJUST_UNMUTE,
|
||||
@ -103,7 +103,7 @@ class AndroidPlayerVolumeState(
|
||||
}
|
||||
|
||||
override fun increaseVolume() {
|
||||
if (!modifyable) return
|
||||
if (!modifiable) return
|
||||
audioManager.adjustStreamVolume(
|
||||
stream,
|
||||
AudioManager.ADJUST_RAISE,
|
||||
@ -112,7 +112,7 @@ class AndroidPlayerVolumeState(
|
||||
}
|
||||
|
||||
override fun decreaseVolume() {
|
||||
if (!modifyable) return
|
||||
if (!modifiable) return
|
||||
audioManager.adjustStreamVolume(
|
||||
stream,
|
||||
AudioManager.ADJUST_LOWER,
|
||||
@ -122,7 +122,7 @@ class AndroidPlayerVolumeState(
|
||||
|
||||
override fun setVolume(@FloatRange(0.0, 1.0) volume: Float) {
|
||||
require(volume in 0f..1f)
|
||||
if (!modifyable) return
|
||||
if (!modifiable) return
|
||||
val maxVolume = audioManager.getStreamMaxVolume(stream)
|
||||
val index = (volume * maxVolume).roundToInt()
|
||||
Timber.d("volume=$volume, maxVolume=$maxVolume, index=$index")
|
||||
|
@ -15,7 +15,7 @@ class ExoPlayerAudioPipeline {
|
||||
fun setAudioSessionId(audioSessionId: Int) {
|
||||
Timber.d("Audio session id changed to $audioSessionId")
|
||||
|
||||
// Re-creare loudness enhancer for normalization gain
|
||||
// Re-create loudness enhancer for normalization gain
|
||||
loudnessEnhancer?.release()
|
||||
loudnessEnhancer = runCatching { LoudnessEnhancer(audioSessionId) }
|
||||
.onFailure { Timber.w(it, "Failed to create LoudnessEnhancer") }
|
||||
|
Loading…
Reference in New Issue
Block a user