Fix moar ktlint issues
This commit is contained in:
parent
a831f05f6e
commit
5d086ad82d
528 changed files with 146 additions and 629 deletions
|
|
@ -30,7 +30,6 @@ class MediaSender @Inject constructor(
|
|||
private val preProcessor: MediaPreProcessor,
|
||||
private val room: MatrixRoom,
|
||||
) {
|
||||
|
||||
private val ongoingUploadJobs = ConcurrentHashMap<Job.Key, MediaUploadHandler>()
|
||||
val hasOngoingMediaUploads get() = ongoingUploadJobs.isNotEmpty()
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import io.element.android.libraries.matrix.api.media.VideoInfo
|
|||
import java.io.File
|
||||
|
||||
sealed interface MediaUploadInfo {
|
||||
|
||||
val file: File
|
||||
|
||||
data class Image(override val file: File, val imageInfo: ImageInfo, val thumbnailFile: File?) : MediaUploadInfo
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ import org.robolectric.RobolectricTestRunner
|
|||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
class MediaSenderTests {
|
||||
|
||||
@Test
|
||||
fun `given an attachment when sending it the preprocessor always runs`() = runTest {
|
||||
val preProcessor = FakeMediaPreProcessor()
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ class ThumbnailFactory @Inject constructor(
|
|||
@ApplicationContext private val context: Context,
|
||||
private val sdkIntProvider: BuildVersionSdkIntProvider
|
||||
) {
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
suspend fun createImageThumbnail(file: File): ThumbnailResult? {
|
||||
return createThumbnail { cancellationSignal ->
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ import javax.inject.Inject
|
|||
class VideoCompressor @Inject constructor(
|
||||
@ApplicationContext private val context: Context,
|
||||
) {
|
||||
|
||||
fun compress(uri: Uri) = callbackFlow {
|
||||
val tmpFile = context.createTmpFile(extension = "mp4")
|
||||
val future = Transcoder.into(tmpFile.path)
|
||||
|
|
|
|||
|
|
@ -230,7 +230,8 @@ class AndroidMediaPreProcessorTest {
|
|||
assertThat(info.thumbnailFile).isNotNull()
|
||||
assertThat(info.videoInfo).isEqualTo(
|
||||
VideoInfo(
|
||||
duration = Duration.ZERO, // Not available with Robolectric?
|
||||
// Not available with Robolectric?
|
||||
duration = Duration.ZERO,
|
||||
height = 1_178,
|
||||
width = 1_818,
|
||||
mimetype = MimeTypes.Mp4,
|
||||
|
|
@ -260,9 +261,12 @@ class AndroidMediaPreProcessorTest {
|
|||
assertThat(info.thumbnailFile).isNull()
|
||||
assertThat(info.videoInfo).isEqualTo(
|
||||
VideoInfo(
|
||||
duration = Duration.ZERO, // Not available with Robolectric?
|
||||
height = 0, // Not available with Robolectric?
|
||||
width = 0, // Not available with Robolectric?
|
||||
// Not available with Robolectric?
|
||||
duration = Duration.ZERO,
|
||||
// Not available with Robolectric?
|
||||
height = 0,
|
||||
// Not available with Robolectric?
|
||||
width = 0,
|
||||
mimetype = MimeTypes.Mp4,
|
||||
size = 1_673_712,
|
||||
thumbnailInfo = null,
|
||||
|
|
@ -288,7 +292,8 @@ class AndroidMediaPreProcessorTest {
|
|||
val info = result as MediaUploadInfo.Audio
|
||||
assertThat(info.audioInfo).isEqualTo(
|
||||
AudioInfo(
|
||||
duration = Duration.ZERO, // Not available with Robolectric?
|
||||
// Not available with Robolectric?
|
||||
duration = Duration.ZERO,
|
||||
size = 52_079,
|
||||
mimetype = MimeTypes.Mp3,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ import java.io.File
|
|||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
class FakeMediaPreProcessor : MediaPreProcessor {
|
||||
|
||||
var processCallCount = 0
|
||||
private set
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue