Skip to content

Commit

Permalink
- Crashalitycs
Browse files Browse the repository at this point in the history
  • Loading branch information
mkaflowski committed Oct 18, 2024
1 parent 8291886 commit f687ea9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
applicationId = "kaf.audiobookshelfwearos"
minSdk = 26
targetSdk = 33
versionCode = 9
versionName = "1.6"
versionCode = 11
versionName = "1.8"
vectorDrawables {
useSupportLibrary = true
}
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/kaf/audiobookshelfwearos/app/ApiHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ class ApiHandler(private val context: Context) {

try {
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) showToast(response.code.toString())
if (!response.isSuccessful) Timber.d("code: " + response.code)
return@use BitmapFactory.decodeStream(response.body!!.byteStream())
}
} catch (e: SocketTimeoutException) {
null
}catch (e: ConnectException){
} catch (e: ConnectException) {
FirebaseCrashlytics.getInstance().log("Handled cover error")
FirebaseCrashlytics.getInstance().recordException(e)
showToast(e.message.toString())
Expand Down Expand Up @@ -110,7 +110,7 @@ class ApiHandler(private val context: Context) {
}
} catch (e: SocketTimeoutException) {
return@withContext null
}catch (e: Exception){
} catch (e: Exception) {
FirebaseCrashlytics.getInstance().log("Handled item error")
FirebaseCrashlytics.getInstance().recordException(e)
showToast(e.message.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@ data class LibraryItem(
val progressLastUpdate: Long = 0
) {
var title: String
get() = media.metadata.title
get() = media.metadata.title ?: "Unknown Title"
set(value) {
media.metadata.title = value
}

var author: String
get() = media.metadata.authorName
get() = media.metadata.authorName ?: "Unknown Author"
set(value) {
media.metadata.authorName = value
if (value != null) {
media.metadata.authorName = value
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties

@JsonIgnoreProperties(ignoreUnknown = true)
data class Metadata(
var title: String = "",
var title: String? = "",
val titleIgnorePrefix: String? = "",
val subtitle: String? = "",
var authorName: String = "",
var authorName: String? = "",
val narratorName: String? = "",
val seriesName: String? = "",
val genres: List<String> = emptyList(),
Expand Down

0 comments on commit f687ea9

Please sign in to comment.