tonikelope 2021-10-13 18:04:41 +02:00
parent 646eb6b09e
commit b637140a06
6 changed files with 37 additions and 16 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.tonikelope</groupId>
<artifactId>MegaBasterd</artifactId>
<version>7.44</version>
<version>7.45</version>
<packaging>jar</packaging>
<dependencies>
<dependency>

View File

@ -504,10 +504,12 @@ public class Download implements Transference, Runnable, SecureSingleThreadNotif
_closed = true;
try {
deleteDownload(_url);
} catch (SQLException ex) {
LOG.log(SEVERE, null, ex);
if (_provision_ok) {
try {
deleteDownload(_url);
} catch (SQLException ex) {
LOG.log(SEVERE, null, ex);
}
}
_main_panel.getDownload_manager().getTransference_remove_queue().add(this);

View File

@ -60,7 +60,7 @@ import javax.swing.UIManager;
*/
public final class MainPanel {
public static final String VERSION = "7.44";
public static final String VERSION = "7.45";
public static final boolean FORCE_SMART_PROXY = false; //TRUE FOR DEBUGING SMART PROXY
public static final int THROTTLE_SLICE_SIZE = 16 * 1024;
public static final int DEFAULT_BYTE_BUFFER_SIZE = 16 * 1024;

View File

@ -1402,9 +1402,16 @@ public class MiscTools {
public static String newMegaLinks2Legacy(String data) {
String replace1 = data.replaceAll("https://mega\\.nz/folder/([^#]+)#(.+)", "https://mega.nz/#F!$1!$2");
data = MiscTools.addHTTPSToMegaLinks(data);
return replace1.replaceAll("https://mega\\.nz/file/([^#]+)#(.+)", "https://mega.nz/#!$1!$2");
String replace1 = data.replaceAll("(?:https://)?mega(?:\\.co)?\\.nz/folder/([^#]+)#(.+)", "https://mega.nz/#F!$1!$2");
return replace1.replaceAll("(?:https://)?mega(?:\\.co)?\\.nz/file/([^#]+)#(.+)", "https://mega.nz/#!$1!$2");
}
public static String addHTTPSToMegaLinks(String data) {
return data.replaceAll("(?<!http://|https://)mega(?:\\.co)?\\.nz", "https://mega.nz");
}
/* This method changes the MEGA extension URL to a ordinary MEGA URL,

View File

@ -557,6 +557,18 @@ abstract public class TransferenceManager implements Runnable, SecureSingleThrea
secureNotify();
}
protected boolean hasFrozenTransferences() {
for (Transference t : getTransference_waitstart_queue()) {
if (t.isFrozen()) {
return true;
}
}
return false;
}
public ConcurrentLinkedQueue<Transference> getTransference_waitstart_aux_queue() {
return _transference_waitstart_aux_queue;
}
@ -596,10 +608,9 @@ abstract public class TransferenceManager implements Runnable, SecureSingleThrea
_pause_all_button.setText(LabelTranslatorSingleton.getInstance().translate("RESUME ALL"));
} else {
_pause_all_button.setText(LabelTranslatorSingleton.getInstance().translate("PAUSE ALL"));
_pause_all_button.setVisible(!getTransference_running_list().isEmpty());
}
_pause_all_button.setVisible(!getTransference_running_list().isEmpty());
_clean_all_menu.getComponent().setEnabled(!_transference_preprocess_queue.isEmpty() || !_transference_provision_queue.isEmpty() || !getTransference_waitstart_queue().isEmpty());
if (!_transference_finished_queue.isEmpty() && _isOKFinishedInQueue()) {
@ -615,7 +626,7 @@ abstract public class TransferenceManager implements Runnable, SecureSingleThrea
_status.setText(_genStatus());
_main_panel.getView().getUnfreeze_transferences_button().setVisible(_main_panel.getDownload_manager().isFrozen() || _main_panel.getUpload_manager().isFrozen());
_main_panel.getView().getUnfreeze_transferences_button().setVisible(_main_panel.getDownload_manager().hasFrozenTransferences() || _main_panel.getUpload_manager().hasFrozenTransferences());
_main_panel.getView().revalidate();

View File

@ -540,12 +540,13 @@ public class Upload implements Transference, Runnable, SecureSingleThreadNotifia
_closed = true;
try {
DBTools.deleteUpload(_file_name, _ma.getFull_email());
} catch (SQLException ex) {
LOG.log(Level.SEVERE, ex.getMessage());
if (_provision_ok) {
try {
DBTools.deleteUpload(_file_name, _ma.getFull_email());
} catch (SQLException ex) {
LOG.log(Level.SEVERE, ex.getMessage());
}
}
_main_panel.getUpload_manager().getTransference_remove_queue().add(this);
_main_panel.getUpload_manager().secureNotify();