mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-04-12 15:37:17 +03:00
Merge branch 'formatting' into 'develop'
Formatting See merge request ultrasonic/ultrasonic!840
This commit is contained in:
commit
4ca01d3afc
@ -2,7 +2,6 @@ build:
|
||||
maxIssues: 0
|
||||
weights:
|
||||
complexity: 2
|
||||
formatting: 1
|
||||
LongParameterList: 1
|
||||
comments: 1
|
||||
|
||||
@ -49,18 +48,13 @@ complexity:
|
||||
LabeledExpression:
|
||||
active: false
|
||||
|
||||
|
||||
formatting:
|
||||
autoCorrect: true
|
||||
active: false
|
||||
|
||||
style:
|
||||
active: true
|
||||
NewLineAtEndOfFile:
|
||||
active: true
|
||||
ForbiddenComment:
|
||||
active: true
|
||||
values: 'FIXME:,STOPSHIP:'
|
||||
values: ['FIXME:', 'STOPSHIP:']
|
||||
WildcardImport:
|
||||
active: true
|
||||
MaxLineLength:
|
||||
|
@ -9,11 +9,11 @@ package org.moire.ultrasonic.util
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import androidx.preference.PreferenceDialogFragmentCompat
|
||||
import androidx.preference.DialogPreference.TargetFragment
|
||||
import androidx.preference.Preference
|
||||
import org.moire.ultrasonic.R
|
||||
import androidx.preference.PreferenceDialogFragmentCompat
|
||||
import java.util.Locale
|
||||
import org.moire.ultrasonic.R
|
||||
|
||||
class TimeSpanPreferenceDialogFragmentCompat : PreferenceDialogFragmentCompat(), TargetFragment {
|
||||
var picker: TimeSpanPicker? = null
|
||||
@ -55,4 +55,4 @@ class TimeSpanPreferenceDialogFragmentCompat : PreferenceDialogFragmentCompat(),
|
||||
override fun <T : Preference?> findPreference(p0: CharSequence): T {
|
||||
return preference as T
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ import org.moire.ultrasonic.R
|
||||
import org.moire.ultrasonic.audiofx.EqualizerController
|
||||
import org.moire.ultrasonic.fragment.FragmentTitle.Companion.setTitle
|
||||
import org.moire.ultrasonic.util.Util.applyTheme
|
||||
import org.w3c.dom.Text
|
||||
import timber.log.Timber
|
||||
|
||||
/**
|
||||
|
@ -18,7 +18,6 @@ import android.text.style.ForegroundColorSpan
|
||||
import android.text.style.StyleSpan
|
||||
import android.view.View
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.preference.CheckBoxPreference
|
||||
import androidx.preference.EditTextPreference
|
||||
import androidx.preference.ListPreference
|
||||
|
@ -272,19 +272,19 @@ class SharesFragment : Fragment() {
|
||||
Entry Count: ${share.getEntries().size}
|
||||
Visit Count: ${share.visitCount}
|
||||
""".trimIndent() +
|
||||
(
|
||||
if (share.created == null) "" else """
|
||||
(
|
||||
if (share.created == null) "" else """
|
||||
|
||||
Creation Date: ${share.created!!.replace('T', ' ')}
|
||||
""".trimIndent()
|
||||
) +
|
||||
(
|
||||
if (share.lastVisited == null) "" else """
|
||||
) +
|
||||
(
|
||||
if (share.lastVisited == null) "" else """
|
||||
|
||||
Last Visited Date: ${share.lastVisited!!.replace('T', ' ')}
|
||||
""".trimIndent()
|
||||
) +
|
||||
if (share.expires == null) "" else """
|
||||
) +
|
||||
if (share.expires == null) "" else """
|
||||
|
||||
Expiration Date: ${share.expires!!.replace('T', ' ')}
|
||||
""".trimIndent()
|
||||
|
@ -11,7 +11,6 @@ import android.annotation.SuppressLint
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.BitmapFactory
|
||||
import android.net.Uri
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import androidx.media3.session.BitmapLoader
|
||||
import com.google.common.util.concurrent.ListenableFuture
|
||||
import com.google.common.util.concurrent.ListeningExecutorService
|
||||
@ -54,7 +53,8 @@ class ArtworkBitmapLoader : BitmapLoader, KoinComponent {
|
||||
@Throws(IOException::class)
|
||||
private fun load(uri: Uri): Bitmap {
|
||||
val parts = uri.path?.trim('/')?.split('|')
|
||||
if (parts?.count() != 2) throw IllegalArgumentException("Invalid bitmap Uri")
|
||||
|
||||
require(parts!!.count() == 2) { "Invalid bitmap Uri" }
|
||||
return imageLoader.getImage(parts[0], parts[1], false, 0)
|
||||
}
|
||||
}
|
||||
|
@ -159,16 +159,15 @@ class CachedDataSource(
|
||||
bytesTransferred(read)
|
||||
}
|
||||
return
|
||||
} catch (e: IOException) {
|
||||
if (e is HttpDataSourceException) {
|
||||
throw e
|
||||
} else {
|
||||
throw HttpDataSourceException(
|
||||
dataSpec,
|
||||
PlaybackException.ERROR_CODE_IO_UNSPECIFIED,
|
||||
HttpDataSourceException.TYPE_OPEN
|
||||
)
|
||||
}
|
||||
|
||||
} catch (e: HttpDataSourceException) {
|
||||
throw e
|
||||
} catch (ignored: IOException) {
|
||||
throw HttpDataSourceException(
|
||||
dataSpec,
|
||||
PlaybackException.ERROR_CODE_IO_UNSPECIFIED,
|
||||
HttpDataSourceException.TYPE_OPEN
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -280,9 +280,7 @@ open class RESTMusicService(
|
||||
name: String?,
|
||||
tracks: List<Track>
|
||||
) {
|
||||
if (id == null && name == null)
|
||||
throw IllegalArgumentException("Either id or name is required.")
|
||||
|
||||
require(id != null || name != null) { "Either id or name is required." }
|
||||
val pSongIds: MutableList<String> = ArrayList(tracks.size)
|
||||
|
||||
for ((id1) in tracks) {
|
||||
@ -488,7 +486,7 @@ open class RESTMusicService(
|
||||
return url.toString()
|
||||
}
|
||||
|
||||
val streamClient by lazy {
|
||||
private val streamClient by lazy {
|
||||
// Create a new modified okhttp client to intercept the URL
|
||||
val builder = subsonicAPIClient.okHttpClient.newBuilder()
|
||||
|
||||
|
@ -241,6 +241,7 @@ class DownloadHandler(
|
||||
return songs
|
||||
}
|
||||
|
||||
@Suppress("DestructuringDeclarationWithTooManyEntries")
|
||||
@Throws(Exception::class)
|
||||
private fun getSongsRecursively(
|
||||
parent: MusicDirectory,
|
||||
|
@ -19,7 +19,6 @@ import org.moire.ultrasonic.app.UApp
|
||||
*/
|
||||
object Settings {
|
||||
|
||||
|
||||
@JvmStatic
|
||||
var theme by StringSetting(
|
||||
getKey(R.string.setting_key_theme),
|
||||
|
@ -38,7 +38,6 @@ import android.widget.Toast
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.annotation.AnyRes
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.common.MediaItem
|
||||
|
Loading…
x
Reference in New Issue
Block a user