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