+ remove analytics

This commit is contained in:
Reinhard Pointner 2014-11-10 08:18:32 +00:00
parent ac1d27bc57
commit 580b976f6d
26 changed files with 12 additions and 368 deletions

View File

@ -10,7 +10,6 @@
<classpathentry kind="lib" path="lib/groovy.jar"/>
<classpathentry kind="lib" path="lib/icu4j.jar"/>
<classpathentry kind="lib" path="lib/jacksum.jar"/>
<classpathentry kind="lib" path="lib/jgat-custom.jar"/>
<classpathentry kind="lib" path="lib/jna-platform.jar"/>
<classpathentry kind="lib" path="lib/jna.jar"/>
<classpathentry kind="lib" path="lib/json-io.jar"/>

View File

@ -158,10 +158,6 @@
<include name="com/sun/jna/**" />
</zipfileset>
<zipfileset src="${dir.lib}/jgat-custom.jar">
<include name="com/dmurph/tracking/**" />
</zipfileset>
<!-- include classes and native libraries -->
<zipfileset src="${dir.lib}/jna.jar">
<include name="com/sun/jna/**" />
@ -280,7 +276,6 @@
<option value="-Dapplication.deployment=mas" />
<option value="-Dapplication.update=skip" />
<option value="-Dapplication.analytics=false" />
<option value="-Dunixfs=false" />
<option value="-DuseExtendedFileAttributes=true" />
<option value="-DuseCreationDate=false" />

View File

@ -1,2 +1,2 @@
#!/bin/bash
java -Dunixfs=false -DuseGVFS=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Djava.net.useSystemProxies=false -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Dswing.crossplatformlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel -Djna.nosys=true -Dapplication.deployment=deb -Dapplication.analytics=true -Dapplication.dir=$HOME/.filebot -Djava.io.tmpdir=$HOME/.filebot/temp -Djna.library.path=/usr/share/filebot -Djava.library.path=/usr/share/filebot -Dnet.filebot.AcoustID.fpcalc=/usr/share/filebot/fpcalc -jar /usr/share/filebot/FileBot.jar "$@"
java -Dunixfs=false -DuseGVFS=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Djava.net.useSystemProxies=false -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Dswing.crossplatformlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel -Djna.nosys=true -Dapplication.deployment=deb -Dapplication.dir=$HOME/.filebot -Djava.io.tmpdir=$HOME/.filebot/temp -Djna.library.path=/usr/share/filebot -Djava.library.path=/usr/share/filebot -Dnet.filebot.AcoustID.fpcalc=/usr/share/filebot/fpcalc -jar /usr/share/filebot/FileBot.jar "$@"

View File

@ -4,4 +4,4 @@
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
java -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding=UTF-8 -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Dapplication.deployment=ipkg -Dapplication.analytics=true -Duser.home=/opt/share/filebot/data -Dapplication.dir=/opt/share/filebot/data -Djava.io.tmpdir=/opt/share/filebot/data/temp -Djna.library.path=/opt/share/filebot -Djava.library.path=/opt/share/filebot -Dnet.filebot.AcoustID.fpcalc=/opt/share/filebot/fpcalc -jar /opt/share/filebot/FileBot.jar "$@"
java -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding=UTF-8 -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Dapplication.deployment=ipkg -Duser.home=/opt/share/filebot/data -Dapplication.dir=/opt/share/filebot/data -Djava.io.tmpdir=/opt/share/filebot/data/temp -Djna.library.path=/opt/share/filebot -Djava.library.path=/opt/share/filebot -Dnet.filebot.AcoustID.fpcalc=/opt/share/filebot/fpcalc -jar /opt/share/filebot/FileBot.jar "$@"

View File

@ -5,9 +5,6 @@
# put all temporary files here
-Djava.io.tmpdir="%APPDATA%\FileBot\temp"
# FileBot feature settings
-Dapplication.analytics=true
# network settings
-Djava.net.useSystemProxies=true
-Dsun.net.client.defaultConnectTimeout=10000

View File

@ -5,10 +5,6 @@
# put all temporary files here
-Djava.io.tmpdir="%APPDATA%\FileBot\temp"
# FileBot feature settings
-Dapplication.warmup=false
-Dapplication.analytics=true
# network settings
-Djava.net.useSystemProxies=true
-Dsun.net.client.defaultConnectTimeout=10000

View File

@ -7,11 +7,6 @@
# FileBot system properties
-DthreadPool=32
-Dunixfs=false
# FileBot feature settings
-Dapplication.warmup=false
-Dapplication.analytics=true
# network settings
-Djava.net.useSystemProxies=true

View File

@ -3,10 +3,6 @@
-Dapplication.dir="%EXEDIR%"
-Duser.home="%EXEDIR%"
# FileBot feature settings
-Dapplication.warmup=false
-Dapplication.analytics=true
# network settings
-Djava.net.useSystemProxies=false
-Dsun.net.client.defaultConnectTimeout=10000

View File

@ -25,4 +25,4 @@ cd "$WORKING_DIR"
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
java -Dunixfs=false -DuseGVFS=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding=UTF-8 -Djava.net.useSystemProxies=false -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Dswing.crossplatformlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel -Djna.nosys=true -Dapplication.deployment=portable -Dapplication.analytics=true -Dnet.filebot.AcoustID.fpcalc=fpcalc "-Dapplication.dir=$APP_ROOT" "-Djava.io.tmpdir=$APP_ROOT/temp" "-Duser.home=$APP_ROOT" "-Djna.library.path=$APP_ROOT" "-Djava.library.path=$APP_ROOT" -Djava.util.prefs.PreferencesFactory=net.filebot.util.prefs.FilePreferencesFactory "-Dnet.filebot.util.prefs.file=$APP_ROOT/prefs.properties" -jar "$APP_ROOT/FileBot.jar" "$@"
java -Dunixfs=false -DuseGVFS=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding=UTF-8 -Djava.net.useSystemProxies=false -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Dswing.crossplatformlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel -Djna.nosys=true -Dapplication.deployment=portable -Dnet.filebot.AcoustID.fpcalc=fpcalc "-Dapplication.dir=$APP_ROOT" "-Djava.io.tmpdir=$APP_ROOT/temp" "-Duser.home=$APP_ROOT" "-Djna.library.path=$APP_ROOT" "-Djava.library.path=$APP_ROOT" -Djava.util.prefs.PreferencesFactory=net.filebot.util.prefs.FilePreferencesFactory "-Dnet.filebot.util.prefs.file=$APP_ROOT/prefs.properties" -jar "$APP_ROOT/FileBot.jar" "$@"

View File

@ -34,4 +34,4 @@ fi
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
java -Djava.awt.headless=true -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding=UTF-8 -Djava.net.useSystemProxies=true -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Djna.nosys=true -Dapplication.deployment=spk -Dapplication.analytics=true "-Dnet.filebot.AcoustID.fpcalc=fpcalc" "-Dapplication.dir=$APP_DATA" "-Djava.io.tmpdir=$APP_DATA/temp" "-Duser.home=$APP_DATA" -Djava.util.prefs.PreferencesFactory=net.filebot.util.prefs.FilePreferencesFactory "-Dnet.filebot.util.prefs.file=$APP_DATA/prefs.properties" -jar "$APP_ROOT/FileBot.jar" "$@"
java -Djava.awt.headless=true -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding=UTF-8 -Djava.net.useSystemProxies=true -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Djna.nosys=true -Dapplication.deployment=spk "-Dnet.filebot.AcoustID.fpcalc=fpcalc" "-Dapplication.dir=$APP_DATA" "-Djava.io.tmpdir=$APP_DATA/temp" "-Duser.home=$APP_DATA" -Djava.util.prefs.PreferencesFactory=net.filebot.util.prefs.FilePreferencesFactory "-Dnet.filebot.util.prefs.file=$APP_DATA/prefs.properties" -jar "$APP_ROOT/FileBot.jar" "$@"

View File

@ -2,4 +2,4 @@
APP_ROOT="/opt/filebot"
JAVA_CMD="$APP_ROOT/jre/bin/java"
$JAVA_CMD -Dunixfs=false -DuseGVFS=true -DuseExtendedFileAttributes=true -DuseCreationDate=false -Djava.net.useSystemProxies=true -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Dswing.crossplatformlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel -Djna.nosys=true -Dapplication.update=skip -Dapplication.deployment=usc -Dapplication.analytics=false -Dnet.filebot.UserFiles.fileChooser=JavaFX "-Dapplication.dir=$HOME/.config/FileBot" "-Dapplication.cache=$HOME/.cache/FileBot/ehcache.disk.store" "-Djava.io.tmpdir=$HOME/.cache/FileBot/java.io.tmpdir" "-Djna.library.path=$APP_ROOT" "-Djava.library.path=$APP_ROOT" "-Dnet.filebot.AcoustID.fpcalc=$APP_ROOT/fpcalc" -jar "$APP_ROOT/FileBot.jar" "$@"
$JAVA_CMD -Dunixfs=false -DuseGVFS=true -DuseExtendedFileAttributes=true -DuseCreationDate=false -Djava.net.useSystemProxies=true -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Dswing.crossplatformlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel -Djna.nosys=true -Dapplication.update=skip -Dapplication.deployment=usc -Dnet.filebot.UserFiles.fileChooser=JavaFX "-Dapplication.dir=$HOME/.config/FileBot" "-Dapplication.cache=$HOME/.cache/FileBot/ehcache.disk.store" "-Djava.io.tmpdir=$HOME/.cache/FileBot/java.io.tmpdir" "-Djna.library.path=$APP_ROOT" "-Djava.library.path=$APP_ROOT" "-Dnet.filebot.AcoustID.fpcalc=$APP_ROOT/fpcalc" -jar "$APP_ROOT/FileBot.jar" "$@"

Binary file not shown.

View File

@ -1,260 +0,0 @@
package net.filebot;
import static com.dmurph.tracking.JGoogleAnalyticsTracker.GoogleAnalyticsVersion.*;
import static net.filebot.Settings.*;
import java.awt.DisplayMode;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.HeadlessException;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.dmurph.tracking.AnalyticsConfigData;
import com.dmurph.tracking.JGoogleAnalyticsTracker;
import com.dmurph.tracking.VisitorData;
import com.sun.jna.Platform;
public class Analytics {
private static JGoogleAnalyticsTracker tracker;
private static VisitorData visitorData;
private static String host = "filebot.sourceforge.net";
private static String currentView = null;
private static boolean enabled = false;
public static synchronized JGoogleAnalyticsTracker getTracker() throws Throwable {
if (tracker != null)
return tracker;
// disable useless background logging, if it doesn't work it doesn't work, won't affect anything (putting it here works for Java 6)
Logger.getLogger("com.dmurph.tracking").setLevel(Level.OFF);
Logger.getLogger("java.util.prefs").setLevel(Level.OFF);
// initialize tracker
visitorData = restoreVisitorData();
tracker = new JGoogleAnalyticsTracker(getConfig(getApplicationProperty("analytics.WebPropertyID"), visitorData), V_4_7_2);
// store session data on shutdown
Runtime.getRuntime().addShutdownHook(new Thread("AnalyticsShutdownHook") {
@Override
public void run() {
storeVisitorData(visitorData);
JGoogleAnalyticsTracker.completeBackgroundTasks(2000);
}
});
return tracker;
}
public static void trackView(Class<?> view, String title) {
trackView(view.getName().replace('.', '/'), title);
}
public static synchronized void trackView(String view, String title) {
if (!enabled)
return;
if (currentView == null) {
// track application startup
try {
getTracker().trackPageViewFromSearch(view, title, host, getJavaRuntimeIdentifier(), getDeploymentMethod());
} catch (Throwable e) {
Logger.getLogger(Analytics.class.getName()).log(Level.WARNING, e.toString());
}
} else {
// track application state change
try {
getTracker().trackPageViewFromReferrer(view, title, host, host, currentView);
} catch (Throwable e) {
Logger.getLogger(Analytics.class.getName()).log(Level.WARNING, e.toString());
}
}
currentView = view;
}
public static void trackEvent(String category, String action, String label) {
trackEvent(category, action, label, null);
}
public static synchronized void trackEvent(String category, String action, String label, Integer value) {
if (!enabled)
return;
try {
getTracker().trackEvent(normalize(category), normalize(action), normalize(label), value);
} catch (Throwable e) {
Logger.getLogger(Analytics.class.getName()).log(Level.WARNING, e.toString());
}
}
private static String normalize(String label) {
if (label == null)
return null;
// trim braces
return label.replaceAll("[*()]", "").trim();
}
public static synchronized void setEnabled(boolean b) {
enabled = b;
}
public static boolean isEnabled() {
return enabled;
}
private static String getDeploymentMethod() {
return getApplicationDeployment() == null ? "fatjar" : getApplicationDeployment();
}
private static AnalyticsConfigData getConfig(String webPropertyID, VisitorData visitorData) {
AnalyticsConfigData config = new AnalyticsConfigData(webPropertyID, visitorData);
config.setUserAgent(getUserAgent());
config.setEncoding(System.getProperty("file.encoding"));
config.setUserLanguage(getUserLanguage());
try {
if (GraphicsEnvironment.isHeadless())
throw new HeadlessException();
// desktop environment
GraphicsDevice[] display = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
config.setScreenResolution(getScreenResolution(display));
config.setColorDepth(getColorDepth(display));
} catch (Throwable e) {
// headless environment
config.setScreenResolution("80x25");
config.setColorDepth("1");
}
return config;
}
private static String getUserAgent() {
// initialize with default values
String wm = System.getProperty("os.name");
String os = System.getProperty("os.name") + " " + System.getProperty("os.version");
try {
if (Platform.isWindows()) {
wm = "Windows";
os = "Windows NT " + System.getProperty("os.version");
} else if (Platform.isMac()) {
wm = "Macintosh";
os = System.getProperty("os.name");
} else {
if (!GraphicsEnvironment.isHeadless() && Platform.isX11())
wm = "X11";
if (Platform.isLinux())
os = "Linux " + System.getProperty("os.arch");
else if (Platform.isSolaris())
os = "SunOS " + System.getProperty("os.version");
else if (Platform.isFreeBSD())
os = "FreeBSD";
else if (Platform.isOpenBSD())
os = "OpenBSD";
}
} catch (Throwable e) {
// ignore any Platform detection issues and especially ignore LinkageErrors that might occur on headless machines
}
return String.format("%s/%s (%s; U; %s; JRE %s)", getApplicationName(), getApplicationVersion(), wm, os, System.getProperty("java.version"));
}
private static String getUserLanguage() {
String language = System.getProperty("user.language");
// user region or country
String region = System.getProperty("user.region");
if (region == null)
region = System.getProperty("user.country");
// return language string user language with or without user region
if (region == null)
return language;
return language + "-" + region;
}
private static String getScreenResolution(GraphicsDevice[] display) {
int screenHeight = 0;
int screenWidth = 0;
// get size of each screen
for (int i = 0; i < display.length; i++) {
DisplayMode dm = display[i].getDisplayMode();
screenWidth += dm.getWidth();
screenHeight += dm.getHeight();
}
return screenWidth + "x" + screenHeight;
}
private static String getColorDepth(GraphicsDevice[] display) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < display.length; i++) {
if (sb.length() > 0) {
sb.append(", ");
}
sb.append(display[i].getDisplayMode().getBitDepth());
}
return sb.toString();
}
private static final String VISITOR_ID = "visitorId";
private static final String TIMESTAMP_FIRST = "timestampFirst";
private static final String TIMESTAMP_LAST = "timestampLast";
private static final String VISITS = "visits";
private synchronized static VisitorData restoreVisitorData() {
try {
// try to restore visitor
Map<String, String> data = getPersistentData();
int visitorId = Integer.parseInt(data.get(VISITOR_ID));
long timestampFirst = Long.parseLong(data.get(TIMESTAMP_FIRST));
long timestampLast = Long.parseLong(data.get(TIMESTAMP_LAST));
int visits = Integer.parseInt(data.get(VISITS));
return VisitorData.newSession(visitorId, timestampFirst, timestampLast, visits);
} catch (Exception e) {
// new visitor
return VisitorData.newVisitor();
}
}
private synchronized static void storeVisitorData(VisitorData visitor) {
Map<String, String> data = getPersistentData();
data.put(VISITOR_ID, String.valueOf(visitor.getVisitorId()));
data.put(TIMESTAMP_FIRST, String.valueOf(visitor.getTimestampFirst()));
data.put(TIMESTAMP_LAST, String.valueOf(visitor.getTimestampPrevious()));
data.put(VISITS, String.valueOf(visitor.getVisits()));
}
private static Map<String, String> getPersistentData() {
return Settings.forPackage(Analytics.class).node("analytics").asMap();
}
/**
* Dummy constructor to prevent instantiation
*/
private Analytics() {
throw new UnsupportedOperationException();
}
static {
// disable useless background logging, if it doesn't work it doesn't work, won't affect anything (putting it here works for Java 7)
Logger.getLogger("com.dmurph.tracking").setLevel(Level.OFF);
}
}

View File

@ -150,24 +150,20 @@ public class Main {
if (args.unixfs) {
System.setProperty("unixfs", "true");
}
if (args.disableAnalytics) {
System.setProperty("application.analytics", "false");
}
if (args.disableExtendedAttributes) {
System.setProperty("useExtendedFileAttributes", "false");
System.setProperty("useCreationDate", "false");
}
if (args.action.equalsIgnoreCase("test")) {
System.setProperty("useExtendedFileAttributes", "false");
System.setProperty("application.analytics", "false");
System.setProperty("useCreationDate", "false");
System.setProperty("application.rename.history", "false"); // don't keep history of --action test rename operations
}
// make sure we can access application arguments at any time
Settings.setApplicationArgumentArray(argumentArray);
// initialize analytics
Analytics.setEnabled(System.getProperty("application.analytics") == null ? true : Boolean.parseBoolean(System.getProperty("application.analytics")));
// initialize history spooler
HistorySpooler.getInstance().setPersistentHistoryEnabled(System.getProperty("application.rename.history") == null ? true : Boolean.parseBoolean(System.getProperty("application.rename.history")));
// CLI mode => run command-line interface and then exit
@ -401,7 +397,6 @@ public class Main {
donation.setValue(String.valueOf(currentRev));
}
}
Analytics.trackEvent("GUI", "Donate", "r" + currentRev, pane.getValue() == actions[0] ? 1 : 0);
}
private static void restoreWindowBounds(final JFrame window, final Settings settings) {

View File

@ -107,9 +107,6 @@ public class ArgumentBean {
@Option(name = "-no-xattr", usage = "Disable extended attributes")
public boolean disableExtendedAttributes = false;
@Option(name = "-no-analytics", usage = "Disable analytics")
public boolean disableAnalytics = false;
@Option(name = "-version", usage = "Print version identifier")
public boolean version = false;

View File

@ -23,7 +23,6 @@ import java.util.regex.Pattern;
import javax.script.Bindings;
import javax.script.SimpleBindings;
import net.filebot.Analytics;
import net.filebot.MediaTypes;
import net.filebot.StandardRenameAction;
import net.filebot.cli.ScriptShell.ScriptProvider;
@ -32,7 +31,6 @@ import net.filebot.web.CachedResource;
public class ArgumentProcessor {
public int process(ArgumentBean args, CmdlineInterface cli) {
Analytics.trackView(ArgumentProcessor.class, "FileBot CLI");
CLILogger.setLevel(args.getLogLevel());
try {

View File

@ -36,7 +36,6 @@ import java.util.TreeSet;
import java.util.logging.Level;
import java.util.regex.Pattern;
import net.filebot.Analytics;
import net.filebot.HistorySpooler;
import net.filebot.Language;
import net.filebot.MediaTypes;
@ -248,7 +247,6 @@ public class CmdlineOperations implements CmdlineInterface {
}
// rename episodes
Analytics.trackEvent("CLI", "Rename", "Episode", renameMap.size());
return renameAll(renameMap, renameAction, conflictAction, matches);
}
@ -294,7 +292,6 @@ public class CmdlineOperations implements CmdlineInterface {
try {
CLILogger.fine(format("Fetching episode data for [%s]", it.getName()));
episodes.addAll(db.getEpisodeList(it, sortOrder, locale));
Analytics.trackEvent(db.getName(), "FetchEpisodeList", it.getName());
} catch (IOException e) {
CLILogger.log(Level.SEVERE, e.getMessage());
}
@ -348,7 +345,6 @@ public class CmdlineOperations implements CmdlineInterface {
CLILogger.finest(format("Looking up up movie by hash via [%s]", service.getName()));
movieByFile.putAll(hashLookup);
}
Analytics.trackEvent(service.getName(), "HashLookup", "Movie", hashLookup.size()); // number of positive hash lookups
} catch (UnsupportedOperationException e) {
// ignore logging => hash lookup only supported by OpenSubtitles
}
@ -455,10 +451,6 @@ public class CmdlineOperations implements CmdlineInterface {
} catch (Exception e) {
CLILogger.log(Level.WARNING, String.format("%s: [%s/%s] %s", e.getClass().getSimpleName(), guessMovieFolder(file) != null ? guessMovieFolder(file).getName() : null, file.getName(), e.getMessage()));
}
if (movie != null) {
Analytics.trackEvent(service.getName(), "SearchMovie", movie.toString(), 1);
}
}
// check if we managed to lookup the movie descriptor
@ -514,7 +506,6 @@ public class CmdlineOperations implements CmdlineInterface {
}
// rename movies
Analytics.trackEvent("CLI", "Rename", "Movie", renameMap.size());
return renameAll(renameMap, renameAction, conflictAction, matches);
}
@ -551,7 +542,6 @@ public class CmdlineOperations implements CmdlineInterface {
}
// rename movies
Analytics.trackEvent("CLI", "Rename", "AudioTrack", renameMap.size());
return renameAll(renameMap, renameAction, conflictAction, null);
}
@ -761,9 +751,6 @@ public class CmdlineOperations implements CmdlineInterface {
for (File it : remainingVideos) {
CLILogger.warning("No matching subtitles found: " + it);
}
if (subtitleFiles.size() > 0) {
Analytics.trackEvent("CLI", "Download", "Subtitle", subtitleFiles.size());
}
return subtitleFiles;
}
@ -847,7 +834,6 @@ public class CmdlineOperations implements CmdlineInterface {
for (Entry<File, SubtitleDescriptor> it : subtitles.entrySet()) {
try {
downloads.put(it.getKey(), downloadSubtitle(it.getValue(), it.getKey(), outputFormat, outputEncoding, naming));
Analytics.trackEvent(service, "DownloadSubtitle", it.getValue().getLanguageName(), 1);
} catch (Exception e) {
CLILogger.warning(format("Failed to download %s: %s", it.getValue().getPath(), e.getMessage()));
}

View File

@ -33,7 +33,6 @@ import javax.swing.SwingWorker;
import javax.swing.text.BadLocationException;
import javax.swing.text.JTextComponent;
import net.filebot.Analytics;
import net.filebot.ResourceManager;
import net.filebot.Settings;
import net.filebot.cli.ArgumentProcessor.DefaultScriptProvider;
@ -322,24 +321,4 @@ public class GroovyPad extends JFrame {
}
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
try {
GroovyPad pad = new GroovyPad();
// ignore analytics in developer mode
Analytics.setEnabled(false);
pad.setDefaultCloseOperation(EXIT_ON_CLOSE);
pad.setVisible(true);
} catch (IOException e) {
e.printStackTrace();
}
}
});
}
}

View File

@ -36,7 +36,6 @@ import javax.swing.border.EmptyBorder;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import net.filebot.Analytics;
import net.filebot.Settings;
import net.filebot.cli.GroovyPad;
import net.filebot.mac.MacAppUtilities;
@ -175,7 +174,6 @@ public class MainFrame extends JFrame {
if (!panel.isVisible()) {
headerPanel.setTitle(selectedBuilder.getName());
panel.setVisible(true);
Analytics.trackView(panel.getClass(), selectedBuilder.getName());
}
}

View File

@ -26,7 +26,6 @@ import javax.swing.JComponent;
import javax.swing.JSpinner;
import javax.swing.KeyStroke;
import net.filebot.Analytics;
import net.filebot.Language;
import net.filebot.Settings;
import net.filebot.WebServices;
@ -223,7 +222,6 @@ public class EpisodeListPanel extends AbstractSearchPanel<EpisodeListProvider, E
episodes = episodeForSeason;
}
Analytics.trackEvent(request.provider.getName(), "ViewEpisodeList", getSearchResult().getName());
return episodes;
}

View File

@ -36,7 +36,6 @@ import java.util.concurrent.RunnableFuture;
import javax.swing.Action;
import javax.swing.SwingUtilities;
import net.filebot.Analytics;
import net.filebot.Settings;
import net.filebot.similarity.CommonSequenceMatcher;
import net.filebot.similarity.EpisodeMatcher;
@ -139,10 +138,7 @@ class EpisodeListMatcher implements AutoCompleteMatcher {
SearchResult selectedSearchResult = selectSearchResult(query, results, selectionMemory, parent);
if (selectedSearchResult != null) {
List<Episode> episodes = provider.getEpisodeList(selectedSearchResult, sortOrder, locale);
Analytics.trackEvent(provider.getName(), "FetchEpisodeList", selectedSearchResult.getName());
return episodes;
return provider.getEpisodeList(selectedSearchResult, sortOrder, locale);
}
}

View File

@ -42,7 +42,6 @@ import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import net.filebot.Analytics;
import net.filebot.ResourceManager;
import net.filebot.Settings;
import net.filebot.similarity.Match;
@ -102,7 +101,6 @@ class MovieHashMatcher implements AutoCompleteMatcher {
try {
Map<File, Movie> hashLookup = service.getMovieDescriptors(movieFiles, locale);
movieByFile.putAll(hashLookup);
Analytics.trackEvent(service.getName(), "HashLookup", "Movie", hashLookup.size()); // number of positive hash lookups
} catch (UnsupportedOperationException e) {
// ignore
}

View File

@ -42,7 +42,6 @@ import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.SwingWorker;
import net.filebot.Analytics;
import net.filebot.HistorySpooler;
import net.filebot.NativeRenameAction;
import net.filebot.ResourceManager;
@ -364,11 +363,6 @@ class RenameAction extends AbstractAction {
if (renameLog.size() > 0) {
UILogger.info(String.format("%d files renamed.", renameLog.size()));
HistorySpooler.getInstance().append(renameLog.entrySet());
// count global statistics
for (Class<?> it : new HashSet<Class<?>>(types)) {
Analytics.trackEvent("GUI", "Rename", it.getSimpleName(), frequency(types, it));
}
}
}

View File

@ -58,7 +58,6 @@ import javax.swing.border.CompoundBorder;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.DefaultTableCellRenderer;
import net.filebot.Analytics;
import net.filebot.ResourceManager;
import net.filebot.mac.MacAppUtilities;
import net.filebot.similarity.EpisodeMetrics;
@ -690,16 +689,10 @@ class SubtitleAutoMatchDialog extends JDialog {
setState(StateValue.STARTED);
try {
MemoryFile data = fetchSubtitle(descriptor);
Analytics.trackEvent(service.getName(), "DownloadSubtitle", descriptor.getLanguageName(), 1);
return data;
return fetchSubtitle(descriptor);
} catch (Exception e) {
// remember exception
error = e;
// rethrow exception
throw e;
// remember and rethrow exception
throw (error = e);
} finally {
setState(StateValue.DONE);
}

View File

@ -39,7 +39,6 @@ import javax.swing.ListModel;
import javax.swing.SwingUtilities;
import javax.swing.border.LineBorder;
import net.filebot.Analytics;
import net.filebot.ResourceManager;
import net.filebot.Settings;
import net.filebot.subtitle.SubtitleFormat;
@ -230,9 +229,7 @@ class SubtitleDownloadComponent extends JComponent {
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getNewValue() == Phase.DONE) {
try {
List<MemoryFile> subtitles = subtitle.getDownload().get();
Analytics.trackEvent(subtitle.getProvider().getName(), "DownloadSubtitle", subtitle.getLanguage().getName(), subtitles.size());
files.addAll(subtitles);
files.addAll(subtitle.getDownload().get());
} catch (CancellationException e) {
// ignore cancellation
} catch (Exception e) {

View File

@ -48,7 +48,6 @@ import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import net.filebot.Analytics;
import net.filebot.Language;
import net.filebot.ResourceManager;
import net.filebot.WebServices;
@ -745,8 +744,6 @@ public class SubtitleUploadDialog extends JDialog {
database.uploadSubtitle(mapping.getIdentity(), mapping.getLanguage().getLocale(), mapping.getVideo(), mapping.getSubtitle());
mapping.setState(SubtitleMapping.Status.UploadComplete);
Analytics.trackEvent(database.getName(), "UploadSubtitle", mapping.getLanguage().getName(), 1);
} catch (Exception e) {
Logger.getLogger(UploadTask.class.getClass().getName()).log(Level.SEVERE, e.getMessage(), e);
mapping.setState(SubtitleMapping.Status.UploadFailed);