@ -113,8 +113,9 @@ public class ServerSetting implements SimpleListItem {
@@ -113,8 +113,9 @@ public class ServerSetting implements SimpleListItem {
@Override
publicStringgetName(){
if(!TextUtils.isEmpty(name))
if(!TextUtils.isEmpty(name)){
returnname;
}
if(!TextUtils.isEmpty(address)){
Stringhost=Uri.parse(address).getHost();
returnhost==null?DEFAULT_NAME:host;
@ -221,13 +222,13 @@ public class ServerSetting implements SimpleListItem {
@@ -221,13 +222,13 @@ public class ServerSetting implements SimpleListItem {
publicStringgetHumanReadableIdentifier(){
if(isAutoGenerated){
// Hide the 'implementation details'; just give the username and server
@ -235,11 +236,12 @@ public class ServerSetting implements SimpleListItem {
@@ -235,11 +236,12 @@ public class ServerSetting implements SimpleListItem {
@ -279,13 +281,15 @@ public class ServerSetting implements SimpleListItem {
@@ -279,13 +281,15 @@ public class ServerSetting implements SimpleListItem {
// The local integer key is converted to the idString string.
// The host name address used is dependent on the network that we are currently connected to (to allow a
// distinct connection IP or host name when connected to a local network).
if(!TextUtils.isEmpty(localNetwork))
Log.d(caller,"Creating adapter for "+name+" of type "+type.name()+": connected to "
+connectedToNetwork+" and configured local network is "+localNetwork);
if(!TextUtils.isEmpty(localNetwork)){
Log_.getInstance_(caller)
.d("ServerSetting","Creating adapter for "+name+" of type "+type.name()+": connected to "+
connectedToNetwork+" and configured local network is "+localNetwork);
@ -95,6 +95,8 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@@ -95,6 +95,8 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
// Settings
@Bean
protectedLoglog;
@Bean
protectedNavigationHelpernavigationHelper;
@Bean
protectedConnectivityHelperconnectivityHelper;
@ -185,7 +187,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@@ -185,7 +187,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@ -198,7 +200,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@@ -198,7 +200,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@ -210,7 +212,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@@ -210,7 +212,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@ -222,7 +224,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@@ -222,7 +224,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@ -234,7 +236,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@@ -234,7 +236,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@ -246,7 +248,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@@ -246,7 +248,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@ -258,7 +260,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@@ -258,7 +260,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@ -269,7 +271,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@@ -269,7 +271,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@ -293,7 +295,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@@ -293,7 +295,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@ -305,7 +307,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@@ -305,7 +307,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@ -317,7 +319,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@@ -317,7 +319,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@ -328,7 +330,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@@ -328,7 +330,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@ -340,7 +342,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@@ -340,7 +342,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@ -373,7 +375,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@@ -373,7 +375,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@ -180,7 +174,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
@@ -180,7 +174,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
@ -158,7 +157,8 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
@@ -158,7 +157,8 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
@ -213,14 +213,14 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
@@ -213,14 +213,14 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
// Filter the list of torrents to show according to navigation and text filters
@ -33,14 +33,15 @@ public class LogUncaughtExceptionHandler implements Thread.UncaughtExceptionHand
@@ -33,14 +33,15 @@ public class LogUncaughtExceptionHandler implements Thread.UncaughtExceptionHand
@ -71,6 +77,83 @@ public class MainSettingsActivity extends PreferenceActivity {
@@ -71,6 +77,83 @@ public class MainSettingsActivity extends PreferenceActivity {
@ -86,8 +169,9 @@ public class MainSettingsActivity extends PreferenceActivity {
@@ -86,8 +169,9 @@ public class MainSettingsActivity extends PreferenceActivity {
@ -96,14 +180,17 @@ public class MainSettingsActivity extends PreferenceActivity {
@@ -96,14 +180,17 @@ public class MainSettingsActivity extends PreferenceActivity {
@ -115,13 +202,12 @@ public class MainSettingsActivity extends PreferenceActivity {
@@ -115,13 +202,12 @@ public class MainSettingsActivity extends PreferenceActivity {
@ -156,9 +242,8 @@ public class MainSettingsActivity extends PreferenceActivity {
@@ -156,9 +242,8 @@ public class MainSettingsActivity extends PreferenceActivity {
@ -171,17 +256,17 @@ public class MainSettingsActivity extends PreferenceActivity {
@@ -171,17 +256,17 @@ public class MainSettingsActivity extends PreferenceActivity {
@ -210,114 +295,18 @@ public class MainSettingsActivity extends PreferenceActivity {
@@ -210,114 +295,18 @@ public class MainSettingsActivity extends PreferenceActivity {
@ -119,8 +119,8 @@ public class ServerSettingsActivity extends KeyBoundPreferencesActivity {
@@ -119,8 +119,8 @@ public class ServerSettingsActivity extends KeyBoundPreferencesActivity {
@ -99,7 +103,7 @@ public class XirvikSharedSettingsActivity extends KeyBoundPreferencesActivity {
@@ -99,7 +103,7 @@ public class XirvikSharedSettingsActivity extends KeyBoundPreferencesActivity {
}catch(Exceptione){
Log.d(XirvikSharedSettingsActivity.this,
log.d(XirvikSharedSettingsActivity.this,
"Could not retrieve the Xirvik shared seedbox RPC mount point setting: "+e.toString());
returnnull;
@ -126,7 +130,7 @@ public class XirvikSharedSettingsActivity extends KeyBoundPreferencesActivity {
@@ -126,7 +130,7 @@ public class XirvikSharedSettingsActivity extends KeyBoundPreferencesActivity {
"Skip the RSS checker service, as background data is disabled, the service is disabled or we are not connected.");
return;
}
@ -76,15 +78,16 @@ public class RssCheckerService extends IntentService {
@@ -76,15 +78,16 @@ public class RssCheckerService extends IntentService {
try{
if(!feed.shouldAlarmOnNewItems()){
Log.d(this,"Skip checker for "+feed.getName()+" as alarms are disabled");
log.d(this,"Skip checker for "+feed.getName()+" as alarms are disabled");
continue;
}
Log.d(this,"Try to parse "+feed.getName()+" ("+feed.getUrl()+")");
log.d(this,"Try to parse "+feed.getName()+" ("+feed.getUrl()+")");
RssParserparser=newRssParser(feed.getUrl());
parser.parse();
if(parser.getChannel()==null)
if(parser.getChannel()==null){
continue;
}
// Find the last item that is newer than the last viewed date
for(Itemitem:parser.getChannel().getItems()){
@ -92,13 +95,14 @@ public class RssCheckerService extends IntentService {
@@ -92,13 +95,14 @@ public class RssCheckerService extends IntentService {
break;
}else{
unread++;
if(!hasUnread.contains(feed.getName()))
if(!hasUnread.contains(feed.getName())){
hasUnread.add(feed.getName());
}
}
}
Log.d(this,feed.getName()+" has "+(hasUnread.contains(feed.getName())?"":"no ")
+"unread items");
log.d(this,
feed.getName()+" has "+(hasUnread.contains(feed.getName())?"":"no ")+"unread items");
}catch(Exceptione){
// Ignore RSS feeds that could not be retrieved or parsed
@ -111,17 +115,17 @@ public class RssCheckerService extends IntentService {
@@ -111,17 +115,17 @@ public class RssCheckerService extends IntentService {
}
// Provide a notification, since there are new RSS items
"Skip the server checker service, as background data is disabled, the service is disabled or we are not connected.");
return;
}
@ -92,13 +94,13 @@ public class ServerCheckerService extends IntentService {
@@ -92,13 +94,13 @@ public class ServerCheckerService extends IntentService {
// Check for differences between the last and the current stats
JSONArraycurrentStats=newJSONArray();
@ -133,7 +135,7 @@ public class ServerCheckerService extends IntentService {
@@ -133,7 +135,7 @@ public class ServerCheckerService extends IntentService {
@ -80,23 +81,73 @@ public class ListWidgetConfigActivity extends Activity {
@@ -80,23 +81,73 @@ public class ListWidgetConfigActivity extends Activity {
@ -104,8 +155,8 @@ public class ListWidgetConfigActivity extends Activity {
@@ -104,8 +155,8 @@ public class ListWidgetConfigActivity extends Activity {
@ -119,10 +170,10 @@ public class ListWidgetConfigActivity extends Activity {
@@ -119,10 +170,10 @@ public class ListWidgetConfigActivity extends Activity {
@ -156,31 +207,17 @@ public class ListWidgetConfigActivity extends Activity {
@@ -156,31 +207,17 @@ public class ListWidgetConfigActivity extends Activity {
@ -201,22 +238,27 @@ public class ListWidgetConfigActivity extends Activity {
@@ -201,22 +238,27 @@ public class ListWidgetConfigActivity extends Activity {
protectedvoidfilterTorrents(){
// All spinners have to be initialised already
if(serverSpinner.getSelectedItem()==null)
if(serverSpinner.getSelectedItem()==null){
return;
if(filterSpinner.getSelectedItem()==null)
}
if(filterSpinner.getSelectedItem()==null){
return;
if(sortSpinner.getSelectedItem()==null)
}
if(sortSpinner.getSelectedItem()==null){
return;
if(previewTorrents==null)
}
if(previewTorrents==null){
return;
}
// Get the already loaded torrents and filter and sort them
@ -226,7 +268,7 @@ public class ListWidgetConfigActivity extends Activity {
@@ -226,7 +268,7 @@ public class ListWidgetConfigActivity extends Activity {
@ -257,38 +299,4 @@ public class ListWidgetConfigActivity extends Activity {
@@ -257,38 +299,4 @@ public class ListWidgetConfigActivity extends Activity {
@ -52,49 +52,6 @@ public class ListWidgetProvider extends AppWidgetProvider {
@@ -52,49 +52,6 @@ public class ListWidgetProvider extends AppWidgetProvider {
@ -107,12 +64,14 @@ public class ListWidgetProvider extends AppWidgetProvider {
@@ -107,12 +64,14 @@ public class ListWidgetProvider extends AppWidgetProvider {
"Tried to set up widget "+appWidgetId+" but the bound server ID "+config.getServerId()+
" no longer exists.");
returnnull;
}
@ -137,7 +96,7 @@ public class ListWidgetProvider extends AppWidgetProvider {
@@ -137,7 +96,7 @@ public class ListWidgetProvider extends AppWidgetProvider {
@ -176,4 +135,46 @@ public class ListWidgetProvider extends AppWidgetProvider {
@@ -176,4 +135,46 @@ public class ListWidgetProvider extends AppWidgetProvider {
@ -59,12 +59,14 @@ public class AlphanumComparator implements Comparator<String> {
@@ -59,12 +59,14 @@ public class AlphanumComparator implements Comparator<String> {
returnchunk.toString();
}
publicintcompare(Stringo1,Stringo2){
if(!(o1instanceofString)||!(o2instanceofString)){
publicintcompare(Strings1,Strings2){
if(s1==null&&s2!=null){
return-1;
}elseif(s1!=null&&s2==null){
return1;
}elseif(s1==null){
return0;
}
Strings1=(String)o1;
Strings2=(String)o2;
intthisMarker=0;
intthatMarker=0;
@ -79,7 +81,7 @@ public class AlphanumComparator implements Comparator<String> {
@@ -79,7 +81,7 @@ public class AlphanumComparator implements Comparator<String> {
thatMarker+=thatChunk.length();
// If both chunks contain numeric characters, sort them numerically
@ -87,136 +84,175 @@ public class BitCometAdapter implements IDaemonAdapter {
@@ -87,136 +84,175 @@ public class BitCometAdapter implements IDaemonAdapter {
@ -224,14 +260,14 @@ public class BitCometAdapter implements IDaemonAdapter {
@@ -224,14 +260,14 @@ public class BitCometAdapter implements IDaemonAdapter {
@ -250,116 +286,119 @@ public class BitCometAdapter implements IDaemonAdapter {
@@ -250,116 +286,119 @@ public class BitCometAdapter implements IDaemonAdapter {
@ -370,95 +409,105 @@ public class BitCometAdapter implements IDaemonAdapter {
@@ -370,95 +409,105 @@ public class BitCometAdapter implements IDaemonAdapter {
@ -482,25 +531,24 @@ public class BitCometAdapter implements IDaemonAdapter {
@@ -482,25 +531,24 @@ public class BitCometAdapter implements IDaemonAdapter {
@ -511,8 +559,7 @@ public class BitCometAdapter implements IDaemonAdapter {
@@ -511,8 +559,7 @@ public class BitCometAdapter implements IDaemonAdapter {
// Temp variables to load into torrent objects
intid=0;
Stringname="";
@SuppressWarnings("unused")
Stringhash="";
@SuppressWarnings("unused")Stringhash="";
TorrentStatusstatus=TorrentStatus.Unknown;
longsizeDone=0;
longsizeUp=0;
@ -526,45 +573,47 @@ public class BitCometAdapter implements IDaemonAdapter {
@@ -526,45 +573,47 @@ public class BitCometAdapter implements IDaemonAdapter {
// End of a 'transfer' item, add gathered torrent data
sizeDone=(long)(totalSize*progress);
// @formatter:off
torrents.add(newTorrent(
id,
id,
null,// hash, // we suppose to use simple integer IDs
name,
status,
null,
rateDown,
rateUp,
seeders,
seedersTotal,
leechers,
leechersTotal,
name,
status,
null,
rateDown,
rateUp,
seeders,
seedersTotal,
leechers,
leechersTotal,
(int)((status==TorrentStatus.Downloading&&rateDown!=0)?(totalSize-sizeDone)/rateDown:-1),// eta (in seconds) = (total_size_in_btes - bytes_already_downloaded) / bytes_per_second
sizeDone,
sizeUp,
totalSize,
progress,
sizeDone,
sizeUp,
totalSize,
progress,
0f,
label,
dateAdded,
null,
null,// Not supported in the web interface
settings.getType()));
// @formatter:on
id++;// Stop/start/etc. requests are made by ID, which is the order number in the returned XML list :-S
// Start of a new 'transfer' item; reset gathered torrent data
name="";
//hash = "";
@ -581,9 +630,9 @@ public class BitCometAdapter implements IDaemonAdapter {
@@ -581,9 +630,9 @@ public class BitCometAdapter implements IDaemonAdapter {
progress=0;
label="";
dateAdded=newDate();
}elseif(next==XmlPullParser.START_TAG){
}elseif(next==XmlPullParser.START_TAG){
// Probably encountered a torrent property, i.e. '<type>BT</type>'
next=xpp.next();
if(next==XmlPullParser.TEXT){
@ -620,13 +669,13 @@ public class BitCometAdapter implements IDaemonAdapter {
@@ -620,13 +669,13 @@ public class BitCometAdapter implements IDaemonAdapter {
@ -635,33 +684,35 @@ public class BitCometAdapter implements IDaemonAdapter {
@@ -635,33 +684,35 @@ public class BitCometAdapter implements IDaemonAdapter {
@ -670,40 +721,19 @@ public class BitCometAdapter implements IDaemonAdapter {
@@ -670,40 +721,19 @@ public class BitCometAdapter implements IDaemonAdapter {
@ -712,10 +742,10 @@ public class BitCometAdapter implements IDaemonAdapter {
@@ -712,10 +742,10 @@ public class BitCometAdapter implements IDaemonAdapter {
}
returnPriority.Off;
}
/**
*ParseBitComettorrentstatus
**/
*ParseBitComettorrentstatus
*/
privateTorrentStatusconvertStatus(Stringstate){
// Status is given as a descriptive string and an indication if the torrent was stopped/paused
if(state.equals("stopped")){
@ -725,16 +755,7 @@ public class BitCometAdapter implements IDaemonAdapter {
@@ -725,16 +755,7 @@ public class BitCometAdapter implements IDaemonAdapter {
@ -744,5 +765,5 @@ public class BitCometAdapter implements IDaemonAdapter {
@@ -744,5 +765,5 @@ public class BitCometAdapter implements IDaemonAdapter {
@ -174,10 +175,10 @@ public class BitfluAdapter implements IDaemonAdapter {
@@ -174,10 +175,10 @@ public class BitfluAdapter implements IDaemonAdapter {
@ -281,10 +281,11 @@ public class BitfluAdapter implements IDaemonAdapter {
@@ -281,10 +281,11 @@ public class BitfluAdapter implements IDaemonAdapter {
@ -78,86 +78,88 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@@ -78,86 +78,88 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@ -166,13 +168,13 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@@ -166,13 +168,13 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@ -201,31 +203,31 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@@ -201,31 +203,31 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
returnresult;
}
DLog.d(LOG_NAME,"Error: No entity in HTTP response");
log.d(LOG_NAME,"Error: No entity in HTTP response");
thrownewDaemonException(ExceptionType.UnexpectedResponse,"No HTTP entity object in response.");
@ -235,7 +237,7 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@@ -235,7 +237,7 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@ -243,10 +245,9 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@@ -243,10 +245,9 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@ -115,54 +114,54 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@@ -115,54 +114,54 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@ -172,12 +171,12 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@@ -172,12 +171,12 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@ -206,10 +205,9 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@@ -206,10 +205,9 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@ -218,31 +216,31 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@@ -218,31 +216,31 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@ -264,8 +262,9 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@@ -264,8 +262,9 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
response=httpclient.execute(httppost);
}
if(!hasRespond)
if(!hasRespond){
returnnull;
}
HttpEntityentity=response.getEntity();
if(entity!=null){
@ -276,24 +275,24 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@@ -276,24 +275,24 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@ -301,39 +300,40 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@@ -301,39 +300,40 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@ -345,15 +345,18 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@@ -345,15 +345,18 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@ -366,17 +369,18 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@@ -366,17 +369,18 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@ -395,15 +399,16 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@@ -395,15 +399,16 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@ -414,12 +419,12 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@@ -414,12 +419,12 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@ -89,7 +86,7 @@ public class DelugeAdapter implements IDaemonAdapter {
@@ -89,7 +86,7 @@ public class DelugeAdapter implements IDaemonAdapter {
privatestaticfinalStringPATH_TO_RPC="/json";
privatestaticfinalStringPATH_TO_UPLOAD="/upload";
privatestaticfinalStringRPC_ID="id";
privatestaticfinalStringRPC_METHOD="method";
privatestaticfinalStringRPC_PARAMS="params";
@ -141,34 +138,30 @@ public class DelugeAdapter implements IDaemonAdapter {
@@ -141,34 +138,30 @@ public class DelugeAdapter implements IDaemonAdapter {
@ -199,17 +192,17 @@ public class DelugeAdapter implements IDaemonAdapter {
@@ -199,17 +192,17 @@ public class DelugeAdapter implements IDaemonAdapter {
// Array of the fields needed for files listing calls
@ -217,202 +210,209 @@ public class DelugeAdapter implements IDaemonAdapter {
@@ -217,202 +210,209 @@ public class DelugeAdapter implements IDaemonAdapter {
// We still need to retrieve the version number from the server
// Do this by getting the web interface main html page and trying to parse the version number
// Format is something like '<title>Deluge: Web UI 1.3.6</title>'
@ -464,9 +465,10 @@ public class DelugeAdapter implements IDaemonAdapter {
@@ -464,9 +465,10 @@ public class DelugeAdapter implements IDaemonAdapter {
Stringnumbers="";
for(charc:parts[2].toCharArray()){
if(Character.isDigit(c))
// Still a number; add it to the numbers string
// Still a number; add it to the numbers string
{
numbers+=Character.toString(c);
else{
}else{
// No longer reading numbers; stop reading
break;
}
@ -478,10 +480,10 @@ public class DelugeAdapter implements IDaemonAdapter {
@@ -478,10 +480,10 @@ public class DelugeAdapter implements IDaemonAdapter {
}
}
}catch(NumberFormatExceptione){
DLog.d(LOG_NAME,"Error parsing the Deluge version code as number: "+e.toString());
log.d(LOG_NAME,"Error parsing the Deluge version code as number: "+e.toString());
// Unable to establish version number; assume an old version by setting it to version 1
@ -496,21 +498,21 @@ public class DelugeAdapter implements IDaemonAdapter {
@@ -496,21 +498,21 @@ public class DelugeAdapter implements IDaemonAdapter {
@ -539,11 +541,13 @@ public class DelugeAdapter implements IDaemonAdapter {
@@ -539,11 +541,13 @@ public class DelugeAdapter implements IDaemonAdapter {
}
}
}
// Still no session cookie?
if(sessionCookie==null){
// Set error message and cancel the action that was requested
thrownewDaemonException(ExceptionType.AuthenticationFailure,"Password error? Server time difference? No (valid) cookie in response and JSON was: "+HttpHelper.convertStreamToString(instream));
@ -590,34 +596,35 @@ public class DelugeAdapter implements IDaemonAdapter {
@@ -590,34 +596,35 @@ public class DelugeAdapter implements IDaemonAdapter {
thrownewDaemonException(ExceptionType.UnexpectedResponse,"No HTTP entity in response object.");
@ -625,43 +632,47 @@ public class DelugeAdapter implements IDaemonAdapter {
@@ -625,43 +632,47 @@ public class DelugeAdapter implements IDaemonAdapter {
thrownewDaemonException(ExceptionType.NotConnected,"Web interface probably not connected to a daemon yet, because 'torrents' is null: "+response.toString());
@ -673,23 +684,26 @@ public class DelugeAdapter implements IDaemonAdapter {
@@ -673,23 +684,26 @@ public class DelugeAdapter implements IDaemonAdapter {
@ -724,25 +740,25 @@ public class DelugeAdapter implements IDaemonAdapter {
@@ -724,25 +740,25 @@ public class DelugeAdapter implements IDaemonAdapter {
if(version>=10303){
// Priority codes changes from Deluge 1.3.3 onwards
switch(priority){
case0:
returnPriority.Off;
case1:
returnPriority.Low;
case7:
returnPriority.High;
default:
returnPriority.Normal;
case0:
returnPriority.Off;
case1:
returnPriority.Low;
case7:
returnPriority.High;
default:
returnPriority.Normal;
}
}else{
switch(priority){
case0:
returnPriority.Off;
case2:
returnPriority.Normal;
case5:
returnPriority.High;
default:
returnPriority.Low;
case0:
returnPriority.Off;
case2:
returnPriority.Normal;
case5:
returnPriority.High;
default:
returnPriority.Low;
}
}
}
@ -751,25 +767,25 @@ public class DelugeAdapter implements IDaemonAdapter {
@@ -751,25 +767,25 @@ public class DelugeAdapter implements IDaemonAdapter {
if(version>=10303){
// Priority codes changes from Deluge 1.3.3 onwards
switch(priority){
caseOff:
return0;
caseLow:
return1;
caseHigh:
return7;
default:
return5;
caseOff:
return0;
caseLow:
return1;
caseHigh:
return7;
default:
return5;
}
}else{
switch(priority){
caseOff:
return0;
caseNormal:
return2;
caseHigh:
return5;
default:
return1;
caseOff:
return0;
caseNormal:
return2;
caseHigh:
return5;
default:
return1;
}
}
}
@ -817,5 +833,5 @@ public class DelugeAdapter implements IDaemonAdapter {
@@ -817,5 +833,5 @@ public class DelugeAdapter implements IDaemonAdapter {
@ -98,167 +96,189 @@ public class KtorrentAdapter implements IDaemonAdapter {
@@ -98,167 +96,189 @@ public class KtorrentAdapter implements IDaemonAdapter {
@ -267,26 +287,28 @@ public class KtorrentAdapter implements IDaemonAdapter {
@@ -267,26 +287,28 @@ public class KtorrentAdapter implements IDaemonAdapter {
@ -294,10 +316,10 @@ public class KtorrentAdapter implements IDaemonAdapter {
@@ -294,10 +316,10 @@ public class KtorrentAdapter implements IDaemonAdapter {
@ -305,54 +327,38 @@ public class KtorrentAdapter implements IDaemonAdapter {
@@ -305,54 +327,38 @@ public class KtorrentAdapter implements IDaemonAdapter {
params.add(newBasicNameValuePair(RPC_URL_LOGIN_PASS,""));// Password is send (as SHA1 hex) in the challenge field
params.add(newBasicNameValuePair(RPC_URL_LOGIN_CHAL,sha1Pass(challengeString+settings.getPassword())));// Make a SHA1 encrypted hex-formated string of the challenge code and password
@ -374,34 +380,39 @@ public class KtorrentAdapter implements IDaemonAdapter {
@@ -374,34 +380,39 @@ public class KtorrentAdapter implements IDaemonAdapter {
@ -423,15 +434,15 @@ public class KtorrentAdapter implements IDaemonAdapter {
@@ -423,15 +434,15 @@ public class KtorrentAdapter implements IDaemonAdapter {
@ -448,7 +459,6 @@ public class KtorrentAdapter implements IDaemonAdapter {
@@ -448,7 +459,6 @@ public class KtorrentAdapter implements IDaemonAdapter {
@ -458,7 +468,7 @@ public class KtorrentAdapter implements IDaemonAdapter {
@@ -458,7 +468,7 @@ public class KtorrentAdapter implements IDaemonAdapter {
@ -476,5 +486,5 @@ public class KtorrentAdapter implements IDaemonAdapter {
@@ -476,5 +486,5 @@ public class KtorrentAdapter implements IDaemonAdapter {
@ -84,13 +85,13 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -84,13 +85,13 @@ public class QbittorrentAdapter implements IDaemonAdapter {
// We still need to retrieve the version number from the server
// Do this by getting the web interface about page and trying to parse the version number
// Format is something like 'qBittorrent v2.9.7 (Web UI)'
Stringabout=makeRequest("/about.html");
Stringabout=makeRequest(log,"/about.html");
StringaboutStartText="qBittorrent v";
StringaboutEndText=" (Web UI)";
intaboutStart=about.indexOf(aboutStartText);
@ -129,83 +130,83 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -129,83 +130,83 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@ -222,7 +223,7 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -222,7 +223,7 @@ public class QbittorrentAdapter implements IDaemonAdapter {
}
// We have to make a separate request per file, it seems
@ -233,14 +234,14 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -233,14 +234,14 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@ -257,18 +258,16 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -257,18 +258,16 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@ -276,7 +275,7 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -276,7 +275,7 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@ -285,7 +284,7 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -285,7 +284,7 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@ -293,7 +292,7 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -293,7 +292,7 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@ -320,11 +319,11 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -320,11 +319,11 @@ public class QbittorrentAdapter implements IDaemonAdapter {
returnresult;
}
DLog.d(LOG_NAME,"Error: No entity in HTTP response");
log.d(LOG_NAME,"Error: No entity in HTTP response");
thrownewDaemonException(ExceptionType.UnexpectedResponse,"No HTTP entity object in response.");
@ -332,7 +331,6 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -332,7 +331,6 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@ -385,10 +383,31 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -385,10 +383,31 @@ public class QbittorrentAdapter implements IDaemonAdapter {
eta=(long)(size-(size*progress))/dlspeed;
// Date added is only available in /json/propertiesGeneral on a per-torrent basis, unfortunately
@ -88,14 +88,14 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -88,14 +88,14 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -122,23 +122,24 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -122,23 +122,24 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -149,137 +150,139 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -149,137 +150,139 @@ public class RtorrentAdapter implements IDaemonAdapter {
task.getMethod()+" is not supported by "+getType()));
}
}catch(DaemonExceptione){
returnnewDaemonTaskFailureResult(task,e);
@ -290,8 +293,8 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -290,8 +293,8 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -299,22 +302,25 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -299,22 +302,25 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -336,12 +342,9 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -336,12 +342,9 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -365,7 +368,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -365,7 +368,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
error=error.equals("")?null:error;
// Determine the time added
Dateadded=null;
Dateadded;
Longaddtime=null;
try{
addtime=Long.valueOf(((String)info[19]).trim());
@ -373,14 +376,16 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -373,14 +376,16 @@ public class RtorrentAdapter implements IDaemonAdapter {
// Not a number (timestamp); ignore and fall back to using creationtime
}
if(addtime!=null)
// Successfully received the addtime from rTorrent (which is a String like '1337089336\n')
// Successfully received the addtime from rTorrent (which is a String like '1337089336\n')
{
added=newDate(addtime*1000L);
else{
}else{
// rTorrent didn't have the addtime (missing plugin?): base it on creationtime instead
if(info[11]instanceofLong)
if(info[11]instanceofLong){
added=newDate((Long)info[11]*1000L);
else
}else{
added=newDate((Integer)info[11]*1000L);
}
}
// Determine the seeding time
@ -392,8 +397,10 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -392,8 +397,10 @@ public class RtorrentAdapter implements IDaemonAdapter {
// Not a number (timestamp); ignore and fall back to using creationtime
}
if(seedingtime!=null)
// Successfully received the seedingtime from rTorrent (which is a String like '1337089336\n')
// Successfully received the seedingtime from rTorrent (which is a String like '1337089336\n')
{
finished=newDate(seedingtime*1000L);
}
// Determine the label
Stringlabel=null;
@ -455,11 +462,11 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -455,11 +462,11 @@ public class RtorrentAdapter implements IDaemonAdapter {
(rateDownload>0?(Integer)info[12]/rateDownload:-1),// eta (bytes left / rate download, if rate > 0)
(Integer)info[8],// downloadedEver
(Integer)info[9],// uploadedEver
(Integer)info[10],// totalSize
@ -476,8 +483,9 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -476,8 +483,9 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -550,24 +558,24 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -550,24 +558,24 @@ public class RtorrentAdapter implements IDaemonAdapter {
privatePriorityconvertRtorrentPriority(intcode){
// Note that Rtorrent has no low priority value
switch(code){
case0:
returnPriority.Off;
case2:
returnPriority.High;
default:
returnPriority.Normal;
case0:
returnPriority.Off;
case2:
returnPriority.High;
default:
returnPriority.Normal;
}
}
privateintconvertPriority(Prioritypriority){
// Note that Rtorrent has no low priority value
switch(priority){
caseOff:
return0;
caseHigh:
return2;
default:
return1;
caseOff:
return0;
caseHigh:
return2;
default:
return1;
}
}
@ -587,7 +595,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -587,7 +595,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -601,12 +609,12 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -601,12 +609,12 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -76,47 +75,48 @@ public class SynologyAdapter implements IDaemonAdapter {
@@ -76,47 +75,48 @@ public class SynologyAdapter implements IDaemonAdapter {
@ -124,9 +124,9 @@ public class SynologyAdapter implements IDaemonAdapter {
@@ -124,9 +124,9 @@ public class SynologyAdapter implements IDaemonAdapter {
@ -149,84 +149,87 @@ public class SynologyAdapter implements IDaemonAdapter {
@@ -149,84 +149,87 @@ public class SynologyAdapter implements IDaemonAdapter {
@ -237,16 +240,21 @@ public class SynologyAdapter implements IDaemonAdapter {
@@ -237,16 +240,21 @@ public class SynologyAdapter implements IDaemonAdapter {
@ -255,6 +263,7 @@ public class SynologyAdapter implements IDaemonAdapter {
@@ -255,6 +263,7 @@ public class SynologyAdapter implements IDaemonAdapter {
task.getLong("size"),
task.getLong("size_downloaded"),
priority(task.getString("priority"))
// @formatter:on
));
}
returnresult;
@ -263,11 +272,13 @@ public class SynologyAdapter implements IDaemonAdapter {
@@ -263,11 +272,13 @@ public class SynologyAdapter implements IDaemonAdapter {
@ -293,7 +304,7 @@ public class SynologyAdapter implements IDaemonAdapter {
@@ -293,7 +304,7 @@ public class SynologyAdapter implements IDaemonAdapter {
@ -306,6 +317,7 @@ public class SynologyAdapter implements IDaemonAdapter {
@@ -306,6 +317,7 @@ public class SynologyAdapter implements IDaemonAdapter {
}
}
}
// @formatter:off
returnnewTorrent(
id,
jsonTorrent.getString("id"),
@ -322,79 +334,71 @@ public class SynologyAdapter implements IDaemonAdapter {
@@ -322,79 +334,71 @@ public class SynologyAdapter implements IDaemonAdapter {
@ -405,13 +409,13 @@ public class SynologyAdapter implements IDaemonAdapter {
@@ -405,13 +409,13 @@ public class SynologyAdapter implements IDaemonAdapter {
@ -419,11 +423,11 @@ public class SynologyAdapter implements IDaemonAdapter {
@@ -419,11 +423,11 @@ public class SynologyAdapter implements IDaemonAdapter {
DLog.e(LOG_NAME,"Error: No entity in HTTP response");
log.e(LOG_NAME,"Error: No entity in HTTP response");
thrownewDaemonException(ExceptionType.UnexpectedResponse,"No HTTP entity object in response.");
}
// Read JSON response
@ -436,16 +440,17 @@ public class SynologyAdapter implements IDaemonAdapter {
@@ -436,16 +440,17 @@ public class SynologyAdapter implements IDaemonAdapter {
@ -453,4 +458,30 @@ public class SynologyAdapter implements IDaemonAdapter {
@@ -453,4 +458,30 @@ public class SynologyAdapter implements IDaemonAdapter {
@ -170,16 +170,16 @@ public class Tfb4rtAdapter implements IDaemonAdapter {
@@ -170,16 +170,16 @@ public class Tfb4rtAdapter implements IDaemonAdapter {
@ -204,16 +204,16 @@ public class Tfb4rtAdapter implements IDaemonAdapter {
@@ -204,16 +204,16 @@ public class Tfb4rtAdapter implements IDaemonAdapter {
@ -241,10 +241,10 @@ public class Tfb4rtAdapter implements IDaemonAdapter {
@@ -241,10 +241,10 @@ public class Tfb4rtAdapter implements IDaemonAdapter {
@ -49,7 +49,7 @@ public class TorrentFilesComparator implements Comparator<TorrentFile> {
@@ -49,7 +49,7 @@ public class TorrentFilesComparator implements Comparator<TorrentFile> {
@ -58,7 +58,7 @@ public class TorrentFilesComparator implements Comparator<TorrentFile> {
@@ -58,7 +58,7 @@ public class TorrentFilesComparator implements Comparator<TorrentFile> {
@ -67,15 +67,15 @@ public class TorrentsComparator implements Comparator<Torrent> {
@@ -67,15 +67,15 @@ public class TorrentsComparator implements Comparator<Torrent> {
@ -92,15 +92,15 @@ public class TorrentsComparator implements Comparator<Torrent> {
@@ -92,15 +92,15 @@ public class TorrentsComparator implements Comparator<Torrent> {
@ -104,234 +103,255 @@ public class TransmissionAdapter implements IDaemonAdapter {
@@ -104,234 +103,255 @@ public class TransmissionAdapter implements IDaemonAdapter {
@ -343,12 +363,14 @@ public class TransmissionAdapter implements IDaemonAdapter {
@@ -343,12 +363,14 @@ public class TransmissionAdapter implements IDaemonAdapter {
@ -363,7 +385,7 @@ public class TransmissionAdapter implements IDaemonAdapter {
@@ -363,7 +385,7 @@ public class TransmissionAdapter implements IDaemonAdapter {
@ -373,90 +395,89 @@ public class TransmissionAdapter implements IDaemonAdapter {
@@ -373,90 +395,89 @@ public class TransmissionAdapter implements IDaemonAdapter {
@ -467,22 +488,23 @@ public class TransmissionAdapter implements IDaemonAdapter {
@@ -467,22 +488,23 @@ public class TransmissionAdapter implements IDaemonAdapter {
// Allow the user's folder setting to override /transmission (as per Transmission's rpc-url option)
// Error is a number, see https://trac.transmissionbt.com/browser/trunk/libtransmission/transmission.h#L1747
// We only consider it a real error if it is local (blocking), which is error code 3
@ -490,16 +512,18 @@ public class TransmissionAdapter implements IDaemonAdapter {
@@ -490,16 +512,18 @@ public class TransmissionAdapter implements IDaemonAdapter {
@ -512,18 +536,19 @@ public class TransmissionAdapter implements IDaemonAdapter {
@@ -512,18 +536,19 @@ public class TransmissionAdapter implements IDaemonAdapter {
// No label/category/group support in the RPC API for now
null,
newDate(tor.getLong(RPC_DATEADDED)*1000L),
newDate(tor.getLong(RPC_DATEDONE)*1000L),
errorString,
settings.getType()));
errorString,settings.getType()));
// @formatter:on
}
// Return the list
returntorrents;
}
privateTorrentStatusgetStatus(intstatus){
@ -531,20 +556,20 @@ public class TransmissionAdapter implements IDaemonAdapter {
@@ -531,20 +556,20 @@ public class TransmissionAdapter implements IDaemonAdapter {
returnTorrentStatus.Unknown;
}elseif(rpcVersion>=14){
switch(status){
case0:
returnTorrentStatus.Paused;
case1:
returnTorrentStatus.Waiting;
case2:
returnTorrentStatus.Checking;
case3:
returnTorrentStatus.Queued;
case4:
returnTorrentStatus.Downloading;
case5:
returnTorrentStatus.Queued;
case6:
returnTorrentStatus.Seeding;
case0:
returnTorrentStatus.Paused;
case1:
returnTorrentStatus.Waiting;
case2:
returnTorrentStatus.Checking;
case3:
returnTorrentStatus.Queued;
case4:
returnTorrentStatus.Downloading;
case5:
returnTorrentStatus.Queued;
case6:
returnTorrentStatus.Seeding;
}
returnTorrentStatus.Unknown;
}else{
@ -553,7 +578,7 @@ public class TransmissionAdapter implements IDaemonAdapter {
@@ -553,7 +578,7 @@ public class TransmissionAdapter implements IDaemonAdapter {
@ -563,20 +588,22 @@ public class TransmissionAdapter implements IDaemonAdapter {
@@ -563,20 +588,22 @@ public class TransmissionAdapter implements IDaemonAdapter {
@ -584,18 +611,18 @@ public class TransmissionAdapter implements IDaemonAdapter {
@@ -584,18 +611,18 @@ public class TransmissionAdapter implements IDaemonAdapter {
@ -616,9 +643,9 @@ public class TransmissionAdapter implements IDaemonAdapter {
@@ -616,9 +643,9 @@ public class TransmissionAdapter implements IDaemonAdapter {
}
returnnewTorrentDetails(trackers,errors);
}
returnnull;
}
@Override
@ -630,5 +657,5 @@ public class TransmissionAdapter implements IDaemonAdapter {
@@ -630,5 +657,5 @@ public class TransmissionAdapter implements IDaemonAdapter {
@ -97,166 +121,180 @@ public class UtorrentAdapter implements IDaemonAdapter {
@@ -97,166 +121,180 @@ public class UtorrentAdapter implements IDaemonAdapter {
@ -265,14 +303,12 @@ public class UtorrentAdapter implements IDaemonAdapter {
@@ -265,14 +303,12 @@ public class UtorrentAdapter implements IDaemonAdapter {
@ -282,28 +318,25 @@ public class UtorrentAdapter implements IDaemonAdapter {
@@ -282,28 +318,25 @@ public class UtorrentAdapter implements IDaemonAdapter {
@ -317,64 +350,68 @@ public class UtorrentAdapter implements IDaemonAdapter {
@@ -317,64 +350,68 @@ public class UtorrentAdapter implements IDaemonAdapter {
// Auth token was invalidated; retry at max 3 times
authtoken=null;// So that ensureToken() will request a new token on the next try
thrownewDaemonException(ExceptionType.AuthenticationFailure,"Response was '"+result.replace("\n","")+"' instead of a proper JSON object (and we used auth token '"+authtoken+"')");
@ -384,24 +421,24 @@ public class UtorrentAdapter implements IDaemonAdapter {
@@ -384,24 +421,24 @@ public class UtorrentAdapter implements IDaemonAdapter {
@ -430,57 +467,36 @@ public class UtorrentAdapter implements IDaemonAdapter {
@@ -430,57 +467,36 @@ public class UtorrentAdapter implements IDaemonAdapter {
returnTorrentStatus.Waiting;
}
}
privatePriorityconvertUtorrentPriority(intcode){
switch(code){
case0:
returnPriority.Off;
case1:
returnPriority.Low;
case3:
returnPriority.High;
default:
returnPriority.Normal;
case0:
returnPriority.Off;
case1:
returnPriority.Low;
case3:
returnPriority.High;
default:
returnPriority.Normal;
}
}
privateintconvertPriority(PrioritynewPriority){
if(newPriority==null){
return2;
return2;
}
switch(newPriority){
caseOff:
return0;
caseLow:
return1;
caseHigh:
return3;
default:
return2;
caseOff:
return0;
caseLow:
return1;
caseHigh:
return3;
default:
return2;
}
}
// These are the positions inside the JSON response array of a torrent
// See http://forum.utorrent.com/viewtopic.php?id=25661
@ -490,7 +506,7 @@ public class UtorrentAdapter implements IDaemonAdapter {
@@ -490,7 +506,7 @@ public class UtorrentAdapter implements IDaemonAdapter {
floatavailable=((float)tor.getInt(RPC_AVAILABILITY_IDX))/65536f;// Integer in 1/65536ths
floatavailable=((float)tor.getInt(RPC_AVAILABILITY_IDX))/65536f;// Integer in 1/65536ths
// The full torrent path is not available in uTorrent web UI API
// Guess the torrent's directory based on the user-specific default download dir and the torrent name
Stringdir=null;
@ -505,35 +521,22 @@ public class UtorrentAdapter implements IDaemonAdapter {
@@ -505,35 +521,22 @@ public class UtorrentAdapter implements IDaemonAdapter {
@ -541,7 +544,7 @@ public class UtorrentAdapter implements IDaemonAdapter {
@@ -541,7 +544,7 @@ public class UtorrentAdapter implements IDaemonAdapter {
// Parse response
// NOTE: Assumes only details for one torrent are requested at a time
@ -554,53 +557,49 @@ public class UtorrentAdapter implements IDaemonAdapter {
@@ -554,53 +557,49 @@ public class UtorrentAdapter implements IDaemonAdapter {
// See http://forum.utorrent.com/viewtopic.php?pid=553340#p553340
returnnewTorrentDetails(trackers,null);
}
returnnull;
}
// These are the positions inside the JSON response array of a torrent
// See http://forum.utorrent.com/viewtopic.php?id=25661
(createPaths?file.getString(RPC_FILENAME_IDX).replace((pathSep.equals("/")?"\\":"/"),pathSep):null),// Relative path; 'wrong' path slashes will be replaced
(createPaths?torrent.getLocationDir()+file.getString(RPC_FILENAME_IDX).replace((pathSep.equals("/")?"\\":"/"),pathSep):null),// Full path; 'wrong' path slashes will be replaced
@ -612,5 +611,5 @@ public class UtorrentAdapter implements IDaemonAdapter {
@@ -612,5 +611,5 @@ public class UtorrentAdapter implements IDaemonAdapter {
thrownewDaemonException(DaemonException.ExceptionType.UnexpectedResponse,"Map of objects returned by Vuze, but these object do not have some <info> attached or no <_object_id> is available");
}
@ -396,10 +398,10 @@ public class VuzeAdapter implements IDaemonAdapter {
@@ -396,10 +398,10 @@ public class VuzeAdapter implements IDaemonAdapter {
returnmethod.toString()+(adapter==null?"":" on "+adapter.getType())+(targetTorrent!=null||extras!=null?" with ":"")+(targetTorrent==null?"":targetTorrent.toString()+(targetTorrent!=null&&extras!=null?" and ":""))+(extras==null?"":extras.toString());
returnmethod.toString()+(adapter==null?"":" on "+adapter.getType())+
(targetTorrent!=null||extras!=null?" with ":"")+
(targetTorrent==null?"":targetTorrent.toString()+(extras!=null?" and ":""))+
@ -50,9 +49,9 @@ public class SelfSignedTrustManager implements X509TrustManager {
@@ -50,9 +49,9 @@ public class SelfSignedTrustManager implements X509TrustManager {
@ -75,15 +74,15 @@ public class SelfSignedTrustManager implements X509TrustManager {
@@ -75,15 +74,15 @@ public class SelfSignedTrustManager implements X509TrustManager {
@ -130,7 +131,7 @@ public class TlsSniSocketFactory implements LayeredSocketFactory {
@@ -130,7 +131,7 @@ public class TlsSniSocketFactory implements LayeredSocketFactory {