From c857d5e910ee9eb72b82df71f8baf551a0c3e1fe Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Fri, 2 Oct 2026 12:00:46 +0000 Subject: [PATCH] record genre support in the integration test fixture The Nextcloud genre exception was a comment; express it as a TestServer capability instead, mirroring supportsTokenAuth. --- .../data/source/subsonic/SubsonicSourceIntegrationTest.kt | 3 +-- .../com/subtracks/data/source/subsonic/TestServers.kt | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/integrationTest/kotlin/com/subtracks/data/source/subsonic/SubsonicSourceIntegrationTest.kt b/app/src/integrationTest/kotlin/com/subtracks/data/source/subsonic/SubsonicSourceIntegrationTest.kt index c7440924..ec349229 100644 --- a/app/src/integrationTest/kotlin/com/subtracks/data/source/subsonic/SubsonicSourceIntegrationTest.kt +++ b/app/src/integrationTest/kotlin/com/subtracks/data/source/subsonic/SubsonicSourceIntegrationTest.kt @@ -67,8 +67,7 @@ class SubsonicSourceIntegrationTest( assertEquals(20, songs.size) assertTrue(songs.all { song -> song.genre == null || song.genres.isEmpty() || song.genres.contains(song.genre) }) - // Nextcloud Music does not populate the OpenSubsonic genres array. - if (server.name != "nextcloud") { + if (server.supportsGenres) { assertTrue(songs.any { it.genres.isNotEmpty() }) } } diff --git a/app/src/integrationTest/kotlin/com/subtracks/data/source/subsonic/TestServers.kt b/app/src/integrationTest/kotlin/com/subtracks/data/source/subsonic/TestServers.kt index afa9e0ad..e169cb15 100644 --- a/app/src/integrationTest/kotlin/com/subtracks/data/source/subsonic/TestServers.kt +++ b/app/src/integrationTest/kotlin/com/subtracks/data/source/subsonic/TestServers.kt @@ -9,6 +9,7 @@ data class TestServer( val username: String, val password: String, val supportsTokenAuth: Boolean, + val supportsGenres: Boolean, ) { override fun toString(): String = name } @@ -16,15 +17,16 @@ data class TestServer( object TestServers { val all = listOf( - TestServer("navidrome", "http://localhost:4533/", "admin", "password", supportsTokenAuth = true), - TestServer("gonic", "http://localhost:4747/", "admin", "admin", supportsTokenAuth = true), - TestServer("lms", "http://localhost:5082/", "admin", "subtracks-lms", supportsTokenAuth = false), + TestServer("navidrome", "http://localhost:4533/", "admin", "password", supportsTokenAuth = true, supportsGenres = true), + TestServer("gonic", "http://localhost:4747/", "admin", "admin", supportsTokenAuth = true, supportsGenres = true), + TestServer("lms", "http://localhost:5082/", "admin", "subtracks-lms", supportsTokenAuth = false, supportsGenres = true), TestServer( "nextcloud", "http://localhost:8090/index.php/apps/music/subsonic/", "admin", "subtracks-nextcloud", supportsTokenAuth = false, + supportsGenres = false, ), )