0.108.20: Drive-In event ideas phase 2, Approve/Defer/Dismiss (built, not installed)

On this line the competition check keeps its season headlines as data.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-11-05 19:03:21 +00:00
co-authored by Claude Opus 5.5
parent 84dfae2d71
commit a7f48ed000
5 changed files with 6 additions and 8 deletions
@@ -139,7 +139,7 @@ internal class ChannelScheduler(private val store: ScheduleStore, private val cl
o.optString("name") to o.optJSONArray("members")?.let { a -> (0 until a.length()).map { a.getString(it) } }.orEmpty() } else emptyList()
val studios = EventStudios.associateWith { catalogue.filmsByStudio(it.first) }
val read = catalogue.ideaFilms(lines.keys).map(::enrich)
val held = seasonalFilms().map { it.first.itemId } + ApprovedDebuts.map { it.film.itemId }
val held = SeasonHeldFilms
ApprovedDriveInEvents.refresh(historyFile)
val eventFilms = allDriveInEvents().flatMap { e -> e.films.map { it.itemId } }.toSet() + held
val seeds = ideaSeeds(collections, studios, read, eventFilms)
@@ -62,8 +62,6 @@ internal fun competingEvent(startMs: Long, endMs: Long, zone: java.time.ZoneId =
fun ms(t: java.time.LocalDateTime) = t.atZone(zone).toInstant().toEpochMilli()
val hour = 60 * 60_000L
val events = allDriveInEvents().map { e -> Triple("the Drive-In's ${e.name}", ms(e.evening.atTime(e.hour, e.minute)), ms(e.evening.atTime(e.hour, e.minute)) + e.films.size * 2 * hour) } +
AdventDoors.map { d -> Triple("Advent's Door ${d.door}", ms(d.at), ms(d.at) + 2 * hour) } +
NaughtyList.map { n -> Triple("The Naughty List's ${n.film.title}", ms(n.at), ms(n.at) + 2 * hour) } +
ApprovedDebuts.filter { it.film.itemId != except }.map { d -> Triple("the premiere of ${d.film.title}", d.startMs(zone), d.startMs(zone) + 3 * hour) }
SeasonHeadlines.filter { except == null || !it.first.contains(except) }.map { (what, at, hours) -> Triple(what, ms(at), ms(at) + hours * hour) }
return events.firstOrNull { (_, s, e) -> s < endMs && startMs < e }?.first
}
@@ -66,7 +66,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.108.19\"")
connection.setRequestProperty("X-Emby-Authorization", "Emby Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.20\"")
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.108.19")
next.setRequestProperty("User-Agent", "OrbitTV/0.108.20")
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()) {