Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

Commit

Permalink
Update jlibtorrent to beta7 and update gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
se-bastiaan committed Oct 22, 2016
1 parent 17c410f commit f19e299
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.android.tools.build:gradle:2.2.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'

// NOTE: Do not place your application dependencies here; they belong
Expand Down
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.android.tools.build:gradle:2.2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ public Torrent(TorrentHandle torrentHandle, TorrentListener listener, Long prepa

this.prepareSize = prepareSize;

if (selectedFileIndex == -1)
if (selectedFileIndex == -1) {
setLargestFile();
}

if (this.listener != null)
if (this.listener != null) {
this.listener.onStreamPrepared(this);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.frostwire.jlibtorrent.Priority;
import com.frostwire.jlibtorrent.SessionManager;
import com.frostwire.jlibtorrent.SessionParams;
import com.frostwire.jlibtorrent.SettingsPack;
import com.frostwire.jlibtorrent.TorrentHandle;
import com.frostwire.jlibtorrent.TorrentInfo;
Expand All @@ -45,6 +46,7 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.CountDownLatch;

public final class TorrentStream {
Expand Down Expand Up @@ -414,7 +416,7 @@ public void setOptions(TorrentOptions options) {
.activeDhtLimit(torrentOptions.maxDht);

if (torrentOptions.listeningPort != -1) {
String ifStr = String.format("%s:%d", "0.0.0.0", torrentOptions.listeningPort);
String ifStr = String.format(Locale.ENGLISH, "%s:%d", "0.0.0.0", torrentOptions.listeningPort);
settingsPack.setString(settings_pack.string_types.listen_interfaces.swigValue(), ifStr);
}

Expand All @@ -433,7 +435,8 @@ public void setOptions(TorrentOptions options) {
}

if (!torrentSession.isRunning()) {
torrentSession.start(settingsPack);
SessionParams sessionParams = new SessionParams(settingsPack);
torrentSession.start(sessionParams);
} else {
torrentSession.applySettings(settingsPack);
}
Expand Down

0 comments on commit f19e299

Please sign in to comment.