StreamController migration

master
Rémi Cocula 8 years ago
parent b7b42ea4cb
commit a0f7966163
  1. 54
      libresonic-main/src/main/java/org/libresonic/player/controller/StreamController.java
  2. 12
      libresonic-main/src/main/resources/libresonic-servlet.xml

@ -30,10 +30,13 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.ServletRequestBindingException; import org.springframework.web.bind.ServletRequestBindingException;
import org.springframework.web.bind.ServletRequestUtils; import org.springframework.web.bind.ServletRequestUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
import org.libresonic.player.Logger; import org.libresonic.player.Logger;
import org.libresonic.player.domain.MediaFile; import org.libresonic.player.domain.MediaFile;
@ -65,20 +68,32 @@ import org.libresonic.player.util.Util;
* *
* @author Sindre Mehus * @author Sindre Mehus
*/ */
public class StreamController implements Controller { @Controller
@RequestMapping("/stream/**")
public class StreamController {
private static final Logger LOG = Logger.getLogger(StreamController.class); private static final Logger LOG = Logger.getLogger(StreamController.class);
@Autowired
private StatusService statusService; private StatusService statusService;
@Autowired
private PlayerService playerService; private PlayerService playerService;
@Autowired
private PlaylistService playlistService; private PlaylistService playlistService;
@Autowired
private SecurityService securityService; private SecurityService securityService;
@Autowired
private SettingsService settingsService; private SettingsService settingsService;
@Autowired
private TranscodingService transcodingService; private TranscodingService transcodingService;
@Autowired
private AudioScrobblerService audioScrobblerService; private AudioScrobblerService audioScrobblerService;
@Autowired
private MediaFileService mediaFileService; private MediaFileService mediaFileService;
@Autowired
private SearchService searchService; private SearchService searchService;
@RequestMapping(method = RequestMethod.GET)
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
TransferStatus status = null; TransferStatus status = null;
@ -410,39 +425,4 @@ public class StreamController implements Controller {
out.flush(); out.flush();
} }
public void setStatusService(StatusService statusService) {
this.statusService = statusService;
}
public void setPlayerService(PlayerService playerService) {
this.playerService = playerService;
}
public void setPlaylistService(PlaylistService playlistService) {
this.playlistService = playlistService;
}
public void setSecurityService(SecurityService securityService) {
this.securityService = securityService;
}
public void setSettingsService(SettingsService settingsService) {
this.settingsService = settingsService;
}
public void setTranscodingService(TranscodingService transcodingService) {
this.transcodingService = transcodingService;
}
public void setAudioScrobblerService(AudioScrobblerService audioScrobblerService) {
this.audioScrobblerService = audioScrobblerService;
}
public void setMediaFileService(MediaFileService mediaFileService) {
this.mediaFileService = mediaFileService;
}
public void setSearchService(SearchService searchService) {
this.searchService = searchService;
}
} }

@ -17,17 +17,6 @@
org.libresonic.player.validator, org.libresonic.player.validator,
org.libresonic.player.security"/> org.libresonic.player.security"/>
<bean id="streamController" class="org.libresonic.player.controller.StreamController">
<property name="playerService" ref="playerService"/>
<property name="playlistService" ref="playlistService"/>
<property name="statusService" ref="statusService"/>
<property name="securityService" ref="securityService"/>
<property name="settingsService" ref="settingsService"/>
<property name="mediaFileService" ref="mediaFileService"/>
<property name="searchService" ref="searchService"/>
<property name="transcodingService" ref="transcodingService"/>
<property name="audioScrobblerService" ref="audioScrobblerService"/>
</bean>
<bean id="hlsController" class="org.libresonic.player.controller.HLSController"> <bean id="hlsController" class="org.libresonic.player.controller.HLSController">
<property name="playerService" ref="playerService"/> <property name="playerService" ref="playerService"/>
<property name="mediaFileService" ref="mediaFileService"/> <property name="mediaFileService" ref="mediaFileService"/>
@ -112,7 +101,6 @@
<prop key="/wap/download.view">downloadController</prop> <prop key="/wap/download.view">downloadController</prop>
<prop key="/wap/**">wapController</prop> <prop key="/wap/**">wapController</prop>
<prop key="/rest/**">restController</prop> <prop key="/rest/**">restController</prop>
<prop key="/stream/**">streamController</prop>
<prop key="/hls/**">hlsController</prop> <prop key="/hls/**">hlsController</prop>
<prop key="/share/**">externalPlayerController</prop> <prop key="/share/**">externalPlayerController</prop>
</props> </props>

Loading…
Cancel
Save