Beispiel #1
0
bool Feed::ExamineData() {
  for (size_t i = 0; i < items.size(); i++) {
    // Examine title and compare with anime list items
    Meow.ExamineTitle(items[i].title, items[i].episode_data, true, true, true, true, false);
    Meow.MatchDatabase(items[i].episode_data, true, true);
    
    // Update last aired episode number
    if (items[i].episode_data.anime_id > anime::ID_UNKNOWN) {
      auto anime_item = AnimeDatabase.FindItem(items[i].episode_data.anime_id);
      int episode_number = GetEpisodeHigh(items[i].episode_data.number);
      anime_item->SetLastAiredEpisodeNumber(episode_number);
    }
  }

  // Filter
  Aggregator.filter_manager.MarkNewEpisodes(*this);
  // Preferences have lower priority, so we need to handle other filters
  // first in order to avoid discarding items that we actually want.
  Aggregator.filter_manager.Filter(*this, false);
  Aggregator.filter_manager.Filter(*this, true);
  // Archived items must be discarded after other filters are processed.
  Aggregator.filter_manager.FilterArchived(*this);

  // Sort items
  std::stable_sort(items.begin(), items.end());
  // Re-assign item indexes
  for (size_t i = 0; i < items.size(); i++)
    items.at(i).index = i;
  
  return Aggregator.filter_manager.IsItemDownloadAvailable(*this);
}
Beispiel #2
0
  foreach_(it, items) {
    // Examine title and compare with anime list items
    Meow.ExamineTitle(it->title, it->episode_data,
                      true, true, true, true, false);
    Meow.MatchDatabase(it->episode_data, false, true);

    // Update last aired episode number
    if (anime::IsValidId(it->episode_data.anime_id)) {
      auto anime_item = AnimeDatabase.FindItem(it->episode_data.anime_id);
      int episode_number = anime::GetEpisodeHigh(it->episode_data.number);
      anime_item->SetLastAiredEpisodeNumber(episode_number);
    }
  }