Fix torrent name

This commit is contained in:
seven332 committed 2015-04-21 13:58:30 +08:00
1 parent c8b347eed2
commit c69715d866
2 files changed
+7 -2

No files matched your search

@@ -46,6 +46,10 @@ public class Downloader implements Runnable, HttpHelper.OnDownloadListener {
@Override
public void run() {
HttpHelper.DownloadOption dOpt = new HttpHelper.DownloadOption();
dOpt.setUseProxy(false);
dOpt.setAllowFixingExtension(true);
dOpt.setAllowFixingName(true);
HttpHelper hh = new HttpHelper(mContext);
final boolean ok = HttpHelper.DOWNLOAD_OK_STR.equals(
hh.download(mUrl, mDir, mFilename, null, null, this));
@@ -89,6 +89,7 @@ import com.hippo.ehviewer.util.AppConfig;
import com.hippo.ehviewer.util.Config;
import com.hippo.ehviewer.util.Constants;
import com.hippo.ehviewer.util.Ui;
import com.hippo.ehviewer.util.Utils;
import com.hippo.ehviewer.util.ViewUtils;
import com.hippo.ehviewer.widget.AutoWrapLayout;
import com.hippo.ehviewer.widget.FitWindowView;
@@ -1175,11 +1176,11 @@ public class GalleryDetailActivity extends AbsTranslucentActivity
}
final String url = galleryDetail.torrents[position].first;
String name = galleryDetail.torrents[position].second;
Downloader d = new Downloader(
GalleryDetailActivity.this,
url,
dir,
"a.torrent"); // Torrent will be updated
dir, Utils.standardizeFilename(name + ".torrent")); // Torrent will be updated
d.startDownload();
}
});