ktlint: Fix blank-line-between-when-conditions violations
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
parent
560f4c861a
commit
8f779d8ac5
15 changed files with 75 additions and 2 deletions
|
|
@ -12,8 +12,6 @@ ktlint_function_naming_ignore_when_annotated_with = Composable
|
||||||
|
|
||||||
ktlint_standard_argument-list-wrapping = disabled
|
ktlint_standard_argument-list-wrapping = disabled
|
||||||
ktlint_standard_backing-property-naming = disabled
|
ktlint_standard_backing-property-naming = disabled
|
||||||
ktlint_standard_blank-line-before-declaration = disabled
|
|
||||||
ktlint_standard_blank-line-between-when-conditions = disabled
|
|
||||||
ktlint_standard_chain-method-continuation = disabled
|
ktlint_standard_chain-method-continuation = disabled
|
||||||
ktlint_standard_class-signature = disabled
|
ktlint_standard_class-signature = disabled
|
||||||
ktlint_standard_function-expression-body = disabled
|
ktlint_standard_function-expression-body = disabled
|
||||||
|
|
|
||||||
|
|
@ -193,18 +193,24 @@ class ErrorInfo private constructor(
|
||||||
ErrorMessage(R.string.player_http_invalid_status, cause.responseCode.toString())
|
ErrorMessage(R.string.player_http_invalid_status, cause.responseCode.toString())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cause is Loader.UnexpectedLoaderException && cause.cause is ExtractionException ->
|
cause is Loader.UnexpectedLoaderException && cause.cause is ExtractionException ->
|
||||||
getMessage(throwable, action, serviceId)
|
getMessage(throwable, action, serviceId)
|
||||||
|
|
||||||
throwable.type == ExoPlaybackException.TYPE_SOURCE ->
|
throwable.type == ExoPlaybackException.TYPE_SOURCE ->
|
||||||
ErrorMessage(R.string.player_stream_failure)
|
ErrorMessage(R.string.player_stream_failure)
|
||||||
|
|
||||||
throwable.type == ExoPlaybackException.TYPE_UNEXPECTED ->
|
throwable.type == ExoPlaybackException.TYPE_UNEXPECTED ->
|
||||||
ErrorMessage(R.string.player_recoverable_failure)
|
ErrorMessage(R.string.player_recoverable_failure)
|
||||||
|
|
||||||
else ->
|
else ->
|
||||||
ErrorMessage(R.string.player_unrecoverable_failure)
|
ErrorMessage(R.string.player_unrecoverable_failure)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throwable is FailedMediaSource.FailedMediaSourceException ->
|
throwable is FailedMediaSource.FailedMediaSourceException ->
|
||||||
getMessage(throwable.cause, action, serviceId)
|
getMessage(throwable.cause, action, serviceId)
|
||||||
|
|
||||||
throwable is PlaybackResolver.ResolverException ->
|
throwable is PlaybackResolver.ResolverException ->
|
||||||
ErrorMessage(R.string.player_stream_failure)
|
ErrorMessage(R.string.player_stream_failure)
|
||||||
|
|
||||||
|
|
@ -220,34 +226,46 @@ class ErrorInfo private constructor(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
?: ErrorMessage(R.string.account_terminated)
|
?: ErrorMessage(R.string.account_terminated)
|
||||||
|
|
||||||
throwable is AgeRestrictedContentException ->
|
throwable is AgeRestrictedContentException ->
|
||||||
ErrorMessage(R.string.restricted_video_no_stream)
|
ErrorMessage(R.string.restricted_video_no_stream)
|
||||||
|
|
||||||
throwable is GeographicRestrictionException ->
|
throwable is GeographicRestrictionException ->
|
||||||
ErrorMessage(R.string.georestricted_content)
|
ErrorMessage(R.string.georestricted_content)
|
||||||
|
|
||||||
throwable is PaidContentException ->
|
throwable is PaidContentException ->
|
||||||
ErrorMessage(R.string.paid_content)
|
ErrorMessage(R.string.paid_content)
|
||||||
|
|
||||||
throwable is PrivateContentException ->
|
throwable is PrivateContentException ->
|
||||||
ErrorMessage(R.string.private_content)
|
ErrorMessage(R.string.private_content)
|
||||||
|
|
||||||
throwable is SoundCloudGoPlusContentException ->
|
throwable is SoundCloudGoPlusContentException ->
|
||||||
ErrorMessage(R.string.soundcloud_go_plus_content)
|
ErrorMessage(R.string.soundcloud_go_plus_content)
|
||||||
|
|
||||||
throwable is UnsupportedContentInCountryException ->
|
throwable is UnsupportedContentInCountryException ->
|
||||||
ErrorMessage(R.string.unsupported_content_in_country)
|
ErrorMessage(R.string.unsupported_content_in_country)
|
||||||
|
|
||||||
throwable is YoutubeMusicPremiumContentException ->
|
throwable is YoutubeMusicPremiumContentException ->
|
||||||
ErrorMessage(R.string.youtube_music_premium_content)
|
ErrorMessage(R.string.youtube_music_premium_content)
|
||||||
|
|
||||||
throwable is SignInConfirmNotBotException ->
|
throwable is SignInConfirmNotBotException ->
|
||||||
ErrorMessage(R.string.sign_in_confirm_not_bot_error, getServiceName(serviceId))
|
ErrorMessage(R.string.sign_in_confirm_not_bot_error, getServiceName(serviceId))
|
||||||
|
|
||||||
throwable is ContentNotAvailableException ->
|
throwable is ContentNotAvailableException ->
|
||||||
ErrorMessage(R.string.content_not_available)
|
ErrorMessage(R.string.content_not_available)
|
||||||
|
|
||||||
// other extractor exceptions
|
// other extractor exceptions
|
||||||
throwable is ContentNotSupportedException ->
|
throwable is ContentNotSupportedException ->
|
||||||
ErrorMessage(R.string.content_not_supported)
|
ErrorMessage(R.string.content_not_supported)
|
||||||
|
|
||||||
// ReCaptchas will be handled in a special way anyway
|
// ReCaptchas will be handled in a special way anyway
|
||||||
throwable is ReCaptchaException ->
|
throwable is ReCaptchaException ->
|
||||||
ErrorMessage(R.string.recaptcha_request_toast)
|
ErrorMessage(R.string.recaptcha_request_toast)
|
||||||
|
|
||||||
// test this at the end as many exceptions could be a subclass of IOException
|
// test this at the end as many exceptions could be a subclass of IOException
|
||||||
throwable != null && throwable.isNetworkRelated ->
|
throwable != null && throwable.isNetworkRelated ->
|
||||||
ErrorMessage(R.string.network_error)
|
ErrorMessage(R.string.network_error)
|
||||||
|
|
||||||
// an extraction exception unrelated to the network
|
// an extraction exception unrelated to the network
|
||||||
// is likely an issue with parsing the website
|
// is likely an issue with parsing the website
|
||||||
throwable is ExtractionException ->
|
throwable is ExtractionException ->
|
||||||
|
|
@ -256,16 +274,22 @@ class ErrorInfo private constructor(
|
||||||
// user actions (in case the exception is null or unrecognizable)
|
// user actions (in case the exception is null or unrecognizable)
|
||||||
action == UserAction.UI_ERROR ->
|
action == UserAction.UI_ERROR ->
|
||||||
ErrorMessage(R.string.app_ui_crash)
|
ErrorMessage(R.string.app_ui_crash)
|
||||||
|
|
||||||
action == UserAction.REQUESTED_COMMENTS ->
|
action == UserAction.REQUESTED_COMMENTS ->
|
||||||
ErrorMessage(R.string.error_unable_to_load_comments)
|
ErrorMessage(R.string.error_unable_to_load_comments)
|
||||||
|
|
||||||
action == UserAction.SUBSCRIPTION_CHANGE ->
|
action == UserAction.SUBSCRIPTION_CHANGE ->
|
||||||
ErrorMessage(R.string.subscription_change_failed)
|
ErrorMessage(R.string.subscription_change_failed)
|
||||||
|
|
||||||
action == UserAction.SUBSCRIPTION_UPDATE ->
|
action == UserAction.SUBSCRIPTION_UPDATE ->
|
||||||
ErrorMessage(R.string.subscription_update_failed)
|
ErrorMessage(R.string.subscription_update_failed)
|
||||||
|
|
||||||
action == UserAction.LOAD_IMAGE ->
|
action == UserAction.LOAD_IMAGE ->
|
||||||
ErrorMessage(R.string.could_not_load_thumbnails)
|
ErrorMessage(R.string.could_not_load_thumbnails)
|
||||||
|
|
||||||
action == UserAction.DOWNLOAD_OPEN_DIALOG ->
|
action == UserAction.DOWNLOAD_OPEN_DIALOG ->
|
||||||
ErrorMessage(R.string.could_not_setup_download_menu)
|
ErrorMessage(R.string.could_not_setup_download_menu)
|
||||||
|
|
||||||
else ->
|
else ->
|
||||||
ErrorMessage(R.string.error_snackbar_message)
|
ErrorMessage(R.string.error_snackbar_message)
|
||||||
}
|
}
|
||||||
|
|
@ -276,15 +300,19 @@ class ErrorInfo private constructor(
|
||||||
// we don't have an exception, so this is a manually built error, which likely
|
// we don't have an exception, so this is a manually built error, which likely
|
||||||
// indicates that it's important and is thus reportable
|
// indicates that it's important and is thus reportable
|
||||||
null -> true
|
null -> true
|
||||||
|
|
||||||
// the service explicitly said that content is not available (e.g. age restrictions,
|
// the service explicitly said that content is not available (e.g. age restrictions,
|
||||||
// video deleted, etc.), there is no use in letting users report it
|
// video deleted, etc.), there is no use in letting users report it
|
||||||
is ContentNotAvailableException -> false
|
is ContentNotAvailableException -> false
|
||||||
|
|
||||||
// we know the content is not supported, no need to let the user report it
|
// we know the content is not supported, no need to let the user report it
|
||||||
is ContentNotSupportedException -> false
|
is ContentNotSupportedException -> false
|
||||||
|
|
||||||
// happens often when there is no internet connection; we don't use
|
// happens often when there is no internet connection; we don't use
|
||||||
// `throwable.isNetworkRelated` since any `IOException` would make that function
|
// `throwable.isNetworkRelated` since any `IOException` would make that function
|
||||||
// return true, but not all `IOException`s are network related
|
// return true, but not all `IOException`s are network related
|
||||||
is UnknownHostException -> false
|
is UnknownHostException -> false
|
||||||
|
|
||||||
// by default, this is an unexpected exception, which the user could report
|
// by default, this is an unexpected exception, which the user could report
|
||||||
else -> true
|
else -> true
|
||||||
}
|
}
|
||||||
|
|
@ -294,8 +322,10 @@ class ErrorInfo private constructor(
|
||||||
return when (throwable) {
|
return when (throwable) {
|
||||||
// we know the content is not available, retrying won't help
|
// we know the content is not available, retrying won't help
|
||||||
is ContentNotAvailableException -> false
|
is ContentNotAvailableException -> false
|
||||||
|
|
||||||
// we know the content is not supported, retrying won't help
|
// we know the content is not supported, retrying won't help
|
||||||
is ContentNotSupportedException -> false
|
is ContentNotSupportedException -> false
|
||||||
|
|
||||||
// by default (including if throwable is null), enable retrying (though the retry
|
// by default (including if throwable is null), enable retrying (though the retry
|
||||||
// button will be shown only if a way to perform the retry is implemented)
|
// button will be shown only if a way to perform the retry is implemented)
|
||||||
else -> true
|
else -> true
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,7 @@ data class StreamItem(
|
||||||
viewsAndDate.isEmpty() -> uploadDate!!
|
viewsAndDate.isEmpty() -> uploadDate!!
|
||||||
else -> Localization.concatenateStrings(viewsAndDate, uploadDate)
|
else -> Localization.concatenateStrings(viewsAndDate, uploadDate)
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> viewsAndDate
|
else -> viewsAndDate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,9 +85,11 @@ class FeedLoadManager(private val context: Context) {
|
||||||
FeedGroupEntity.GROUP_ALL_ID -> feedDatabaseManager.outdatedSubscriptions(
|
FeedGroupEntity.GROUP_ALL_ID -> feedDatabaseManager.outdatedSubscriptions(
|
||||||
outdatedThreshold
|
outdatedThreshold
|
||||||
)
|
)
|
||||||
|
|
||||||
GROUP_NOTIFICATION_ENABLED -> feedDatabaseManager.outdatedSubscriptionsWithNotificationMode(
|
GROUP_NOTIFICATION_ENABLED -> feedDatabaseManager.outdatedSubscriptionsWithNotificationMode(
|
||||||
outdatedThreshold, NotificationMode.ENABLED
|
outdatedThreshold, NotificationMode.ENABLED
|
||||||
)
|
)
|
||||||
|
|
||||||
else -> feedDatabaseManager.outdatedSubscriptionsForGroup(groupId, outdatedThreshold)
|
else -> feedDatabaseManager.outdatedSubscriptionsForGroup(groupId, outdatedThreshold)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -305,6 +307,7 @@ class FeedLoadManager(private val context: Context) {
|
||||||
feedDatabaseManager.markAsOutdated(info.uid)
|
feedDatabaseManager.markAsOutdated(info.uid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
notification.isOnError -> {
|
notification.isOnError -> {
|
||||||
val error = notification.error
|
val error = notification.error
|
||||||
feedResultsHolder.addError(error!!)
|
feedResultsHolder.addError(error!!)
|
||||||
|
|
|
||||||
|
|
@ -276,10 +276,13 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
|
||||||
when (item) {
|
when (item) {
|
||||||
is FeedGroupCardItem ->
|
is FeedGroupCardItem ->
|
||||||
NavigationHelper.openFeedFragment(fm, item.groupId, item.name)
|
NavigationHelper.openFeedFragment(fm, item.groupId, item.name)
|
||||||
|
|
||||||
is FeedGroupCardGridItem ->
|
is FeedGroupCardGridItem ->
|
||||||
NavigationHelper.openFeedFragment(fm, item.groupId, item.name)
|
NavigationHelper.openFeedFragment(fm, item.groupId, item.name)
|
||||||
|
|
||||||
is FeedGroupAddNewItem ->
|
is FeedGroupAddNewItem ->
|
||||||
FeedGroupDialog.newInstance().show(fm, null)
|
FeedGroupDialog.newInstance().show(fm, null)
|
||||||
|
|
||||||
is FeedGroupAddNewGridItem ->
|
is FeedGroupAddNewGridItem ->
|
||||||
FeedGroupDialog.newInstance().show(fm, null)
|
FeedGroupDialog.newInstance().show(fm, null)
|
||||||
}
|
}
|
||||||
|
|
@ -294,6 +297,7 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
|
||||||
when (item) {
|
when (item) {
|
||||||
is FeedGroupCardItem ->
|
is FeedGroupCardItem ->
|
||||||
FeedGroupDialog.newInstance(item.groupId).show(fm, null)
|
FeedGroupDialog.newInstance(item.groupId).show(fm, null)
|
||||||
|
|
||||||
is FeedGroupCardGridItem ->
|
is FeedGroupCardGridItem ->
|
||||||
FeedGroupDialog.newInstance(item.groupId).show(fm, null)
|
FeedGroupDialog.newInstance(item.groupId).show(fm, null)
|
||||||
}
|
}
|
||||||
|
|
@ -344,7 +348,9 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
|
||||||
0 -> ShareUtils.shareText(
|
0 -> ShareUtils.shareText(
|
||||||
requireContext(), selectedItem.name, selectedItem.url, selectedItem.thumbnails
|
requireContext(), selectedItem.name, selectedItem.url, selectedItem.thumbnails
|
||||||
)
|
)
|
||||||
|
|
||||||
1 -> ShareUtils.openUrlInBrowser(requireContext(), selectedItem.url)
|
1 -> ShareUtils.openUrlInBrowser(requireContext(), selectedItem.url)
|
||||||
|
|
||||||
2 -> deleteChannel(selectedItem)
|
2 -> deleteChannel(selectedItem)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -404,6 +410,7 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
|
||||||
itemsListState = null
|
itemsListState = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
is SubscriptionState.ErrorState -> {
|
is SubscriptionState.ErrorState -> {
|
||||||
result.error?.let {
|
result.error?.let {
|
||||||
showError(ErrorInfo(result.error, UserAction.SOMETHING_ELSE, "Subscriptions"))
|
showError(ErrorInfo(result.error, UserAction.SOMETHING_ELSE, "Subscriptions"))
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,9 @@ class SubscriptionManager(context: Context) {
|
||||||
subscriptionTable.getSubscriptionsFiltered(filterQuery)
|
subscriptionTable.getSubscriptionsFiltered(filterQuery)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
showOnlyUngrouped -> subscriptionTable.getSubscriptionsOnlyUngrouped(currentGroupId)
|
showOnlyUngrouped -> subscriptionTable.getSubscriptionsOnlyUngrouped(currentGroupId)
|
||||||
|
|
||||||
else -> subscriptionTable.getAll()
|
else -> subscriptionTable.getAll()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,10 +42,12 @@ class MainPlayerGestureListener(
|
||||||
v.parent?.requestDisallowInterceptTouchEvent(playerUi.isFullscreen)
|
v.parent?.requestDisallowInterceptTouchEvent(playerUi.isFullscreen)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
MotionEvent.ACTION_UP -> {
|
MotionEvent.ACTION_UP -> {
|
||||||
v.parent?.requestDisallowInterceptTouchEvent(false)
|
v.parent?.requestDisallowInterceptTouchEvent(false)
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> true
|
else -> true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -198,6 +200,7 @@ class MainPlayerGestureListener(
|
||||||
when (PlayerHelper.getActionForRightGestureSide(player.context)) {
|
when (PlayerHelper.getActionForRightGestureSide(player.context)) {
|
||||||
player.context.getString(R.string.volume_control_key) ->
|
player.context.getString(R.string.volume_control_key) ->
|
||||||
onScrollVolume(distanceY)
|
onScrollVolume(distanceY)
|
||||||
|
|
||||||
player.context.getString(R.string.brightness_control_key) ->
|
player.context.getString(R.string.brightness_control_key) ->
|
||||||
onScrollBrightness(distanceY)
|
onScrollBrightness(distanceY)
|
||||||
}
|
}
|
||||||
|
|
@ -205,6 +208,7 @@ class MainPlayerGestureListener(
|
||||||
when (PlayerHelper.getActionForLeftGestureSide(player.context)) {
|
when (PlayerHelper.getActionForLeftGestureSide(player.context)) {
|
||||||
player.context.getString(R.string.volume_control_key) ->
|
player.context.getString(R.string.volume_control_key) ->
|
||||||
onScrollVolume(distanceY)
|
onScrollVolume(distanceY)
|
||||||
|
|
||||||
player.context.getString(R.string.brightness_control_key) ->
|
player.context.getString(R.string.brightness_control_key) ->
|
||||||
onScrollBrightness(distanceY)
|
onScrollBrightness(distanceY)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,10 +94,13 @@ internal class PackageValidator(context: Context) {
|
||||||
val isCallerKnown = when {
|
val isCallerKnown = when {
|
||||||
// If it's our own app making the call, allow it.
|
// If it's our own app making the call, allow it.
|
||||||
callingUid == Process.myUid() -> true
|
callingUid == Process.myUid() -> true
|
||||||
|
|
||||||
// If the system is making the call, allow it.
|
// If the system is making the call, allow it.
|
||||||
callingUid == Process.SYSTEM_UID -> true
|
callingUid == Process.SYSTEM_UID -> true
|
||||||
|
|
||||||
// If the app was signed by the same certificate as the platform itself, also allow it.
|
// If the app was signed by the same certificate as the platform itself, also allow it.
|
||||||
callerSignature == platformSignature -> true
|
callerSignature == platformSignature -> true
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* [MEDIA_CONTENT_CONTROL] permission is only available to system applications, and
|
* [MEDIA_CONTENT_CONTROL] permission is only available to system applications, and
|
||||||
* while it isn't required to allow these apps to connect to a
|
* while it isn't required to allow these apps to connect to a
|
||||||
|
|
@ -105,6 +108,7 @@ internal class PackageValidator(context: Context) {
|
||||||
* such as Android TV and the Google Assistant.
|
* such as Android TV and the Google Assistant.
|
||||||
*/
|
*/
|
||||||
callerPackageInfo.permissions.contains(MEDIA_CONTENT_CONTROL) -> true
|
callerPackageInfo.permissions.contains(MEDIA_CONTENT_CONTROL) -> true
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the calling app has a notification listener it is able to retrieve notifications
|
* If the calling app has a notification listener it is able to retrieve notifications
|
||||||
* and can connect to an active [MediaSessionCompat].
|
* and can connect to an active [MediaSessionCompat].
|
||||||
|
|
|
||||||
|
|
@ -122,10 +122,15 @@ class ImportExportManager(private val fileLocator: BackupFileLocator) {
|
||||||
for ((key, value) in entries) {
|
for ((key, value) in entries) {
|
||||||
when (value) {
|
when (value) {
|
||||||
is Boolean -> editor.putBoolean(key, value)
|
is Boolean -> editor.putBoolean(key, value)
|
||||||
|
|
||||||
is Float -> editor.putFloat(key, value)
|
is Float -> editor.putFloat(key, value)
|
||||||
|
|
||||||
is Int -> editor.putInt(key, value)
|
is Int -> editor.putInt(key, value)
|
||||||
|
|
||||||
is Long -> editor.putLong(key, value)
|
is Long -> editor.putLong(key, value)
|
||||||
|
|
||||||
is String -> editor.putString(key, value)
|
is String -> editor.putString(key, value)
|
||||||
|
|
||||||
is Set<*> -> {
|
is Set<*> -> {
|
||||||
// There are currently only Sets with type String possible
|
// There are currently only Sets with type String possible
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
|
@ -159,10 +164,15 @@ class ImportExportManager(private val fileLocator: BackupFileLocator) {
|
||||||
for ((key, value) in jsonObject) {
|
for ((key, value) in jsonObject) {
|
||||||
when (value) {
|
when (value) {
|
||||||
is Boolean -> editor.putBoolean(key, value)
|
is Boolean -> editor.putBoolean(key, value)
|
||||||
|
|
||||||
is Float -> editor.putFloat(key, value)
|
is Float -> editor.putFloat(key, value)
|
||||||
|
|
||||||
is Int -> editor.putInt(key, value)
|
is Int -> editor.putInt(key, value)
|
||||||
|
|
||||||
is Long -> editor.putLong(key, value)
|
is Long -> editor.putLong(key, value)
|
||||||
|
|
||||||
is String -> editor.putString(key, value)
|
is String -> editor.putString(key, value)
|
||||||
|
|
||||||
is JsonArray -> {
|
is JsonArray -> {
|
||||||
editor.putStringSet(key, value.mapNotNull { e -> e as? String }.toSet())
|
editor.putStringSet(key, value.mapNotNull { e -> e as? String }.toSet())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ class NotificationModeConfigFragment : Fragment() {
|
||||||
toggleAll()
|
toggleAll()
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> super.onOptionsItemSelected(item)
|
else -> super.onOptionsItemSelected(item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ object ImageStrategy {
|
||||||
// the same number for those.
|
// the same number for those.
|
||||||
val finalComparator = when (nonNoneQuality) {
|
val finalComparator = when (nonNoneQuality) {
|
||||||
PreferredImageQuality.NONE -> initialComparator
|
PreferredImageQuality.NONE -> initialComparator
|
||||||
|
|
||||||
PreferredImageQuality.LOW -> initialComparator.thenComparingDouble { image ->
|
PreferredImageQuality.LOW -> initialComparator.thenComparingDouble { image ->
|
||||||
val pixelCount = estimatePixelCount(image, widthOverHeight)
|
val pixelCount = estimatePixelCount(image, widthOverHeight)
|
||||||
abs(pixelCount - BEST_LOW_H * BEST_LOW_H * widthOverHeight)
|
abs(pixelCount - BEST_LOW_H * BEST_LOW_H * widthOverHeight)
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,9 @@ object PoTokenProviderImpl : PoTokenProvider {
|
||||||
webViewBadImpl = true
|
webViewBadImpl = true
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
null -> throw e
|
null -> throw e
|
||||||
|
|
||||||
else -> throw cause // includes PoTokenException
|
else -> throw cause // includes PoTokenException
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,8 +53,10 @@ class TimestampLongPressClickableSpan(
|
||||||
when (relatedInfoService) {
|
when (relatedInfoService) {
|
||||||
ServiceList.YouTube ->
|
ServiceList.YouTube ->
|
||||||
return relatedStreamUrl + "&t=" + timestampMatchDTO.seconds()
|
return relatedStreamUrl + "&t=" + timestampMatchDTO.seconds()
|
||||||
|
|
||||||
ServiceList.SoundCloud, ServiceList.MediaCCC ->
|
ServiceList.SoundCloud, ServiceList.MediaCCC ->
|
||||||
return relatedStreamUrl + "#t=" + timestampMatchDTO.seconds()
|
return relatedStreamUrl + "#t=" + timestampMatchDTO.seconds()
|
||||||
|
|
||||||
ServiceList.PeerTube ->
|
ServiceList.PeerTube ->
|
||||||
return relatedStreamUrl + "?start=" + timestampMatchDTO.seconds()
|
return relatedStreamUrl + "?start=" + timestampMatchDTO.seconds()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,16 +25,19 @@ class MissionRecoveryInfo(
|
||||||
isDesired2 = false
|
isDesired2 = false
|
||||||
kind = 'a'
|
kind = 'a'
|
||||||
}
|
}
|
||||||
|
|
||||||
is VideoStream -> {
|
is VideoStream -> {
|
||||||
desired = stream.getResolution()
|
desired = stream.getResolution()
|
||||||
isDesired2 = stream.isVideoOnly()
|
isDesired2 = stream.isVideoOnly()
|
||||||
kind = 'v'
|
kind = 'v'
|
||||||
}
|
}
|
||||||
|
|
||||||
is SubtitlesStream -> {
|
is SubtitlesStream -> {
|
||||||
desired = stream.languageTag
|
desired = stream.languageTag
|
||||||
isDesired2 = stream.isAutoGenerated
|
isDesired2 = stream.isAutoGenerated
|
||||||
kind = 's'
|
kind = 's'
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> throw RuntimeException("Unknown stream kind")
|
else -> throw RuntimeException("Unknown stream kind")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -48,14 +51,17 @@ class MissionRecoveryInfo(
|
||||||
str.append("audio")
|
str.append("audio")
|
||||||
info = "bitrate=$desiredBitrate"
|
info = "bitrate=$desiredBitrate"
|
||||||
}
|
}
|
||||||
|
|
||||||
'v' -> {
|
'v' -> {
|
||||||
str.append("video")
|
str.append("video")
|
||||||
info = "quality=$desired videoOnly=$isDesired2"
|
info = "quality=$desired videoOnly=$isDesired2"
|
||||||
}
|
}
|
||||||
|
|
||||||
's' -> {
|
's' -> {
|
||||||
str.append("subtitles")
|
str.append("subtitles")
|
||||||
info = "language=$desired autoGenerated=$isDesired2"
|
info = "language=$desired autoGenerated=$isDesired2"
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
info = ""
|
info = ""
|
||||||
str.append("other")
|
str.append("other")
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,7 @@ class ImportAllCombinationsTest {
|
||||||
Mockito.verify(editor, Mockito.atLeastOnce())
|
Mockito.verify(editor, Mockito.atLeastOnce())
|
||||||
.putInt(Mockito.anyString(), Mockito.anyInt())
|
.putInt(Mockito.anyString(), Mockito.anyInt())
|
||||||
}
|
}
|
||||||
|
|
||||||
Ser.VULNERABLE -> runTest {
|
Ser.VULNERABLE -> runTest {
|
||||||
Assert.assertTrue(ImportExportManager(fileLocator).exportHasSerializedPrefs(zip))
|
Assert.assertTrue(ImportExportManager(fileLocator).exportHasSerializedPrefs(zip))
|
||||||
Assert.assertThrows(ClassNotFoundException::class.java) {
|
Assert.assertThrows(ClassNotFoundException::class.java) {
|
||||||
|
|
@ -102,6 +103,7 @@ class ImportAllCombinationsTest {
|
||||||
Mockito.verify(editor, Mockito.never()).clear()
|
Mockito.verify(editor, Mockito.never()).clear()
|
||||||
Mockito.verify(editor, Mockito.never()).commit()
|
Mockito.verify(editor, Mockito.never()).commit()
|
||||||
}
|
}
|
||||||
|
|
||||||
Ser.NO -> runTest {
|
Ser.NO -> runTest {
|
||||||
Assert.assertFalse(ImportExportManager(fileLocator).exportHasSerializedPrefs(zip))
|
Assert.assertFalse(ImportExportManager(fileLocator).exportHasSerializedPrefs(zip))
|
||||||
Assert.assertThrows(IOException::class.java) {
|
Assert.assertThrows(IOException::class.java) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue