mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 10:13:39 +00:00
Minor cleanup.
This commit is contained in:
parent
b6d8898ff9
commit
04c132853a
@ -116,15 +116,13 @@ class PrepareAttachmentAudioExtrasJob : BaseJob {
|
||||
}
|
||||
}
|
||||
|
||||
val audioExtras = DatabaseAttachmentAudioExtras(
|
||||
attachDb.setAttachmentAudioExtras(DatabaseAttachmentAudioExtras(
|
||||
attachmentId,
|
||||
rmsValues,
|
||||
totalDurationMs
|
||||
)
|
||||
))
|
||||
|
||||
attachDb.setAttachmentAudioExtras(audioExtras)
|
||||
|
||||
EventBus.getDefault().post(AudioExtrasUpdatedEvent(audioExtras))
|
||||
EventBus.getDefault().post(AudioExtrasUpdatedEvent(attachmentIdattachmentId))
|
||||
}
|
||||
|
||||
class Factory : Job.Factory<PrepareAttachmentAudioExtrasJob> {
|
||||
@ -133,8 +131,8 @@ class PrepareAttachmentAudioExtrasJob : BaseJob {
|
||||
}
|
||||
}
|
||||
|
||||
/** Dispatched once the audio extras have been updated. */
|
||||
data class AudioExtrasUpdatedEvent(val audioExtras: DatabaseAttachmentAudioExtras)
|
||||
/** Gets dispatched once the audio extras have been updated. */
|
||||
data class AudioExtrasUpdatedEvent(val attachmentId: AttachmentId)
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.M)
|
||||
private class InputStreamMediaDataSource: MediaDataSource {
|
||||
|
@ -290,7 +290,7 @@ class MessageAudioView: FrameLayout, AudioSlidePlayer.Listener {
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onEvent(event: PrepareAttachmentAudioExtrasJob.AudioExtrasUpdatedEvent) {
|
||||
if (event.audioExtras.attachmentId == obtainDatabaseAttachment()?.attachmentId) {
|
||||
if (event.attachmentId == obtainDatabaseAttachment()?.attachmentId) {
|
||||
updateFromAttachmentAudioExtras()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user