Channel[] channels = Plugin.getPluginManager().getSubscribedChannels();
Date date = Date.getCurrentDate();
for (int d = 0; d < 31; d++) {
for (Channel channel : channels) {
for (Iterator<Program> it = Plugin.getPluginManager().getChannelDayProgram(date, channel); it.hasNext();) {
Program program = it.next();
if (program != null) {
String title = program.getTitle();
if (title != null) {
HashSet<PluginTreeNode> nodes = titles.get(title);
if (nodes != null) {
for (PluginTreeNode titleNode : nodes) {
titleNode.addProgramWithoutCheck(program);
}
}
}
}
}
}
date = date.addDays(1);
}
// now add the title nodes to the plugin tree
PluginTreeNode topOverall = mRootNode.addNode(mLocalizer.msg("topOverall", "Top programs"));
PluginTreeNode topAction = mRootNode.addNode(mLocalizer.msg("topAction", "Top action"));
PluginTreeNode topFun = mRootNode.addNode(mLocalizer.msg("topFun", "Top fun"));
PluginTreeNode topErotic = mRootNode.addNode(mLocalizer.msg("topErotic", "Top erotic"));
PluginTreeNode topTension = mRootNode.addNode(mLocalizer.msg("topTension", "Top tension"));
PluginTreeNode topEntitlement = mRootNode.addNode(mLocalizer.msg("topEntitlement", "Top entitlement"));
addList(topOverall, listOverall);
addList(topAction, listAction);
addList(topFun, listFun);
addList(topErotic, listErotic);
addList(topTension, listTension);
addList(topEntitlement, listEntitlement);
// add unrated favorites
PluginTreeNode favoritesNode = mRootNode.addNode(mLocalizer.msg(
"unratedFavorites", "Unrated favorites"));
favoritesNode.setGroupingByDateEnabled(false);
Program[] programs = getPluginManager().getMarkedPrograms();
// search all unrated favorites
List<Program> unratedFavs = new ArrayList<Program>();
for (Program program : programs) {
if (program.isExpired()) {
Marker[] markers = program.getMarkerArr();
for (Marker marker : markers) {
if (marker.getId()
.equalsIgnoreCase(FAVORITES_PLUGIN_ID)) {
if (getPersonalRating(program) == null) {
unratedFavs.add(program);