本文整理匯總了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);
}