Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
starsep authored and nielsvanvelzen committed Aug 3, 2024
1 parent 96e39c3 commit 8230479
Show file tree
Hide file tree
Showing 24 changed files with 47 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> {
Expand All @@ -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)
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,11 +473,11 @@ private void setAutoCardGridValues() {

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);
Expand All @@ -501,14 +501,14 @@ private void setAutoCardGridValues() {
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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void insertCardData (@Nullable String fullName, @NonNull int icon, @NonNu
}
}

public CharSequence gettitle() {
public CharSequence getTitle() {
if (binding.title == null) {
return null;
}
Expand Down Expand Up @@ -212,7 +212,7 @@ public boolean hasOverlappingRendering() {
}

private void setTextMaxLines() {
if (TextUtils.isEmpty(gettitle())) {
if (TextUtils.isEmpty(getTitle())) {
binding.contentText.setMaxLines(2);
} else {
binding.contentText.setMaxLines(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ 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,
CollectionType.BOXSETS,
CollectionType.BOOKS,
)

// Maximum ammount of items loaded for a row
// Maximum amount of items loaded for a row
private const val ITEM_LIMIT = 50
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,8 @@ protected Void doInBackground(Integer... params) {
// 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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public static void setTimelineRow(Context context, LinearLayout timelineRow, Bas
}

// 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ private void startFadeTimer() {
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();
Expand Down Expand Up @@ -883,8 +883,8 @@ protected Void doInBackground(Integer... params) {
// 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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ private Display.Mode findBestDisplayMode(MediaStream videoStream) {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public void onChildViewHolderSelected(RecyclerView parent, RecyclerView.ViewHold
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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class SelectServerFragment : Fragment() {
super.onResume()

startupViewModel.reloadStoredServers()
startupViewModel.loadDiscoveryservers()
startupViewModel.loadDiscoveryServers()
}

class ServerAdapter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public void onError(Exception exception) {
});
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/test/kotlin/util/TimeUtilsTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion playback/core/src/main/kotlin/PlayerState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 10 additions & 10 deletions playback/core/src/main/kotlin/PlayerVolumeState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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()

Expand All @@ -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
Expand All @@ -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,
Expand All @@ -94,7 +94,7 @@ class AndroidPlayerVolumeState(
}

override fun unmute() {
if (!modifyable) return
if (!modifiable) return
audioManager.adjustStreamVolume(
stream,
AudioManager.ADJUST_UNMUTE,
Expand All @@ -103,7 +103,7 @@ class AndroidPlayerVolumeState(
}

override fun increaseVolume() {
if (!modifyable) return
if (!modifiable) return
audioManager.adjustStreamVolume(
stream,
AudioManager.ADJUST_RAISE,
Expand All @@ -112,7 +112,7 @@ class AndroidPlayerVolumeState(
}

override fun decreaseVolume() {
if (!modifyable) return
if (!modifiable) return
audioManager.adjustStreamVolume(
stream,
AudioManager.ADJUST_LOWER,
Expand All @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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") }
Expand Down

0 comments on commit 8230479

Please sign in to comment.