diff --git a/src/main/kotlin/net/schowek/nextclouddlna/DllnaService.kt b/src/main/kotlin/net/schowek/nextclouddlna/DllnaService.kt index a9a4f64..9b10166 100644 --- a/src/main/kotlin/net/schowek/nextclouddlna/DllnaService.kt +++ b/src/main/kotlin/net/schowek/nextclouddlna/DllnaService.kt @@ -2,7 +2,6 @@ package net.schowek.nextclouddlna import jakarta.annotation.PreDestroy import mu.KLogging -import net.schowek.nextclouddlna.dlna.RegistryImplWithOverrides import net.schowek.nextclouddlna.dlna.media.MediaServer import net.schowek.nextclouddlna.dlna.transport.ApacheStreamClient import net.schowek.nextclouddlna.dlna.transport.ApacheStreamClientConfiguration @@ -10,21 +9,15 @@ import net.schowek.nextclouddlna.dlna.transport.MyStreamServerConfiguration import net.schowek.nextclouddlna.dlna.transport.MyStreamServerImpl import net.schowek.nextclouddlna.util.ServerInfoProvider import org.jupnp.DefaultUpnpServiceConfiguration -import org.jupnp.UpnpService import org.jupnp.UpnpServiceConfiguration import org.jupnp.UpnpServiceImpl import org.jupnp.model.message.StreamRequestMessage import org.jupnp.model.message.StreamResponseMessage import org.jupnp.model.message.UpnpResponse -import org.jupnp.model.meta.LocalDevice import org.jupnp.protocol.ProtocolFactory -import org.jupnp.protocol.ProtocolFactoryImpl -import org.jupnp.protocol.async.SendingNotificationAlive -import org.jupnp.registry.Registry +import org.jupnp.registry.RegistryImpl import org.jupnp.transport.impl.NetworkAddressFactoryImpl import org.jupnp.transport.spi.NetworkAddressFactory -import org.jupnp.transport.spi.StreamClient -import org.jupnp.transport.spi.StreamServer import org.springframework.context.event.ContextRefreshedEvent import org.springframework.context.event.EventListener import org.springframework.stereotype.Component @@ -71,8 +64,7 @@ class DlnaService( inner class MyUpnpService( configuration: UpnpServiceConfiguration ) : UpnpServiceImpl(configuration) { - override fun createRegistry(pf: ProtocolFactory) = - RegistryImplWithOverrides(this) + override fun createRegistry(pf: ProtocolFactory) = RegistryImpl(this) } private inner class MyUpnpServiceConfiguration : DefaultUpnpServiceConfiguration(serverInfoProvider.port) { diff --git a/src/main/kotlin/net/schowek/nextclouddlna/dlna/RegistryWithOverrides.kt b/src/main/kotlin/net/schowek/nextclouddlna/dlna/RegistryWithOverrides.kt deleted file mode 100644 index e87463d..0000000 --- a/src/main/kotlin/net/schowek/nextclouddlna/dlna/RegistryWithOverrides.kt +++ /dev/null @@ -1,38 +0,0 @@ -package net.schowek.nextclouddlna.dlna - -import mu.KLogging -import net.schowek.nextclouddlna.dlna.media.MediaServer -import net.schowek.nextclouddlna.dlna.media.MediaServer.Companion.ICON_FILENAME -import org.jupnp.UpnpService -import org.jupnp.model.resource.IconResource -import org.jupnp.model.resource.Resource -import org.jupnp.registry.RegistryImpl -import org.jupnp.registry.RegistryMaintainer -import java.io.IOException -import java.net.URI - - -class RegistryImplWithOverrides( - private val upnpService: UpnpService -) : RegistryImpl(upnpService) { - private var icon: Resource<*> - - init { - try { - val deviceIcon = MediaServer.createDeviceIcon() - icon = IconResource(deviceIcon.uri, deviceIcon) - } catch (e: IOException) { - throw RuntimeException(e) - } - } - - @Synchronized - @Throws(IllegalArgumentException::class) - override fun getResource(pathQuery: URI): Resource<*>? { - return if ("/$ICON_FILENAME" == pathQuery.path) { - icon - } else super.getResource(pathQuery) - } - - companion object : KLogging() -} diff --git a/src/main/kotlin/net/schowek/nextclouddlna/dlna/StreamRequestMapper.kt b/src/main/kotlin/net/schowek/nextclouddlna/dlna/StreamRequestMapper.kt index 03437a1..a83ccfb 100644 --- a/src/main/kotlin/net/schowek/nextclouddlna/dlna/StreamRequestMapper.kt +++ b/src/main/kotlin/net/schowek/nextclouddlna/dlna/StreamRequestMapper.kt @@ -2,9 +2,10 @@ package net.schowek.nextclouddlna.dlna import jakarta.servlet.http.HttpServletRequest import mu.KLogging -import org.jupnp.model.message.* +import org.jupnp.model.message.StreamRequestMessage +import org.jupnp.model.message.UpnpHeaders +import org.jupnp.model.message.UpnpRequest import org.springframework.stereotype.Component -import java.net.InetAddress import java.net.URI @Component