Apply ktlintFormat

Tool output only, no hand edits, so this is safe to read with whitespace
diffing off. It is its own commit for exactly that reason: a whole-repo
reformat folded into the commit that configured the formatter would have
made both unreviewable.

What it did, mostly: trailing commas on wrapped argument lists, signatures
collapsed onto one line where they fit inside 120 columns, import order, and
four genuinely unused imports removed. Unit tests pass unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-22 14:10:44 -05:00
co-authored by Claude Opus 5
parent 93b1fbd5a9
commit 496f1c7e73
35 changed files with 327 additions and 304 deletions
@@ -1,17 +1,17 @@
package org.libremediaconverter.ffmpeg
import org.libremediaconverter.model.Container
import org.libremediaconverter.model.ConversionRequest
import org.libremediaconverter.model.InputProbe
import org.libremediaconverter.model.OutputFormat
import org.libremediaconverter.model.AudioCodec
import org.libremediaconverter.model.OutputSpec
import org.libremediaconverter.model.VideoCodec
import org.libremediaconverter.model.QualityTier
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
import org.libremediaconverter.model.AudioCodec
import org.libremediaconverter.model.Container
import org.libremediaconverter.model.ConversionRequest
import org.libremediaconverter.model.InputProbe
import org.libremediaconverter.model.OutputFormat
import org.libremediaconverter.model.OutputSpec
import org.libremediaconverter.model.QualityTier
import org.libremediaconverter.model.VideoCodec
class FFmpegCommandBuilderTest {
@@ -94,8 +94,10 @@ class FFmpegCommandBuilderTest {
@Test
fun `every video encode path forces yuv420p`() {
val videoFormats = listOf(
OutputFormat.MP4_H264, OutputFormat.MP4_H265,
OutputFormat.MKV_H264, OutputFormat.MKV_H265,
OutputFormat.MP4_H264,
OutputFormat.MP4_H265,
OutputFormat.MKV_H264,
OutputFormat.MKV_H265,
OutputFormat.WEBM_VP9,
)
videoFormats.forEach { format ->
@@ -1,11 +1,11 @@
package org.libremediaconverter.ffmpeg
import org.libremediaconverter.model.ConcatStrategy
import org.libremediaconverter.model.OutputFormat
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
import org.libremediaconverter.model.ConcatStrategy
import org.libremediaconverter.model.OutputFormat
import java.io.File
class FFmpegConcatCommandTest {
@@ -31,7 +31,11 @@ class FFmpegConcatCommandTest {
@Test
fun `stream copy uses the concat demuxer and copies codecs`() {
val args = FFmpegConcatCommand.build(
ConcatStrategy.STREAM_COPY, inputs, listFile, output, OutputFormat.MP4_H264,
ConcatStrategy.STREAM_COPY,
inputs,
listFile,
output,
OutputFormat.MP4_H264,
)
assertTrue(args.contains("concat"))
assertEquals("copy", args[args.indexOf("-c") + 1])
@@ -42,7 +46,11 @@ class FFmpegConcatCommandTest {
@Test
fun `stream copy allows absolute paths in the list file`() {
val args = FFmpegConcatCommand.build(
ConcatStrategy.STREAM_COPY, inputs, listFile, output, OutputFormat.MP4_H264,
ConcatStrategy.STREAM_COPY,
inputs,
listFile,
output,
OutputFormat.MP4_H264,
)
// Without -safe 0 the demuxer rejects the absolute paths we generate.
assertEquals("0", args[args.indexOf("-safe") + 1])
@@ -51,7 +59,11 @@ class FFmpegConcatCommandTest {
@Test
fun `re-encode passes every input separately and builds a filter graph`() {
val args = FFmpegConcatCommand.build(
ConcatStrategy.REENCODE, inputs, listFile, output, OutputFormat.MP4_H264,
ConcatStrategy.REENCODE,
inputs,
listFile,
output,
OutputFormat.MP4_H264,
)
assertEquals(2, args.count { it == "-i" })
val filter = args[args.indexOf("-filter_complex") + 1]
@@ -64,7 +76,11 @@ class FFmpegConcatCommandTest {
@Test
fun `re-encode maps the filter outputs rather than raw streams`() {
val args = FFmpegConcatCommand.build(
ConcatStrategy.REENCODE, inputs, listFile, output, OutputFormat.MP4_H264,
ConcatStrategy.REENCODE,
inputs,
listFile,
output,
OutputFormat.MP4_H264,
)
assertTrue(args.contains("[v]"))
assertTrue(args.contains("[a]"))
@@ -81,7 +97,11 @@ class FFmpegConcatCommandTest {
@Test
fun `mkv output does not get faststart`() {
val args = FFmpegConcatCommand.build(
ConcatStrategy.STREAM_COPY, inputs, listFile, File("/cache/j.mkv"), OutputFormat.MKV_H264,
ConcatStrategy.STREAM_COPY,
inputs,
listFile,
File("/cache/j.mkv"),
OutputFormat.MKV_H264,
)
assertFalse(args.contains("+faststart"))
}
@@ -1,8 +1,8 @@
package org.libremediaconverter.model
import org.libremediaconverter.model.ConversionRouter.Reason
import org.junit.Assert.assertEquals
import org.junit.Test
import org.libremediaconverter.model.ConversionRouter.Reason
/**
* One test per routing predicate.
@@ -291,8 +291,12 @@ class ConversionRouterTest {
@Test
fun `the new containers are all FFmpeg-only`() {
listOf(
Container.MOV, Container.MKV, Container.MPEG_TS,
Container.AVI, Container.FLV, Container.ASF,
Container.MOV,
Container.MKV,
Container.MPEG_TS,
Container.AVI,
Container.FLV,
Container.ASF,
).forEach { container ->
val d = route(
OutputSpec(container, VideoCodec.COPY, AudioCodec.COPY),