Search in sources :

Example 1 with SeasonWatchedType

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();
    }
}
Also used : SeasonWatchedType(com.battlelancer.seriesguide.util.tasks.EpisodeTaskTypes.SeasonWatchedType) Subscribe(org.greenrobot.eventbus.Subscribe)

Aggregations

SeasonWatchedType (com.battlelancer.seriesguide.util.tasks.EpisodeTaskTypes.SeasonWatchedType)1 Subscribe (org.greenrobot.eventbus.Subscribe)1