Add discNumber to Song and populate it
This commit is contained in:
parent
e788e11e5c
commit
38fb581ee1
@ -539,9 +539,10 @@ public class FullPlaybackActivity extends SlidingPlaybackActivity
|
||||
mYear = data.getFirst(MediaMetadataExtractor.YEAR);
|
||||
mPath = song.path;
|
||||
|
||||
String disc = data.getFirst(MediaMetadataExtractor.DISC_NUMBER);
|
||||
if (disc != null && disc.length() > 0)
|
||||
mTrack += String.format(" (%s💿)", disc);
|
||||
mTrack = String.format("%d", song.trackNumber);
|
||||
if (song.discNumber > 0) {
|
||||
mTrack += String.format(" (%d💿)", song.discNumber);
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder(12);
|
||||
sb.append(decodeMimeType(data.getFirst(MediaMetadataExtractor.MIME_TYPE)));
|
||||
|
@ -559,7 +559,7 @@ public class MediaUtils {
|
||||
songId = -2; // must be less than -1 (-1 defines an empty song object)
|
||||
|
||||
// Build minimal fake-database entry for this file
|
||||
Object[] objData = new Object[] { songId, path, "", "", "", 0, 0, 0, 0 };
|
||||
Object[] objData = new Object[] { songId, path, "", "", "", 0, 0, 0, 0, 0 };
|
||||
|
||||
if (title != null)
|
||||
objData[2] = title;
|
||||
|
@ -62,6 +62,7 @@ public class Song implements Comparable<Song> {
|
||||
MediaLibrary.ContributorColumns.ARTIST_ID,
|
||||
MediaLibrary.SongColumns.DURATION,
|
||||
MediaLibrary.SongColumns.SONG_NUMBER,
|
||||
MediaLibrary.SongColumns.DISC_NUMBER,
|
||||
};
|
||||
|
||||
public static final String[] EMPTY_PLAYLIST_PROJECTION = {
|
||||
@ -78,6 +79,7 @@ public class Song implements Comparable<Song> {
|
||||
MediaLibrary.ContributorColumns.ARTIST_ID,
|
||||
MediaLibrary.SongColumns.DURATION,
|
||||
MediaLibrary.SongColumns.SONG_NUMBER,
|
||||
MediaLibrary.SongColumns.DISC_NUMBER,
|
||||
};
|
||||
|
||||
/**
|
||||
@ -124,6 +126,10 @@ public class Song implements Comparable<Song> {
|
||||
* The position of the song in its album.
|
||||
*/
|
||||
public int trackNumber;
|
||||
/**
|
||||
* The disc number where this song is present.
|
||||
*/
|
||||
public int discNumber;
|
||||
|
||||
/**
|
||||
* Song flags. Currently {@link #FLAG_RANDOM} or {@link #FLAG_NO_COVER}.
|
||||
@ -181,6 +187,7 @@ public class Song implements Comparable<Song> {
|
||||
artistId = cursor.getLong(6);
|
||||
duration = cursor.getLong(7);
|
||||
trackNumber = cursor.getInt(8);
|
||||
discNumber = cursor.getInt(9);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user