Autoformat DeviceClasses.kt

This commit is contained in:
Nicholas Wallace
2025-04-14 19:08:17 -07:00
parent 76c4ec542b
commit 0347e18d5b
2 changed files with 140 additions and 111 deletions
@@ -9,27 +9,41 @@ import com.fasterxml.jackson.annotation.JsonSubTypes
import com.fasterxml.jackson.annotation.JsonTypeInfo
enum class LockOrientationSetting {
NONE, PORTRAIT, LANDSCAPE
NONE,
PORTRAIT,
LANDSCAPE
}
enum class HapticFeedbackSetting {
OFF, LIGHT, MEDIUM, HEAVY
OFF,
LIGHT,
MEDIUM,
HEAVY
}
enum class ShakeSensitivitySetting {
VERY_LOW, LOW, MEDIUM, HIGH, VERY_HIGH
VERY_LOW,
LOW,
MEDIUM,
HIGH,
VERY_HIGH
}
enum class DownloadUsingCellularSetting {
ASK, ALWAYS, NEVER
ASK,
ALWAYS,
NEVER
}
enum class StreamingUsingCellularSetting {
ASK, ALWAYS, NEVER
ASK,
ALWAYS,
NEVER
}
enum class AndroidAutoBrowseSeriesSequenceOrderSetting {
ASC, DESC
ASC,
DESC
}
data class ServerConnectionConfig(
@@ -89,13 +103,15 @@ data class LocalFolder(
)
@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION)
@JsonSubTypes(
JsonSubTypes.Type(LibraryItem::class),
JsonSubTypes.Type(LocalLibraryItem::class)
)
@JsonSubTypes(JsonSubTypes.Type(LibraryItem::class), JsonSubTypes.Type(LocalLibraryItem::class))
open class LibraryItemWrapper(var id: String) {
@JsonIgnore
open fun getMediaDescription(progress:MediaProgressWrapper?, ctx: Context): MediaDescriptionCompat { return MediaDescriptionCompat.Builder().build() }
open fun getMediaDescription(
progress: MediaProgressWrapper?,
ctx: Context
): MediaDescriptionCompat {
return MediaDescriptionCompat.Builder().build()
}
}
@JsonIgnoreProperties(ignoreUnknown = true)
@@ -173,18 +189,23 @@ data class DeviceSettings(
}
@get:JsonIgnore
val jumpBackwardsTimeMs get() = jumpBackwardsTime * 1000L
val jumpBackwardsTimeMs
get() = jumpBackwardsTime * 1000L
@get:JsonIgnore
val jumpForwardTimeMs get() = jumpForwardTime * 1000L
val jumpForwardTimeMs
get() = jumpForwardTime * 1000L
@get:JsonIgnore
val autoSleepTimerStartHour get() = autoSleepTimerStartTime.split(":")[0].toInt()
val autoSleepTimerStartHour
get() = autoSleepTimerStartTime.split(":")[0].toInt()
@get:JsonIgnore
val autoSleepTimerStartMinute get() = autoSleepTimerStartTime.split(":")[1].toInt()
val autoSleepTimerStartMinute
get() = autoSleepTimerStartTime.split(":")[1].toInt()
@get:JsonIgnore
val autoSleepTimerEndHour get() = autoSleepTimerEndTime.split(":")[0].toInt()
val autoSleepTimerEndHour
get() = autoSleepTimerEndTime.split(":")[0].toInt()
@get:JsonIgnore
val autoSleepTimerEndMinute get() = autoSleepTimerEndTime.split(":")[1].toInt()
val autoSleepTimerEndMinute
get() = autoSleepTimerEndTime.split(":")[1].toInt()
@JsonIgnore
fun getShakeThresholdGravity(): Float { // Used in ShakeDetector
@@ -213,4 +234,3 @@ data class DeviceData(
}
}
}
@@ -78,7 +78,7 @@ class FolderScanner(var ctx: Context) {
Uri.fromFile(file).toString(),
file.getBasePath(ctx),
file.absolutePath,
file.getSimplePath(ctx),
// file.getSimplePath(ctx),
file.mimeType,
file.length()
)
@@ -329,6 +329,15 @@ class FolderScanner(var ctx: Context) {
val itemPart =
downloadItem.downloadItemParts.find { itemPart -> itemPart.filename == docFile.name }
// val fileUri = docFile.uri.toString()
// val fileBasePath = docFile.getBasePath(ctx)
// val fileAbsolutePath = docFile.getAbsolutePath(ctx)
// val fileSimplePath = docFile.getSimplePath(ctx)
// val fileMimeType = docFile.mimeType
// val fileLength = docFile.length()
// val fileName = docFile.name
// val fileExtension = docFile.extension
// Build local file object
val localFileId = DeviceManager.getBase64Id(docFile.id)
val localFile =
@@ -338,7 +347,7 @@ class FolderScanner(var ctx: Context) {
docFile.uri.toString(),
docFile.getBasePath(ctx),
docFile.getAbsolutePath(ctx),
docFile.getSimplePath(ctx),
// docFile.getSimplePath(ctx),
docFile.mimeType,
docFile.length()
)