diff --git a/libresonic-main/src/main/java/org/libresonic/player/controller/PodcastChannelsController.java b/libresonic-main/src/main/java/org/libresonic/player/controller/PodcastChannelsController.java index 1dff8955..eeb898a2 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/controller/PodcastChannelsController.java +++ b/libresonic-main/src/main/java/org/libresonic/player/controller/PodcastChannelsController.java @@ -18,43 +18,49 @@ */ package org.libresonic.player.controller; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.servlet.mvc.ParameterizableViewController; - import org.libresonic.player.domain.PodcastChannel; import org.libresonic.player.domain.PodcastEpisode; import org.libresonic.player.service.PodcastService; import org.libresonic.player.service.SecurityService; import org.libresonic.player.service.SettingsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; /** * Controller for the "Podcast channels" page. * * @author Sindre Mehus */ -public class PodcastChannelsController extends ParameterizableViewController { +@Controller +@RequestMapping("/podcastChannels") +public class PodcastChannelsController { + @Autowired private PodcastService podcastService; + @Autowired private SecurityService securityService; + @Autowired private SettingsService settingsService; - @Override + @RequestMapping(method = RequestMethod.GET) protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception { - Map map = new HashMap(); - ModelAndView result = super.handleRequestInternal(request, response); + Map map = new HashMap<>(); + ModelAndView result = new ModelAndView(); result.addObject("model", map); - Map> channels = new LinkedHashMap>(); - Map channelMap = new HashMap(); + Map> channels = new LinkedHashMap<>(); + Map channelMap = new HashMap<>(); for (PodcastChannel channel : podcastService.getAllChannels()) { channels.put(channel, podcastService.getEpisodes(channel.getId())); channelMap.put(channel.getId(), channel); @@ -68,15 +74,6 @@ public class PodcastChannelsController extends ParameterizableViewController { return result; } - public void setPodcastService(PodcastService podcastService) { - this.podcastService = podcastService; - } - public void setSecurityService(SecurityService securityService) { - this.securityService = securityService; - } - public void setSettingsService(SettingsService settingsService) { - this.settingsService = settingsService; - } } diff --git a/libresonic-main/src/main/resources/libresonic-servlet.xml b/libresonic-main/src/main/resources/libresonic-servlet.xml index 763adc54..f23195ec 100644 --- a/libresonic-main/src/main/resources/libresonic-servlet.xml +++ b/libresonic-main/src/main/resources/libresonic-servlet.xml @@ -15,12 +15,6 @@ - - - - - - @@ -227,7 +221,6 @@ downloadController dbController multiController - podcastChannelsController podcastChannelController podcastReceiverAdminController podcastController