本文整理汇总了Java中com.uwetrottmann.thetvdb.entities.Episode类的典型用法代码示例。如果您正苦于以下问题:Java Episode类的具体用法?Java Episode怎么用?Java Episode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Episode类属于com.uwetrottmann.thetvdb.entities包,在下文中一共展示了Episode类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assertBasicEpisode
import com.uwetrottmann.thetvdb.entities.Episode; //导入依赖的package包/类
public static void assertBasicEpisode(Episode episode) {
assertThat(episode.id).isPositive();
assertThat(episode.airedEpisodeNumber).isGreaterThanOrEqualTo(0);
if (episode.absoluteNumber != null) {
assertThat(episode.absoluteNumber).isGreaterThanOrEqualTo(0);
}
if (episode.dvdEpisodeNumber != null) {
assertThat(episode.dvdEpisodeNumber).isGreaterThanOrEqualTo(0);
}
if (episode.dvdSeason != null) {
assertThat(episode.dvdSeason).isGreaterThanOrEqualTo(0);
}
assertThat(episode.airedSeason).isGreaterThanOrEqualTo(0);
if (episode.airedSeasonID != null) {
assertThat(episode.airedSeasonID).isPositive();
}
if (episode.episodeName != null) {
assertThat(episode.language.episodeName).isEqualTo(LANGUAGE_EN);
}
if (episode.overview != null) {
assertThat(episode.language.overview).isEqualTo(LANGUAGE_EN);
}
}
示例2: getAllEpisodes
import com.uwetrottmann.thetvdb.entities.Episode; //导入依赖的package包/类
public List<TheTVDBEpisode> getAllEpisodes(int tvdbid, String language) throws TheTVDBException {
try {
if (tvdbid != 0) {
Response<EpisodesResponse> response = theTvdb.series().episodes(tvdbid, 1, language).execute();
if (response.isSuccessful()) {
List<TheTVDBEpisode> tvdpEpisodes = new ArrayList<>();
for (Episode episode : response.body().data) {
tvdpEpisodes.add(episodeToTVDBEpisode(episode, language));
}
return tvdpEpisodes;
}
} else {
LOGGER.warn("TVDB ID is 0! please fix");
}
return null;
} catch (IOException e) {
throw new TheTVDBException(e);
}
}
示例3: episodeToTVDBEpisode
import com.uwetrottmann.thetvdb.entities.Episode; //导入依赖的package包/类
private TheTVDBEpisode episodeToTVDBEpisode(Episode episode, String lang) {
TheTVDBEpisode tvdbEpisode = new TheTVDBEpisode();
tvdbEpisode.setId(toString(episode.id));
tvdbEpisode.setDvdEpisodeNumber(toString(episode.dvdEpisodeNumber));
tvdbEpisode.setDvdSeason(toString(episode.dvdSeason));
tvdbEpisode.setEpisodeName(episode.episodeName);
tvdbEpisode.setEpisodeNumber(episode.airedEpisodeNumber);
tvdbEpisode.setFirstAired(episode.firstAired);
tvdbEpisode.setLanguage(lang);
tvdbEpisode.setOverview(episode.language.overview);
tvdbEpisode.setSeasonNumber(episode.airedSeason);
tvdbEpisode.setAbsoluteNumber(toString(episode.absoluteNumber));
tvdbEpisode.setLastUpdated(toString(episode.lastUpdated));
tvdbEpisode.setSeasonId(toString(episode.airedSeasonID));
tvdbEpisode.setAirsAfterSeason(0);
tvdbEpisode.setAirsBeforeEpisode(0);
return tvdbEpisode;
}
示例4: assertEpisodes
import com.uwetrottmann.thetvdb.entities.Episode; //导入依赖的package包/类
private static void assertEpisodes(@Nullable List<Episode> episodes) {
if (episodes == null) {
fail("episodes == null");
}
for (Episode episode : episodes) {
TestData.assertBasicEpisode(episode);
}
}
示例5: test_get
import com.uwetrottmann.thetvdb.entities.Episode; //导入依赖的package包/类
@Test
public void test_get() throws Exception {
EpisodeResponse episodeResponse = executeCall(
getTheTvdb().episodes().get(TestData.EPISODE_TVDB_ID, TestData.LANGUAGE_EN));
Episode.FullEpisode episode = episodeResponse.data;
TestData.assertBasicEpisode(episode);
assertThat(episode.id).isEqualTo(TestData.EPISODE_TVDB_ID);
}