Skip to content

Commit

Permalink
Use audiobooks 13.0.0-beta0016, correct LCP book deletion.
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed Jun 10, 2024
1 parent 005a505 commit b5954f7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
2 changes: 1 addition & 1 deletion org.thepalaceproject.android.platform
Original file line number Diff line number Diff line change
Expand Up @@ -147,23 +147,6 @@ internal class DatabaseFormatHandleAudioBook internal constructor(
}

override fun deleteBookData() {
val newFormat = synchronized(this.dataLock) {
FileUtilities.fileDelete(this.filePosition)

if (this.fileBook.isDirectory) {
DirectoryUtilities.directoryDelete(this.fileBook)
} else {
FileUtilities.fileDelete(this.fileBook)
}

this.formatRef = this.formatRef.copy(
file = null,
lastReadLocation = null
)

this.formatRef
}

val briefID = this.parameters.bookID.brief()

this.log.debug("[{}]: deleting audio book data", briefID)
Expand Down Expand Up @@ -237,11 +220,25 @@ internal class DatabaseFormatHandleAudioBook internal constructor(
}
}
} catch (ex: Exception) {
this.log.error("[{}]: failed to delete audio book: ", briefID, ex)
throw ex
this.log.error("[{}]: Problem deleting audio book: ", briefID, ex)
}

this.parameters.onUpdated.invoke(newFormat)
this.parameters.onUpdated.invoke(synchronized(dataLock) {
FileUtilities.fileDelete(filePosition)

if (fileBook.isDirectory) {
DirectoryUtilities.directoryDelete(fileBook)
} else {
FileUtilities.fileDelete(fileBook)
}

formatRef = formatRef.copy(
file = null,
lastReadLocation = null
)

formatRef
})
}

override fun deleteBookmark(bookmarkId: BookmarkID) {
Expand Down

0 comments on commit b5954f7

Please sign in to comment.