summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/layout/feeditemview.xml18
-rw-r--r--src/de/podfetcher/feed/FeedManager.java20
-rw-r--r--src/de/podfetcher/storage/PodDBAdapter.java2
3 files changed, 33 insertions, 7 deletions
diff --git a/res/layout/feeditemview.xml b/res/layout/feeditemview.xml
index 794355be2..2485dd585 100644
--- a/res/layout/feeditemview.xml
+++ b/res/layout/feeditemview.xml
@@ -12,14 +12,26 @@
<TextView
android:id="@+id/txtvItemname"
android:layout_width="fill_parent"
- android:layout_height="wrap_content" />
+ android:layout_height="wrap_content"
+ android:textSize="16dp" />
<TextView
android:id="@+id/txtvPublished"
android:layout_width="fill_parent"
- android:layout_height="wrap_content" />
+ android:layout_height="wrap_content"
+ android:textStyle="italic"
+ android:textColor="@color/gray" />
</LinearLayout>
-
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="8dp"
+ android:background="@color/gray"
+ android:textColor="@color/white"
+ android:textStyle="bold"
+ android:gravity="center_horizontal"
+ android:text="@string/description_label"/>
+
<WebView
android:id="@+id/webvDescription"
android:layout_width="match_parent"
diff --git a/src/de/podfetcher/feed/FeedManager.java b/src/de/podfetcher/feed/FeedManager.java
index 745ebf461..36588dcfd 100644
--- a/src/de/podfetcher/feed/FeedManager.java
+++ b/src/de/podfetcher/feed/FeedManager.java
@@ -122,6 +122,9 @@ public class FeedManager {
if (!item.isRead()) {
unreadItems.remove(item);
}
+ if (queue.contains(item)) {
+ removeQueueItem(context, item);
+ }
if (item.getMedia() != null && item.getMedia().isDownloaded()) {
File mediaFile = new File(item.getMedia().getFile_url());
mediaFile.delete();
@@ -375,7 +378,7 @@ public class FeedManager {
}
private void extractFeedlistFromCursor(Context context, PodDBAdapter adapter) {
-
+ Log.d(TAG, "Extracting Feedlist");
Cursor feedlistCursor = adapter.getAllFeedsCursor();
if (feedlistCursor.moveToFirst()) {
do {
@@ -416,6 +419,7 @@ public class FeedManager {
private ArrayList<FeedItem> extractFeedItemsFromCursor(Context context,
Feed feed, Cursor itemlistCursor, PodDBAdapter adapter) {
+ Log.d(TAG, "Extracting Feeditems of feed " + feed.getTitle());
ArrayList<FeedItem> items = new ArrayList<FeedItem>();
if (itemlistCursor.moveToFirst()) {
do {
@@ -453,6 +457,7 @@ public class FeedManager {
private void extractDownloadLogFromCursor(Context context,
PodDBAdapter adapter) {
+ Log.d(TAG, "Extracting DownloadLog");
Cursor logCursor = adapter.getDownloadLogCursor();
if (logCursor.moveToFirst()) {
do {
@@ -490,6 +495,7 @@ public class FeedManager {
}
private void extractQueueFromCursor(Context context, PodDBAdapter adapter) {
+ Log.d(TAG, "Extracting Downloadqueue");
Cursor cursor = adapter.getQueueCursor();
if (cursor.moveToFirst()) {
do {
@@ -497,9 +503,15 @@ public class FeedManager {
.getColumnIndex(PodDBAdapter.KEY_ID));
Feed feed = getFeed(cursor.getLong(cursor
.getColumnIndex(PodDBAdapter.KEY_FEED)));
- FeedItem item = getFeedItem(
- cursor.getColumnIndex(PodDBAdapter.KEY_FEEDITEM), feed);
- queue.add(index, item);
+ if (feed != null) {
+ FeedItem item = getFeedItem(
+ cursor.getColumnIndex(PodDBAdapter.KEY_FEEDITEM), feed);
+ if (item != null) {
+ queue.add(index, item);
+ }
+ }
+
+
} while (cursor.moveToNext());
}
cursor.close();
diff --git a/src/de/podfetcher/storage/PodDBAdapter.java b/src/de/podfetcher/storage/PodDBAdapter.java
index d12f225e8..4169d4570 100644
--- a/src/de/podfetcher/storage/PodDBAdapter.java
+++ b/src/de/podfetcher/storage/PodDBAdapter.java
@@ -472,6 +472,7 @@ public class PodDBAdapter {
.getColumnIndex(KEY_FILE_URL)), cursor.getString(cursor
.getColumnIndex(KEY_DOWNLOAD_URL)), cursor.getInt(cursor
.getColumnIndex(KEY_DOWNLOADED)) > 0);
+ cursor.close();
return media;
}
@@ -492,6 +493,7 @@ public class PodDBAdapter {
.getColumnIndex(KEY_FILE_URL)), cursor.getString(cursor
.getColumnIndex(KEY_DOWNLOAD_URL)), cursor.getInt(cursor
.getColumnIndex(KEY_DOWNLOADED)) > 0);
+ cursor.close();
return image;
}