use of com.battlelancer.seriesguide.util.tasks.EpisodeTaskTypes.SeasonWatchedType in project SeriesGuide by UweTrottmann.
the class SeasonsFragment method onEvent.
/**
* Updates the total remaining episodes counter, updates season counters after episode actions.
*/
@Subscribe(threadMode = ThreadMode.MAIN)
public void onEvent(EpisodeTools.EpisodeTaskCompletedEvent event) {
if (!event.isSuccessful) {
// no changes applied
return;
}
if (!isAdded()) {
// no longer added to activity
return;
}
updateRemainingCounter();
if (event.flagType instanceof SeasonWatchedType) {
// If we can narrow it down to just one season...
SeasonWatchedType seasonWatchedType = (SeasonWatchedType) event.flagType;
getActivity().startService(UnwatchedUpdaterService.buildIntent(getContext(), getShowId(), seasonWatchedType.getSeasonTvdbId()));
} else {
updateUnwatchedCounts();
}
}
Aggregations