Give Vortex a Toonami-inspired lineup (0.45.0 in testing)
pauljd/davidson-ci: Davidson CI / quality (push) Failing after 1m29s
pauljd/davidson-ci: Davidson CI / ai-review (push) Failing after 1m29s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-11-02 07:04:55 +00:00
co-authored by Claude Opus 5.5
parent 64c2604f03
commit e1dd5b363b
5 changed files with 21 additions and 8 deletions
+2 -2
View File
@@ -9,8 +9,8 @@ android {
applicationId = "tv.orbit.classic"
minSdk = 26
targetSdk = 36
versionCode = 45
versionName = "0.44.0-bigger-pools"
versionCode = 46
versionName = "0.45.0-toonami-vortex"
}
buildFeatures { compose = true }
compileOptions { sourceCompatibility = JavaVersion.VERSION_17; targetCompatibility = JavaVersion.VERSION_17 }
@@ -19,6 +19,12 @@ internal data class ChannelProgramming(val number: Int, val name: String, val se
val signature get() = "${searches.joinToString("|")}#$seriesCount"
}
/** Toonami-inspired: Paul's picks and the earlier shortlist, split into cartoons by day and anime from the evening. */
private val VortexDaytime = listOf("Batman Beyond", "Batman: The Animated Series", "Superman: The Animated Series", "ThunderCats", "The Powerpuff Girls", "Jonny Quest",
"Samurai Jack", "Justice League", "Voltron", "ReBoot", "Beast Wars")
private val VortexEvening = listOf("Dragon Ball Z", "Dragon Ball", "Dragon Ball GT", "Naruto", "Yu Yu Hakusho", "Gundam Wing", "Sailor Moon", "Robotech", "Ronin Warriors",
"Tenchi Muyo", "Outlaw Star", "The Big O", "Cardcaptors", "Zoids")
internal val SmartChannels = listOf(
ChannelProgramming(102, "After Dark", listOf("The Thing", "The Evil Dead", "Re-Animator", "Hellraiser", "Videodrome", "An American Werewolf in London",
"Halloween", "Day of the Dead", "They Live", "Escape from New York", "The Fog", "Near Dark", "The Lost Boys", "Fright Night", "Society", "Tremors",
@@ -32,10 +38,8 @@ internal val SmartChannels = listOf(
SuggestionRule("day", "Daytime", "Movie", listOf("Science Fiction", "Action"), 1975..2005, 6.5f, setOf("NC-17", "X"), 40),
SuggestionRule("day", "Daytime", "Movie", listOf("Thriller", "Mystery"), 1975..2005, 6.5f, setOf("NC-17", "X"), 30),
SuggestionRule("late", "Late night", "Movie", listOf("Horror"), 1970..2010, 6f, emptySet(), 90))),
ChannelProgramming(103, "Vortex", listOf("Dragon Ball Z", "Batman Beyond", "Superman: The Animated Series", "Naruto", "Gundam Wing", "Yu Yu Hakusho", "Samurai Jack"),
seriesCount = 6, finishTogether = true,
dayParts = listOf(DayPart(6, 18, listOf("Batman Beyond", "Superman: The Animated Series", "Samurai Jack"), group = "day"),
DayPart(18, 6, listOf("Dragon Ball Z", "Naruto", "Yu Yu Hakusho", "Gundam Wing"), group = "night")),
ChannelProgramming(103, "Vortex", VortexDaytime + VortexEvening, seriesCount = 30, finishTogether = true,
dayParts = listOf(DayPart(6, 18, VortexDaytime, group = "day"), DayPart(18, 6, VortexEvening, group = "night")),
suggestionRules = listOf(
SuggestionRule("day", "Daytime", "Series", listOf("Animation", "Action"), 1985..2015, 7f, setOf("TV-MA"), 30),
SuggestionRule("night", "Evening", "Series", listOf("Anime"), 1985..2020, 7.5f, emptySet(), 20))),
@@ -41,7 +41,7 @@ internal class HttpsEmbyTransport(internal val deviceId: String = UUID.randomUUI
connection.connectTimeout = 10_000
connection.readTimeout = request.readTimeoutMs ?: if (request.path == "/Sessions/Logout") 5_000 else 15_000
connection.setRequestProperty("Accept", "application/json")
connection.setRequestProperty("X-Emby-Authorization", "Emby Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.44.0\"")
connection.setRequestProperty("X-Emby-Authorization", "Emby Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.45.0\"")
request.token?.let { connection.setRequestProperty("X-Emby-Token", it) }
if (request.method == "POST") {
val bytes = request.body.orEmpty().toByteArray(Charsets.UTF_8)
@@ -33,7 +33,7 @@ internal class SecureMediaDataSource(private val session: EmbySampleSession) : B
next.instanceFollowRedirects = false
next.connectTimeout = 10_000
next.readTimeout = 20_000
next.setRequestProperty("User-Agent", "OrbitTV/0.44.0")
next.setRequestProperty("User-Agent", "OrbitTV/0.45.0")
next.setRequestProperty("Accept-Encoding", "identity")
session.mediaHeaders(address).forEach { (key, value) -> next.setRequestProperty(key, value) }
if (dataSpec.position != 0L || dataSpec.length != C.LENGTH_UNSET.toLong()) {
@@ -85,4 +85,13 @@ class ChannelSuggestionsTest {
assertEquals("day", SmartChannels.first { it.number == 102 }.dayParts[1].group)
assertEquals(listOf("day", "night"), SmartChannels.first { it.number == 103 }.dayParts.map { it.group })
}
@Test fun vortexKeepsPaulsToonamiPicksInTheRightBlocks() {
val vortex = SmartChannels.first { it.number == 103 }
val day = vortex.dayParts[0].titles.map(::seriesKey)
assertTrue(listOf("Batman Beyond", "Batman: The Animated Series", "ThunderCats", "The Powerpuff Girls", "Jonny Quest").all { seriesKey(it) in day })
assertTrue(seriesKey("Dragon Ball Z") in vortex.dayParts[1].titles.map(::seriesKey))
assertEquals(vortex.searches.size, vortex.searches.distinct().size)
assertTrue(vortex.seriesCount >= vortex.searches.size)
}
}