mirror of
https://github.com/tonikelope/megabasterd.git
synced 2025-05-28 12:30:23 +02:00
2.14
Sqlite perfomance fix
This commit is contained in:
parent
b1083ffff0
commit
f32e2207ce
@ -164,7 +164,7 @@
|
||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="66" green="66" red="66" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="http://t0ni.world"/>
|
||||
<Property name="text" type="java.lang.String" value="http://toni.world"/>
|
||||
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
||||
<Color id="Cursor de Mano"/>
|
||||
</Property>
|
||||
|
@ -13,7 +13,7 @@ import static megabasterd.MiscTools.swingReflectionInvoke;
|
||||
public final class AboutDialog extends javax.swing.JDialog {
|
||||
|
||||
private static final String MEGA_URL = "https://mega.nz/#F!lYsRWaQB!uVhntmyKcVECRaOxAbcL4A";
|
||||
private static final String TONIKELOPE_URL = "http://t0ni.xyz";
|
||||
private static final String TONIKELOPE_URL = "http://toni.world";
|
||||
private static final String MEGACRYPTER_URL = "https://megacrypter.com";
|
||||
private static final String SPAIN_URL = "https://en.wikipedia.org/wiki/Spain";
|
||||
private static final String MEGABASTERD_GITHUB_URL = "https://github.com/tonikelope/megabasterd";
|
||||
@ -95,7 +95,7 @@ public final class AboutDialog extends javax.swing.JDialog {
|
||||
|
||||
author_webpage_label.setFont(new java.awt.Font("Ubuntu", 1, 16)); // NOI18N
|
||||
author_webpage_label.setForeground(new java.awt.Color(102, 102, 102));
|
||||
author_webpage_label.setText("http://t0ni.world");
|
||||
author_webpage_label.setText("http://toni.world");
|
||||
author_webpage_label.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
|
||||
author_webpage_label.setDoubleBuffered(true);
|
||||
author_webpage_label.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
|
@ -74,6 +74,19 @@ public class ChunkDownloaderMono extends ChunkDownloader {
|
||||
|
||||
error = true;
|
||||
|
||||
getDownload().rejectChunkId(chunk.getId());
|
||||
|
||||
conta_error++;
|
||||
|
||||
if (!isExit()) {
|
||||
|
||||
setError_wait(true);
|
||||
|
||||
Thread.sleep(getWaitTimeExpBackOff(conta_error) * 1000);
|
||||
|
||||
setError_wait(false);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
try {
|
||||
@ -163,6 +176,8 @@ public class ChunkDownloaderMono extends ChunkDownloader {
|
||||
|
||||
} catch (URISyntaxException ex) {
|
||||
Logger.getLogger(ChunkDownloaderMono.class.getName()).log(Level.SEVERE, null, ex);
|
||||
} catch (InterruptedException ex) {
|
||||
Logger.getLogger(ChunkDownloaderMono.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
getDownload().stopThisSlot(this);
|
||||
|
@ -6,8 +6,6 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.logging.Level;
|
||||
import static java.util.logging.Logger.getLogger;
|
||||
@ -18,8 +16,6 @@ import static java.util.logging.Logger.getLogger;
|
||||
*/
|
||||
public final class DBTools {
|
||||
|
||||
public static final int MAX_TRANSFERENCES_QUERY = 100;
|
||||
|
||||
public static synchronized void setupSqliteTables() throws SQLException {
|
||||
|
||||
try (Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) {
|
||||
@ -70,27 +66,16 @@ public final class DBTools {
|
||||
|
||||
public static synchronized void deleteDownloads(String[] urls) throws SQLException {
|
||||
|
||||
for (int n = 0, t = 0; t < urls.length; n++) {
|
||||
try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("DELETE FROM downloads WHERE url=?")) {
|
||||
|
||||
String[] sub_array = Arrays.copyOfRange(urls, n * MAX_TRANSFERENCES_QUERY, t + Math.min(MAX_TRANSFERENCES_QUERY, urls.length - t));
|
||||
for (String url : urls) {
|
||||
|
||||
t += sub_array.length;
|
||||
ps.setString(1, url);
|
||||
|
||||
String whereClause = String.format("url in (%s)", String.join(",", Collections.nCopies(sub_array.length, "?")));
|
||||
|
||||
try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("DELETE FROM downloads WHERE " + whereClause)) {
|
||||
|
||||
int i = 1;
|
||||
|
||||
for (String value : sub_array) {
|
||||
|
||||
ps.setString(i, value);
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
ps.executeUpdate();
|
||||
ps.addBatch();
|
||||
}
|
||||
|
||||
ps.executeBatch();
|
||||
}
|
||||
}
|
||||
|
||||
@ -137,29 +122,17 @@ public final class DBTools {
|
||||
|
||||
public static synchronized void deleteUploads(String[][] uploads) throws SQLException {
|
||||
|
||||
for (int n = 0, t = 0; t < uploads.length; n++) {
|
||||
try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("DELETE FROM uploads WHERE filename=? AND email=?")) {
|
||||
|
||||
String[][] sub_array = Arrays.copyOfRange(uploads, n * MAX_TRANSFERENCES_QUERY, t + Math.min(MAX_TRANSFERENCES_QUERY, uploads.length - t));
|
||||
for (String[] upload : uploads) {
|
||||
|
||||
t += sub_array.length;
|
||||
ps.setString(1, upload[0]);
|
||||
ps.setString(2, upload[1]);
|
||||
|
||||
String whereClause = String.join(" OR ", Collections.nCopies(sub_array.length, "(filename=? AND email=?)"));
|
||||
|
||||
try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("DELETE FROM uploads WHERE " + whereClause)) {
|
||||
|
||||
int i = 1;
|
||||
|
||||
for (String[] pair : sub_array) {
|
||||
|
||||
ps.setString(i, pair[0]);
|
||||
|
||||
ps.setString(i + 1, pair[1]);
|
||||
|
||||
i += 2;
|
||||
}
|
||||
|
||||
ps.executeUpdate();
|
||||
ps.addBatch();
|
||||
}
|
||||
|
||||
ps.executeBatch();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ public final class Download implements Transference, Runnable, SecureSingleThrea
|
||||
|
||||
public static final boolean VERIFY_CBC_MAC_DEFAULT = false;
|
||||
public static final boolean USE_SLOTS_DEFAULT = false;
|
||||
public static final int WORKERS_DEFAULT = 4;
|
||||
public static final int WORKERS_DEFAULT = 6;
|
||||
public static final boolean USE_MEGA_ACCOUNT_DOWN = false;
|
||||
|
||||
private final MainPanel _main_panel;
|
||||
|
@ -45,10 +45,10 @@
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="status_label" max="32767" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="slots_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="slots_spinner" min="-2" pref="49" max="-2" attributes="0"/>
|
||||
<Component id="slots_spinner" min="-2" pref="55" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="file_name_label" min="-2" max="-2" attributes="0"/>
|
||||
|
@ -251,10 +251,10 @@ public final class DownloadView extends javax.swing.JPanel implements Transferen
|
||||
.addComponent(pause_button))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(status_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(slots_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(slots_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(slots_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(file_name_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
|
@ -39,7 +39,7 @@
|
||||
<Component id="link_detected_label" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="warning_label" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="87" max="32767" attributes="0"/>
|
||||
<EmptySpace min="0" pref="250" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
@ -47,7 +47,7 @@
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="folder_link_label" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="restore_button" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
|
@ -184,13 +184,13 @@ public final class FolderLinkDialog extends javax.swing.JDialog {
|
||||
.addComponent(skip_button))
|
||||
.addComponent(link_detected_label)
|
||||
.addComponent(warning_label))
|
||||
.addGap(0, 87, Short.MAX_VALUE))
|
||||
.addGap(0, 250, Short.MAX_VALUE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(dance_button))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(folder_link_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(restore_button)))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
@ -135,7 +135,7 @@
|
||||
<Component class="javax.swing.JLabel" name="status_label">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Dialog" size="14" style="1"/>
|
||||
<Font name="Ubuntu" size="14" style="1"/>
|
||||
</Property>
|
||||
<Property name="doubleBuffered" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
|
@ -124,7 +124,7 @@ public class GetMasterPasswordDialog extends javax.swing.JDialog {
|
||||
please_label.setText("Please, enter your master password");
|
||||
please_label.setDoubleBuffered(true);
|
||||
|
||||
status_label.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
|
||||
status_label.setFont(new java.awt.Font("Ubuntu", 1, 14)); // NOI18N
|
||||
status_label.setDoubleBuffered(true);
|
||||
|
||||
remember_checkbox.setFont(new java.awt.Font("Ubuntu", 1, 16)); // NOI18N
|
||||
|
@ -154,7 +154,7 @@
|
||||
<Component class="javax.swing.JLabel" name="download_dir_label">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Dialog" size="16" style="1"/>
|
||||
<Font name="Ubuntu" size="16" style="1"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
|
@ -153,7 +153,7 @@ public final class LinkGrabberDialog extends javax.swing.JDialog implements Clip
|
||||
down_dir_to_label.setText("Download to: ");
|
||||
down_dir_to_label.setDoubleBuffered(true);
|
||||
|
||||
download_dir_label.setFont(new java.awt.Font("Dialog", 1, 16)); // NOI18N
|
||||
download_dir_label.setFont(new java.awt.Font("Ubuntu", 1, 16)); // NOI18N
|
||||
|
||||
dlc_button.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N
|
||||
dlc_button.setText("Load DLC container");
|
||||
|
@ -58,7 +58,7 @@ import org.apache.http.auth.UsernamePasswordCredentials;
|
||||
*/
|
||||
public final class MainPanel {
|
||||
|
||||
public static final String VERSION = "2.13";
|
||||
public static final String VERSION = "2.14";
|
||||
public static final int THROTTLE_SLICE_SIZE = 16 * 1024;
|
||||
public static final int STREAMER_PORT = 1337;
|
||||
public static final int WATCHDOG_PORT = 1338;
|
||||
|
@ -38,7 +38,7 @@ public final class MegaAPI {
|
||||
public static final String API_URL = "https://g.api.mega.co.nz";
|
||||
public static final String API_KEY = null;
|
||||
public static final int REQ_ID_LENGTH = 10;
|
||||
public static final Integer[] MEGA_ERROR_EXCEPTION_CODES = {-2, -8, -9, -10, -11, -12, -13, -14, -15, -16};
|
||||
public static final Integer[] MEGA_ERROR_EXCEPTION_CODES = {-2, -8, -9, -10, -11, -12, -13, -14, -15, -16, -17};
|
||||
|
||||
public static int checkMEGAError(String data) {
|
||||
String error = findFirstRegex("^\\[?(\\-[0-9]+)\\]?$", data, 1);
|
||||
@ -296,8 +296,14 @@ public final class MegaAPI {
|
||||
try (CloseableHttpResponse httpresponse = httpclient.execute(httppost)) {
|
||||
|
||||
if (httpresponse.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
|
||||
System.out.println(request + " " + url_api.toString());
|
||||
System.out.println("Failed : HTTP error code : " + httpresponse.getStatusLine().getStatusCode());
|
||||
|
||||
if (httpresponse.getStatusLine().getStatusCode() == 509) {
|
||||
|
||||
error = -17;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
InputStream is = httpresponse.getEntity().getContent();
|
||||
|
@ -174,7 +174,7 @@
|
||||
<Component class="javax.swing.JLabel" name="status_label">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Dialog" size="14" style="1"/>
|
||||
<Font name="Ubuntu" size="14" style="1"/>
|
||||
</Property>
|
||||
<Property name="doubleBuffered" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
|
@ -130,7 +130,7 @@ public class SetMasterPasswordDialog extends javax.swing.JDialog {
|
||||
new_pass_textfield.setFont(new java.awt.Font("Ubuntu", 0, 18)); // NOI18N
|
||||
new_pass_textfield.setDoubleBuffered(true);
|
||||
|
||||
status_label.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
|
||||
status_label.setFont(new java.awt.Font("Ubuntu", 1, 14)); // NOI18N
|
||||
status_label.setDoubleBuffered(true);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||
|
@ -153,7 +153,7 @@
|
||||
<Component id="use_mega_account_down_combobox" min="-2" pref="569" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<EmptySpace min="0" pref="5" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
@ -210,7 +210,7 @@
|
||||
<Component id="use_mega_account_down_combobox" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="use_mega_label" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="92" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="91" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@ -339,7 +339,7 @@
|
||||
<Component class="javax.swing.JLabel" name="rec_download_slots_label">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Ubuntu" size="12" style="0"/>
|
||||
<Font name="Ubuntu" size="14" style="2"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Note: it is recommended not to enable MULTI SLOT (unless you want to download +5GB file without PRO account, in which case you will MUST USE multi slot). "/>
|
||||
</Properties>
|
||||
@ -422,7 +422,7 @@
|
||||
</Group>
|
||||
<Component id="limit_upload_speed_checkbox" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="451" max="32767" attributes="0"/>
|
||||
<EmptySpace min="0" pref="406" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
@ -545,9 +545,9 @@
|
||||
<Component class="javax.swing.JLabel" name="rec_upload_slots_label">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Ubuntu" size="16" style="0"/>
|
||||
<Font name="Ubuntu" size="16" style="2"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Note: it is recommended to enable MULTI SLOT with 4 slots."/>
|
||||
<Property name="text" type="java.lang.String" value="Note: MULTI-SLOT it's more robust against upload errors but it might be slower."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
@ -1051,7 +1051,7 @@
|
||||
<Component class="javax.swing.JLabel" name="status">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Dialog" size="20" style="1"/>
|
||||
<Font name="Ubuntu" size="20" style="1"/>
|
||||
</Property>
|
||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="eb" green="6d" red="9" type="rgb"/>
|
||||
|
@ -575,7 +575,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
default_dir_label.setFont(new java.awt.Font("Ubuntu", 1, 20)); // NOI18N
|
||||
|
||||
rec_download_slots_label.setFont(new java.awt.Font("Ubuntu", 0, 12)); // NOI18N
|
||||
rec_download_slots_label.setFont(new java.awt.Font("Ubuntu", 2, 14)); // NOI18N
|
||||
rec_download_slots_label.setText("Note: it is recommended not to enable MULTI SLOT (unless you want to download +5GB file without PRO account, in which case you will MUST USE multi slot). ");
|
||||
|
||||
use_mega_account_down_checkbox.setFont(new java.awt.Font("Ubuntu", 1, 20)); // NOI18N
|
||||
@ -635,7 +635,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
.addComponent(use_mega_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(use_mega_account_down_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, 569, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addGap(0, 0, Short.MAX_VALUE)))
|
||||
.addGap(0, 5, Short.MAX_VALUE)))
|
||||
.addContainerGap())
|
||||
);
|
||||
downloads_panelLayout.setVerticalGroup(
|
||||
@ -683,7 +683,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
.addGroup(downloads_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(use_mega_account_down_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(use_mega_label))
|
||||
.addContainerGap(92, Short.MAX_VALUE))
|
||||
.addContainerGap(91, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jTabbedPane1.addTab("Downloads", downloads_panel);
|
||||
@ -725,8 +725,8 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
}
|
||||
});
|
||||
|
||||
rec_upload_slots_label.setFont(new java.awt.Font("Ubuntu", 0, 16)); // NOI18N
|
||||
rec_upload_slots_label.setText("Note: it is recommended to enable MULTI SLOT with 4 slots.");
|
||||
rec_upload_slots_label.setFont(new java.awt.Font("Ubuntu", 2, 16)); // NOI18N
|
||||
rec_upload_slots_label.setText("Note: MULTI-SLOT it's more robust against upload errors but it might be slower.");
|
||||
|
||||
javax.swing.GroupLayout uploads_panelLayout = new javax.swing.GroupLayout(uploads_panel);
|
||||
uploads_panel.setLayout(uploads_panelLayout);
|
||||
@ -757,7 +757,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
.addGap(98, 98, 98)
|
||||
.addComponent(max_up_speed_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(limit_upload_speed_checkbox))
|
||||
.addGap(0, 451, Short.MAX_VALUE)))
|
||||
.addGap(0, 406, Short.MAX_VALUE)))
|
||||
.addContainerGap())
|
||||
);
|
||||
uploads_panelLayout.setVerticalGroup(
|
||||
@ -1113,7 +1113,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
jTabbedPane1.addTab("Advanced", jPanel1);
|
||||
|
||||
status.setFont(new java.awt.Font("Dialog", 1, 20)); // NOI18N
|
||||
status.setFont(new java.awt.Font("Ubuntu", 1, 20)); // NOI18N
|
||||
status.setForeground(new java.awt.Color(9, 109, 235));
|
||||
status.setDoubleBuffered(true);
|
||||
|
||||
|
@ -39,7 +39,7 @@ public final class SqliteSingleton {
|
||||
|
||||
Class.forName("org.sqlite.JDBC");
|
||||
|
||||
conn = DriverManager.getConnection("jdbc:sqlite:" + SQLITE_FILE);
|
||||
conn = DriverManager.getConnection("jdbc:sqlite:" + SQLITE_FILE + "?journal_mode=WAL&synchronous=OFF&journal_size_limit=500");
|
||||
|
||||
_connections_map.put(Thread.currentThread(), conn);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
public interface Transference {
|
||||
|
||||
int MIN_WORKERS = 2;
|
||||
int MAX_WORKERS = 10;
|
||||
int MAX_WORKERS = 20;
|
||||
int MAX_SIM_TRANSFERENCES = 20;
|
||||
int SIM_TRANSFERENCES_DEFAULT = 2;
|
||||
boolean LIMIT_TRANSFERENCE_SPEED_DEFAULT = false;
|
||||
|
@ -34,7 +34,7 @@ import static megabasterd.MiscTools.truncateText;
|
||||
public final class Upload implements Transference, Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
public static final boolean USE_SLOTS_DEFAULT = true;
|
||||
public static final int WORKERS_DEFAULT = 4;
|
||||
public static final int WORKERS_DEFAULT = 6;
|
||||
private final MainPanel _main_panel;
|
||||
private volatile UploadView _view = null; //lazy init
|
||||
private volatile ProgressMeter _progress_meter = null; //lazy init
|
||||
|
@ -50,10 +50,10 @@
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="status_label" max="32767" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="slots_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="slots_spinner" min="-2" pref="49" max="-2" attributes="0"/>
|
||||
<Component id="slots_spinner" min="-2" pref="55" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="file_name_label" min="-2" max="-2" attributes="0"/>
|
||||
|
@ -238,10 +238,10 @@ public final class UploadView extends javax.swing.JPanel implements Transference
|
||||
.addComponent(stop_button))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(status_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(slots_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(slots_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(slots_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(file_name_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user