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

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

@ -83,7 +83,9 @@ public class RssitemsFragment extends SherlockFragment {
@ItemClick(resName = "rssitems_list") @ItemClick(resName = "rssitems_list")
protected void onItemClicked(Item item) { 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() { private MultiChoiceModeListenerCompat onItemsSelected = new MultiChoiceModeListenerCompat() {

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

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

Loading…
Cancel
Save