mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2024-12-22 22:28:10 +01:00
Added GUI sketches, fixed a bug in the FeedManager
This commit is contained in:
parent
0cecd82550
commit
2df0fb4774
3
.gitignore
vendored
3
.gitignore
vendored
@ -21,3 +21,6 @@ local.properties
|
||||
# Eclipse project files
|
||||
.classpath
|
||||
.project
|
||||
|
||||
# other
|
||||
*.odg#
|
||||
|
@ -227,7 +227,9 @@ public class FeedManager {
|
||||
item.setLink(itemlistCursor.getString(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_LINK)));
|
||||
item.setDescription(itemlistCursor.getString(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_DESCRIPTION)));
|
||||
item.setPubDate(itemlistCursor.getString(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_PUBDATE)));
|
||||
item.setMedia(adapter.getFeedMedia(itemlistCursor.getLong(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_MEDIA))));
|
||||
item.setMedia(adapter.getFeedMedia(
|
||||
itemlistCursor.getLong(
|
||||
itemlistCursor.getColumnIndex(PodDBAdapter.KEY_MEDIA)), item));
|
||||
item.setRead((itemlistCursor.getInt(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_READ)) > 0) ? true : false);
|
||||
|
||||
items.add(item);
|
||||
|
@ -5,8 +5,7 @@ public class FeedMedia extends FeedFile{
|
||||
private long position;
|
||||
private long size; // File size in Byte
|
||||
private String mime_type;
|
||||
|
||||
private FeedItem item; // TODO remove
|
||||
private FeedItem item;
|
||||
|
||||
public FeedMedia(FeedItem i, String download_url, long size, String mime_type) {
|
||||
this.item = i;
|
||||
@ -15,10 +14,11 @@ public class FeedMedia extends FeedFile{
|
||||
this.mime_type = mime_type;
|
||||
}
|
||||
|
||||
public FeedMedia(long id, long length, long position, long size, String mime_type,
|
||||
public FeedMedia(long id, FeedItem item, long length, long position, long size, String mime_type,
|
||||
String file_url, String download_url) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.item = item;
|
||||
this.length = length;
|
||||
this.position = position;
|
||||
this.size = size;
|
||||
|
@ -269,7 +269,7 @@ public class PodDBAdapter {
|
||||
return c;
|
||||
}
|
||||
|
||||
public FeedMedia getFeedMedia(long row_index) throws SQLException{
|
||||
public FeedMedia getFeedMedia(long row_index, FeedItem owner) throws SQLException{
|
||||
open();
|
||||
Cursor cursor = db.query(TABLE_NAME_FEED_MEDIA, null, KEY_ID + "=?",
|
||||
new String[]{String.valueOf(row_index)}, null, null, null);
|
||||
@ -278,6 +278,7 @@ public class PodDBAdapter {
|
||||
throw new SQLException("No FeedMedia found at index: " + row_index);
|
||||
}
|
||||
FeedMedia media = new FeedMedia(row_index,
|
||||
owner,
|
||||
cursor.getLong(cursor.getColumnIndex(KEY_LENGTH)),
|
||||
cursor.getLong(cursor.getColumnIndex(KEY_POSITION)),
|
||||
cursor.getLong(cursor.getColumnIndex(KEY_SIZE)),
|
||||
|
Loading…
Reference in New Issue
Block a user