Browse Source

Fixed RSS feed persistence (and thereby the RSS details screen on phones) and properly supply torrent title when adding torrent from an RSS feed.

pull/11/head
Eric Kok 11 years ago
parent
commit
5467a2d269
  1. 6
      core/src/org/transdroid/core/gui/TorrentsActivity.java
  2. 4
      core/src/org/transdroid/core/gui/rss/RssitemsFragment.java
  3. 2
      core/src/org/transdroid/core/rssparser/Channel.java

6
core/src/org/transdroid/core/gui/TorrentsActivity.java

@ -639,7 +639,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi @@ -639,7 +639,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
@Background
public void addTorrentByUrl(String url, String title) {
DaemonTaskResult result = AddByUrlTask.create(currentConnection, url, title).execute();
if (result instanceof DaemonTaskResult) {
if (result instanceof DaemonTaskSuccessResult) {
onTaskSucceeded((DaemonTaskSuccessResult) result, getString(R.string.result_added, title));
refreshTorrents();
} else {
@ -650,7 +650,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi @@ -650,7 +650,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
@Background
protected void addTorrentByMagnetUrl(String url) {
DaemonTaskResult result = AddByMagnetUrlTask.create(currentConnection, url).execute();
if (result instanceof DaemonTaskResult) {
if (result instanceof DaemonTaskSuccessResult) {
onTaskSucceeded((DaemonTaskSuccessResult) result, getString(R.string.result_added, "Torrent"));
refreshTorrents();
} else {
@ -661,7 +661,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi @@ -661,7 +661,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
@Background
protected void addTorrentByFile(String localFile, String title) {
DaemonTaskResult result = AddByFileTask.create(currentConnection, localFile).execute();
if (result instanceof DaemonTaskResult) {
if (result instanceof DaemonTaskSuccessResult) {
onTaskSucceeded((DaemonTaskSuccessResult) result, getString(R.string.result_added, title));
refreshTorrents();
} else {

4
core/src/org/transdroid/core/gui/rss/RssitemsFragment.java

@ -83,7 +83,9 @@ public class RssitemsFragment extends SherlockFragment { @@ -83,7 +83,9 @@ public class RssitemsFragment extends SherlockFragment {
@ItemClick(resName = "rssitems_list")
protected void onItemClicked(Item item) {
startActivity(new Intent(Intent.ACTION_VIEW, item.getTheLinkUri()));
Intent i = new Intent(Intent.ACTION_VIEW, item.getTheLinkUri());
i.putExtra("TORRENT_TITLE", item.getTitle());
startActivity(i);
}
private MultiChoiceModeListenerCompat onItemsSelected = new MultiChoiceModeListenerCompat() {

2
core/src/org/transdroid/core/rssparser/Channel.java

@ -121,8 +121,8 @@ public class Channel implements Parcelable { @@ -121,8 +121,8 @@ public class Channel implements Parcelable {
out.writeString(description);
out.writeLong(pubDate == null ? -1 : pubDate.getTime());
out.writeLong(lastBuildDate);
out.writeStringList(categories);
out.writeTypedList(items);
out.writeStringList(categories);
out.writeString(image);
}

Loading…
Cancel
Save