本文整理汇总了Java中net.sourceforge.subsonic.domain.PodcastStatus.DOWNLOADING属性的典型用法代码示例。如果您正苦于以下问题:Java PodcastStatus.DOWNLOADING属性的具体用法?Java PodcastStatus.DOWNLOADING怎么用?Java PodcastStatus.DOWNLOADING使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.sourceforge.subsonic.domain.PodcastStatus
的用法示例。
在下文中一共展示了PodcastStatus.DOWNLOADING属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
public synchronized void init() {
try {
// Clean up partial downloads.
for (PodcastChannel channel : getAllChannels()) {
for (PodcastEpisode episode : getEpisodes(channel.getId())) {
if (episode.getStatus() == PodcastStatus.DOWNLOADING) {
deleteEpisode(episode.getId(), false);
LOG.info("Deleted Podcast episode '" + episode.getTitle() + "' since download was interrupted.");
}
}
}
schedule();
} catch (Throwable x) {
LOG.error("Failed to initialize PodcastService: " + x, x);
}
}
示例2: deleteObsoleteEpisodes
private synchronized void deleteObsoleteEpisodes(PodcastChannel channel) {
int episodeCount = settingsService.getPodcastEpisodeRetentionCount();
if (episodeCount == -1) {
return;
}
List<PodcastEpisode> episodes = getEpisodes(channel.getId());
// Don't do anything if other episodes of the same channel is currently downloading.
for (PodcastEpisode episode : episodes) {
if (episode.getStatus() == PodcastStatus.DOWNLOADING) {
return;
}
}
// Reverse array to get chronological order (oldest episodes first).
Collections.reverse(episodes);
int episodesToDelete = Math.max(0, episodes.size() - episodeCount);
for (int i = 0; i < episodesToDelete; i++) {
deleteEpisode(episodes.get(i).getId(), true);
LOG.info("Deleted old Podcast episode " + episodes.get(i).getUrl());
}
}
示例3: init
public synchronized void init() {
try {
// Clean up partial downloads.
for (PodcastChannel channel : getAllChannels()) {
for (PodcastEpisode episode : getEpisodes(channel.getId(), false)) {
if (episode.getStatus() == PodcastStatus.DOWNLOADING) {
deleteEpisode(episode.getId(), false);
LOG.info("Deleted Podcast episode '" + episode.getTitle() + "' since download was interrupted.");
}
}
}
schedule();
} catch (Throwable x) {
LOG.error("Failed to initialize PodcastService: " + x, x);
}
}
示例4: deleteObsoleteEpisodes
private synchronized void deleteObsoleteEpisodes(PodcastChannel channel) {
int episodeCount = settingsService.getPodcastEpisodeRetentionCount();
if (episodeCount == -1) {
return;
}
List<PodcastEpisode> episodes = getEpisodes(channel.getId(), false);
// Don't do anything if other episodes of the same channel is currently downloading.
for (PodcastEpisode episode : episodes) {
if (episode.getStatus() == PodcastStatus.DOWNLOADING) {
return;
}
}
// Reverse array to get chronological order (oldest episodes first).
Collections.reverse(episodes);
int episodesToDelete = Math.max(0, episodes.size() - episodeCount);
for (int i = 0; i < episodesToDelete; i++) {
deleteEpisode(episodes.get(i).getId(), true);
LOG.info("Deleted old Podcast episode " + episodes.get(i).getUrl());
}
}