Cleanup. Bump version.
This commit is contained in:
parent
14db91ba69
commit
291ab98008
20 changed files with 49 additions and 66 deletions
|
@ -5,7 +5,7 @@ An open source desktop application for downloading and managing your Audible aud
|
|||
|
||||
[Download](https://github.com/openaudible/openaudible/releases/latest) installers for Windows, Mac and Linux.
|
||||
|
||||
More information is available at the project home page [OpenAudible](http://openaudible.org).
|
||||
More information is available at the project home page [openaudible.org](http://openaudible.org).
|
||||
|
||||
## Features
|
||||
- Import audible books from your account
|
||||
|
@ -81,7 +81,7 @@ java -cp "target/openaudible-jar-with-dependencies.jar:swt/org.eclipse.swt.gtk.l
|
|||
|
||||
#### Notes
|
||||
|
||||
Running with -ea to alert you of assertion failures is recommended for debugging. We use a lot of "asserts" to help identify problems.
|
||||
Running with -ea to alert you of assertion failures is recommended for debugging. We use "asserts" to help identify problems.
|
||||
|
||||
Enter that into the VM Arguments on your debugger/run dialog if using an IDE.
|
||||
|
||||
|
@ -102,7 +102,7 @@ Some effort was made to separate the SWT GUI from the core code, which can be us
|
|||
|
||||
- [Eclipse SWT](http://www.eclipse.org/swt/) - Standard Widget Toolkit
|
||||
- [HTML Unit](https://htmlunit.sourceforge.net/) - HTML web page scraping
|
||||
- [InAudible-NG](https://github.com/inAudible-NG/RainbowCrack-NG) - Key discovery
|
||||
- [InAudible-NG](https://github.com/inAudible-NG/) - Decode
|
||||
|
||||
## Contributing
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ public class Audible implements IQueueListener<Book> {
|
|||
|
||||
}
|
||||
|
||||
public void initConverter() throws IOException {
|
||||
public void initConverter() {
|
||||
convertQueue = new ConvertQueue();
|
||||
convertToMP3 = true;
|
||||
convertQueue.addListener(this);
|
||||
|
@ -659,7 +659,7 @@ public class Audible implements IQueueListener<Book> {
|
|||
return out;
|
||||
}
|
||||
|
||||
public void setExternalCookies(AudibleScraper s, Collection<Cookie> cookies) throws Exception {
|
||||
public void setExternalCookies(AudibleScraper s, Collection<Cookie> cookies) {
|
||||
CookieManager cm = s.getWebClient().getCookieManager();
|
||||
|
||||
// try {
|
||||
|
|
|
@ -17,7 +17,7 @@ import java.util.logging.Level;
|
|||
public class AudibleCLI {
|
||||
private static final Log LOG = LogFactory.getLog(AudibleCLI.class);
|
||||
|
||||
final Audible audible= new Audible();;
|
||||
final Audible audible= new Audible();
|
||||
volatile boolean quit = false;
|
||||
|
||||
public AudibleCLI() {
|
||||
|
@ -247,7 +247,7 @@ public class AudibleCLI {
|
|||
println("Done " + f);
|
||||
}
|
||||
|
||||
private void test(List<Book> bookList) throws Exception {
|
||||
private void test(List<Book> bookList) {
|
||||
|
||||
for (Book b : bookList) {
|
||||
|
||||
|
|
|
@ -236,7 +236,7 @@ public class AudibleScraper {
|
|||
|
||||
|
||||
|
||||
ArrayList<Book> parseLibraryFragment(DomDocumentFragment fragment) throws IOException {
|
||||
ArrayList<Book> parseLibraryFragment(DomDocumentFragment fragment) {
|
||||
ArrayList<Book> list = new ArrayList<>();
|
||||
ArrayList<String> colNames = new ArrayList<>();
|
||||
|
||||
|
@ -538,7 +538,7 @@ public class AudibleScraper {
|
|||
}
|
||||
}
|
||||
|
||||
public void signOut() throws FailingHttpStatusCodeException, IOException, InterruptedException {
|
||||
public void signOut() throws FailingHttpStatusCodeException, IOException {
|
||||
if (getProgress() != null)
|
||||
getProgress().setTask("Signing out");
|
||||
setURL("/signout");
|
||||
|
@ -905,7 +905,7 @@ public class AudibleScraper {
|
|||
return null;
|
||||
}
|
||||
|
||||
private boolean parseBookPage(HtmlPage page, Book b) throws Exception {
|
||||
private boolean parseBookPage(HtmlPage page, Book b) {
|
||||
DomNode h = page;
|
||||
if (getProgress() != null)
|
||||
getProgress().setTask("Parsing book", b.toString());
|
||||
|
|
|
@ -6,7 +6,7 @@ import org.openaudible.AudibleAccountPrefs;
|
|||
* Created 6/27/2017.
|
||||
*/
|
||||
public interface ConnectionListener {
|
||||
public void connectionChanged(boolean connected);
|
||||
public AudibleAccountPrefs getAccountPrefs(AudibleAccountPrefs in);
|
||||
void connectionChanged(boolean connected);
|
||||
AudibleAccountPrefs getAccountPrefs(AudibleAccountPrefs in);
|
||||
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public class ConvertJob implements IQueueJob, LineListener {
|
|||
return "convert " + book;
|
||||
}
|
||||
|
||||
private String getExecutable() throws IOException {
|
||||
private String getExecutable() {
|
||||
return FFMPEG.getExecutable();
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ public class ConvertJob implements IQueueJob, LineListener {
|
|||
// take status from ffmpeg, example:
|
||||
// frame= 1 fps=0.0 q=0.0 size= 2kB time=06:17:11.44 bitrate= 0.0kbits/s
|
||||
@Override
|
||||
public void takeLine(String s) throws Exception {
|
||||
public void takeLine(String s) {
|
||||
String find = "time=";
|
||||
int ch = s.indexOf(find);
|
||||
if (ch!=-1) {
|
||||
|
|
|
@ -5,7 +5,6 @@ import org.apache.commons.logging.Log;
|
|||
import org.apache.commons.logging.LogFactory;
|
||||
import org.openaudible.Audible;
|
||||
import org.openaudible.books.Book;
|
||||
import org.openaudible.progress.IProgressTask;
|
||||
import org.openaudible.util.queues.IQueueJob;
|
||||
import org.openaudible.util.queues.JobProgress;
|
||||
import org.openaudible.util.queues.ThreadedQueue;
|
||||
|
|
|
@ -371,7 +371,7 @@ public class ProgressDialog extends ProgressMonitorDialog {
|
|||
}
|
||||
|
||||
class LongRunningOperation implements IRunnableWithProgress {
|
||||
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||
public void run(IProgressMonitor monitor) throws InterruptedException {
|
||||
// DebugLog.println("Running task");
|
||||
monitor.beginTask("Running task ", IProgressMonitor.UNKNOWN);
|
||||
if (simpleThread != null) {
|
||||
|
|
|
@ -37,7 +37,7 @@ public class ProgressTask extends Thread implements IProgressTask {
|
|||
progress.getProgressMonitor().beginTask(name, totalWork);
|
||||
}
|
||||
|
||||
public void worked(int i) throws InterruptedException {
|
||||
public void worked(int i) {
|
||||
progress.getProgressMonitor().worked(i);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,31 +1,15 @@
|
|||
package org.openaudible.desktop.swt.manager;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.FileDialog;
|
||||
import org.openaudible.Audible;
|
||||
import org.openaudible.AudibleAccountPrefs;
|
||||
import org.openaudible.AudibleRegion;
|
||||
import org.openaudible.Directories;
|
||||
import org.openaudible.books.BookNotifier;
|
||||
import org.openaudible.desktop.swt.gui.GUI;
|
||||
import org.openaudible.desktop.swt.gui.MessageBoxFactory;
|
||||
import org.openaudible.desktop.swt.gui.SWTAsync;
|
||||
import org.openaudible.desktop.swt.gui.progress.ProgressDialog;
|
||||
import org.openaudible.desktop.swt.gui.progress.ProgressTask;
|
||||
import org.openaudible.desktop.swt.manager.menu.AppMenu;
|
||||
import org.openaudible.desktop.swt.manager.menu.CommandCenter;
|
||||
import org.openaudible.desktop.swt.manager.views.MainWindow;
|
||||
import org.openaudible.desktop.swt.util.shop.PaintShop;
|
||||
import org.openaudible.util.HTMLUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
public class Application extends GUI {
|
||||
|
|
|
@ -70,7 +70,7 @@ public class AudibleGUI implements BookListener, ConnectionListener {
|
|||
public boolean checkFFMPEG() {
|
||||
|
||||
try {
|
||||
Thread.sleep(8000);
|
||||
// Thread.sleep(4000);
|
||||
String vers = FFMPEG.getVersion();
|
||||
LOG.info("using " + vers);
|
||||
hasFFMPEG = true;
|
||||
|
@ -100,7 +100,6 @@ public class AudibleGUI implements BookListener, ConnectionListener {
|
|||
// converting aax to mp3.
|
||||
audible.convertQueue.addListener(queueListener);
|
||||
|
||||
new Thread(() -> checkFFMPEG()).start();
|
||||
|
||||
|
||||
ConnectionNotifier.instance.addListener(this);
|
||||
|
@ -305,7 +304,9 @@ public class AudibleGUI implements BookListener, ConnectionListener {
|
|||
}
|
||||
|
||||
public void convertMP3(Collection<Book> list) {
|
||||
bookNotifier.setEnabled(false);
|
||||
audible.convertQueue.addAll(list);
|
||||
bookNotifier.setEnabled(true);
|
||||
bookNotifier.booksUpdated();
|
||||
}
|
||||
|
||||
|
@ -479,12 +480,10 @@ public class AudibleGUI implements BookListener, ConnectionListener {
|
|||
public boolean canViewInAudible() {
|
||||
Book b = onlyOneSelected();
|
||||
if (b != null) {
|
||||
if (!b.getInfoLink().isEmpty())
|
||||
return true;
|
||||
return !b.getInfoLink().isEmpty();
|
||||
// might have to search...
|
||||
// Can search for Product_ID and get one result..
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -496,8 +495,7 @@ public class AudibleGUI implements BookListener, ConnectionListener {
|
|||
|
||||
Book b = onlyOneSelected();
|
||||
if (b != null) {
|
||||
if (audible.hasMP3(b))
|
||||
return true;
|
||||
return audible.hasMP3(b);
|
||||
}
|
||||
|
||||
|
||||
|
@ -699,6 +697,7 @@ public class AudibleGUI implements BookListener, ConnectionListener {
|
|||
|
||||
@Override
|
||||
public void booksUpdated() {
|
||||
// TODO: Ensure this isn't called too frequently.
|
||||
audible.updateFileCache();
|
||||
int d = 0;
|
||||
int c = 0;
|
||||
|
@ -948,9 +947,9 @@ public class AudibleGUI implements BookListener, ConnectionListener {
|
|||
if (prefsFile.exists()) {
|
||||
String content = HTMLUtil.readFile(prefsFile);
|
||||
prefs = gson.fromJson(content, Prefs.class);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
} catch (Throwable th) {
|
||||
LOG.info("Error loading prefs", th);
|
||||
prefs = new Prefs();
|
||||
|
@ -997,6 +996,7 @@ public class AudibleGUI implements BookListener, ConnectionListener {
|
|||
|
||||
BookNotifier.getInstance().booksUpdated();
|
||||
backgroundVersionCheck();
|
||||
new Thread(() -> checkFFMPEG()).start();
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -2,11 +2,11 @@ package org.openaudible.desktop.swt.manager;
|
|||
|
||||
public interface Version {
|
||||
|
||||
final String appName = "OpenAudible";
|
||||
final String appVersion = "0.9.4";
|
||||
final boolean appDebug = false;
|
||||
final String appLink = "http://openaudible.org";
|
||||
final String versionLink = "http://openaudible.org/swt_version.json";
|
||||
final String client = "org.openaudible.desktop.swt";
|
||||
String appName = "OpenAudible";
|
||||
String appVersion = "1.0";
|
||||
boolean appDebug = false;
|
||||
String appLink = "http://openaudible.org";
|
||||
String versionLink = "http://openaudible.org/swt_version.json";
|
||||
String client = "org.openaudible.desktop.swt";
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@ public enum VersionCheck {
|
|||
instance;
|
||||
private static final Log LOG = LogFactory.getLog(VersionCheck.class);
|
||||
|
||||
|
||||
|
||||
// if verbose return state regardless.
|
||||
// if !verbose, only alert when new version is available.
|
||||
public void checkForUpdate(Shell shell, boolean verbose) {
|
||||
|
@ -25,6 +27,13 @@ public enum VersionCheck {
|
|||
int diff = obj.get("diff").getAsInt();
|
||||
if (diff < 0) {
|
||||
MessageBoxFactory.showGeneral(shell, SWT.ICON_INFORMATION, title, msg);
|
||||
if (obj.has("site"))
|
||||
{
|
||||
String url = obj.get("site").getAsString();
|
||||
AudibleGUI.instance.browse(url);
|
||||
}
|
||||
|
||||
// TODO: Add buttons: go to web site (openaudible.org) or download update (go to mac,win, or linux download url)
|
||||
} else
|
||||
{
|
||||
if (verbose)
|
||||
|
@ -84,7 +93,7 @@ public enum VersionCheck {
|
|||
JsonObject obj =null;
|
||||
try {
|
||||
obj = getVersion();
|
||||
LOG.info(obj.toString());
|
||||
|
||||
if (!obj.has("version"))
|
||||
throw new IOException("missing version field\n" + obj);
|
||||
String releaseVersion = obj.get("version").getAsString();
|
||||
|
@ -96,6 +105,7 @@ public enum VersionCheck {
|
|||
if (diff<0) {
|
||||
title = "Update Available";
|
||||
msg = "An update is available!\nYour version: " + Version.appVersion + "\nRelease Version:" + releaseVersion;
|
||||
|
||||
}else if (diff>0) {
|
||||
title = "Using Pre-release";
|
||||
msg = "You appear to be using a pre-release version\nYour version: " + Version.appVersion + "\nLatest Version:" + releaseVersion;
|
||||
|
|
|
@ -16,11 +16,11 @@ import org.openaudible.desktop.swt.manager.Application;
|
|||
import org.openaudible.desktop.swt.manager.AudibleGUI;
|
||||
import org.openaudible.desktop.swt.manager.Version;
|
||||
import org.openaudible.desktop.swt.manager.VersionCheck;
|
||||
import org.openaudible.desktop.swt.manager.views.AboutDialog;
|
||||
import org.openaudible.desktop.swt.manager.views.AudibleBrowser;
|
||||
import org.openaudible.desktop.swt.manager.views.LogWindow;
|
||||
import org.openaudible.desktop.swt.manager.views.Preferences;
|
||||
import org.openaudible.desktop.swt.util.shop.WidgetShop;
|
||||
import org.openaudible.desktop.swt.manager.views.AboutDialog;
|
||||
import org.openaudible.desktop.swt.manager.views.LogWindow;
|
||||
|
||||
/**
|
||||
* The CommandCenter is responsible to react on user-action. User action may for example occur when any item from the main menu is selected. The execute command is the main switch for running commands
|
||||
|
|
|
@ -19,9 +19,6 @@ import org.openaudible.desktop.swt.i8n.Translate;
|
|||
import org.openaudible.desktop.swt.manager.AudibleGUI;
|
||||
import org.openaudible.desktop.swt.util.shop.FontShop;
|
||||
import org.openaudible.desktop.swt.util.shop.PaintShop;
|
||||
import org.openaudible.util.queues.IQueueJob;
|
||||
import org.openaudible.util.queues.IQueueListener;
|
||||
import org.openaudible.util.queues.ThreadedQueue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
|
|
@ -4,18 +4,10 @@ import org.apache.commons.logging.Log;
|
|||
import org.apache.commons.logging.LogFactory;
|
||||
import org.eclipse.swt.dnd.*;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.openaudible.Audible;
|
||||
import org.openaudible.audible.AudibleScraper;
|
||||
import org.openaudible.convert.AAXParser;
|
||||
import org.openaudible.desktop.swt.gui.MessageBoxFactory;
|
||||
import org.openaudible.desktop.swt.gui.SWTAsync;
|
||||
import org.openaudible.desktop.swt.gui.progress.ProgressDialog;
|
||||
import org.openaudible.desktop.swt.gui.progress.ProgressTask;
|
||||
import org.openaudible.desktop.swt.manager.AudibleGUI;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class FileDropTarget extends DropTargetAdapter
|
||||
|
|
|
@ -19,7 +19,6 @@ import org.openaudible.progress.IProgressTask;
|
|||
import org.openaudible.util.CopyWithProgress;
|
||||
import org.openaudible.util.Util;
|
||||
import org.openaudible.util.queues.IQueueJob;
|
||||
import org.openaudible.util.queues.JobProgress;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
|
|
|
@ -17,7 +17,6 @@ import java.awt.image.BufferedImage;
|
|||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ public class Console extends ConsoleHandler
|
|||
public interface ILogRecordPublisher
|
||||
{
|
||||
void publish(LogRecord l);
|
||||
};
|
||||
}
|
||||
|
||||
public final static Console instance = new Console();
|
||||
boolean installed = false;
|
||||
|
|
|
@ -3,7 +3,10 @@ package org.openaudible.util.queues;
|
|||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
|
||||
public class ThreadedQueue<E> implements IQueueListener<E> {
|
||||
private static final Log LOG = LogFactory.getLog(ThreadedQueue.class);
|
||||
|
|
Loading…
Reference in a new issue