@ -177,6 +177,7 @@ public class PodcastService {
* /
* /
public PodcastChannel getChannel ( int channelId ) {
public PodcastChannel getChannel ( int channelId ) {
PodcastChannel channel = podcastDao . getChannel ( channelId ) ;
PodcastChannel channel = podcastDao . getChannel ( channelId ) ;
if ( channel . getTitle ( ) ! = null )
addMediaFileIdToChannels ( Arrays . asList ( channel ) ) ;
addMediaFileIdToChannels ( Arrays . asList ( channel ) ) ;
return channel ;
return channel ;
}
}
@ -272,6 +273,10 @@ public class PodcastService {
private List < PodcastChannel > addMediaFileIdToChannels ( List < PodcastChannel > channels ) {
private List < PodcastChannel > addMediaFileIdToChannels ( List < PodcastChannel > channels ) {
for ( PodcastChannel channel : channels ) {
for ( PodcastChannel channel : channels ) {
try {
try {
if ( channel . getTitle ( ) = = null ) {
LOG . warn ( "Podcast channel id {} has null title" , channel . getId ( ) ) ;
continue ;
}
File dir = getChannelDirectory ( channel ) ;
File dir = getChannelDirectory ( channel ) ;
MediaFile mediaFile = mediaFileService . getMediaFile ( dir ) ;
MediaFile mediaFile = mediaFileService . getMediaFile ( dir ) ;
if ( mediaFile ! = null ) {
if ( mediaFile ! = null ) {