* track request only if we get results, that way we can easily monitor if a certain webservice goes offline
This commit is contained in:
parent
3026ad53b8
commit
3f22e8ff07
|
@ -201,8 +201,10 @@ public class CmdlineOperations implements CmdlineInterface {
|
|||
|
||||
if (selectedSearchResult != null) {
|
||||
CLILogger.fine(format("Fetching episode data for [%s]", selectedSearchResult.getName()));
|
||||
List<Episode> episodes = db.getEpisodeList(selectedSearchResult, locale);
|
||||
|
||||
Analytics.trackEvent(db.getName(), "FetchEpisodeList", selectedSearchResult.getName());
|
||||
return db.getEpisodeList(selectedSearchResult, locale);
|
||||
return episodes;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ import java.io.IOException;
|
|||
import java.net.URI;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.swing.AbstractAction;
|
||||
|
@ -24,6 +25,7 @@ import javax.swing.JComponent;
|
|||
import javax.swing.JSpinner;
|
||||
import javax.swing.KeyStroke;
|
||||
|
||||
import net.sourceforge.filebot.Analytics;
|
||||
import net.sourceforge.filebot.Settings;
|
||||
import net.sourceforge.filebot.WebServices;
|
||||
import net.sourceforge.filebot.ui.AbstractSearchPanel;
|
||||
|
@ -224,10 +226,15 @@ public class EpisodeListPanel extends AbstractSearchPanel<EpisodeListProvider, E
|
|||
|
||||
@Override
|
||||
public Collection<Episode> fetch() throws Exception {
|
||||
List<Episode> episodes;
|
||||
|
||||
if (request.getSeason() != ALL_SEASONS)
|
||||
return request.getProvider().getEpisodeList(getSearchResult(), request.getSeason(), request.getLanguage());
|
||||
episodes = request.getProvider().getEpisodeList(getSearchResult(), request.getSeason(), request.getLanguage());
|
||||
else
|
||||
return request.getProvider().getEpisodeList(getSearchResult(), request.getLanguage());
|
||||
episodes = request.getProvider().getEpisodeList(getSearchResult(), request.getLanguage());
|
||||
|
||||
Analytics.trackEvent(request.getProvider().getName(), "ViewEpisodeList", getSearchResult().getName());
|
||||
return episodes;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -130,8 +130,10 @@ class EpisodeListMatcher implements AutoCompleteMatcher {
|
|||
SearchResult selectedSearchResult = selectSearchResult(query, results);
|
||||
|
||||
if (selectedSearchResult != null) {
|
||||
List<Episode> episodes = provider.getEpisodeList(selectedSearchResult, locale);
|
||||
Analytics.trackEvent(provider.getName(), "FetchEpisodeList", selectedSearchResult.getName());
|
||||
return provider.getEpisodeList(selectedSearchResult, locale);
|
||||
|
||||
return episodes;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue