aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-12-11 18:02:45 -0800
committerScott Jackson <daneren2005@gmail.com>2015-12-11 18:02:45 -0800
commit8bd8ba0244436a809cfecde8122a7b2a1c525145 (patch)
tree6f5b9ca887fe677d62a8d1e767fc975f3a38ab4c /app
parent7e288e34ad29154da0c03ce05fb92956ae19cb78 (diff)
downloaddsub-8bd8ba0244436a809cfecde8122a7b2a1c525145.tar.gz
dsub-8bd8ba0244436a809cfecde8122a7b2a1c525145.tar.bz2
dsub-8bd8ba0244436a809cfecde8122a7b2a1c525145.zip
If case of multiple identical paths offline, show last played as most recent one
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/SongDBHandler.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/util/SongDBHandler.java b/app/src/main/java/github/daneren2005/dsub/util/SongDBHandler.java
index e7716b49..ba0851c2 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/SongDBHandler.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/SongDBHandler.java
@@ -116,7 +116,6 @@ public class SongDBHandler extends SQLiteOpenHelper {
}
public Long[] getLastPlayed(MusicDirectory.Entry entry) {
- // TODO: In case of offline want to get most recent played match
return getLastPlayed(getOnlineSongId(entry));
}
protected Long[] getLastPlayed(Pair<Integer, String> pair) {
@@ -171,7 +170,7 @@ public class SongDBHandler extends SQLiteOpenHelper {
SQLiteDatabase db = this.getReadableDatabase();
String[] columns = {SONGS_SERVER_KEY, SONGS_SERVER_ID};
- Cursor cursor = db.query(TABLE_SONGS, columns, SONGS_COMPLETE_PATH + " = ?", new String[] { path }, null, null, null, null);
+ Cursor cursor = db.query(TABLE_SONGS, columns, SONGS_COMPLETE_PATH + " = ?", new String[] { path }, null, null, SONGS_LAST_PLAYED + " DESC", null);
try {
cursor.moveToFirst();