Commit 229d92fe authored by Geoffrey Métais's avatar Geoffrey Métais Committed by Geoffrey Métais
Browse files

Medialibrary: add tracks release year

parent 4d589156
......@@ -2008,7 +2008,7 @@ jint JNI_OnLoad(JavaVM *vm, void *reserved)
GET_ID(GetMethodID,
ml_fields.MediaWrapper.initID,
ml_fields.MediaWrapper.clazz,
"<init>", "(JLjava/lang/String;JJILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IILjava/lang/String;IIIIJJZ)V");
"<init>", "(JLjava/lang/String;JJILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IILjava/lang/String;IIIIJJZI)V");
GET_CLASS(ml_fields.HistoryItem.clazz,
"org/videolan/medialibrary/media/HistoryItem", true);
......
......@@ -85,7 +85,8 @@ mediaToMediaWrapper(JNIEnv* env, fields *fields, medialibrary::MediaPtr const& m
(jlong) mediaPtr->id(), mrl,(jlong) progress, (jlong) duration, type,
title, filename, artist, genre, album,
albumArtist, width, height, thumbnail,
audioTrack, spuTrack, trackNumber, discNumber, (jlong) files.at(0)->lastModificationDate(), seen, mediaPtr->isThumbnailGenerated(medialibrary::ThumbnailSizeType::Thumbnail));
audioTrack, spuTrack, trackNumber, discNumber, (jlong) files.at(0)->lastModificationDate(),
seen, mediaPtr->isThumbnailGenerated(medialibrary::ThumbnailSizeType::Thumbnail), mediaPtr->releaseDate());
if (artist != NULL)
env->DeleteLocalRef(artist);
if (genre != NULL)
......
......@@ -56,15 +56,15 @@ public class MLServiceLocator {
String albumArtist, int width, int height,
String artworkURL, int audio, int spu,
int trackNumber, int discNumber, long lastModified,
long seen, boolean isThumbnailGenerated) {
long seen, boolean isThumbnailGenerated, int releaseDate) {
if (sMode == LocatorMode.VLC_ANDROID) {
return new MediaWrapper(id, mrl, time, length, type, title,
filename, artist, genre, album, albumArtist, width, height, artworkURL,
audio, spu, trackNumber, discNumber, lastModified, seen, isThumbnailGenerated);
audio, spu, trackNumber, discNumber, lastModified, seen, isThumbnailGenerated, releaseDate);
} else {
return new StubMediaWrapper(id, mrl, time, length, type, title,
filename, artist, genre, album, albumArtist, width, height, artworkURL,
audio, spu, trackNumber, discNumber, lastModified, seen, isThumbnailGenerated);
audio, spu, trackNumber, discNumber, lastModified, seen, isThumbnailGenerated, releaseDate);
}
}
......
......@@ -14,7 +14,6 @@ import org.videolan.libvlc.util.Extensions;
import org.videolan.libvlc.util.VLCUtil;
import org.videolan.medialibrary.MLServiceLocator;
import org.videolan.medialibrary.Tools;
import org.videolan.medialibrary.interfaces.AbstractMedialibrary;
import org.videolan.medialibrary.media.MediaLibraryItem;
import java.util.Locale;
......@@ -76,6 +75,7 @@ public abstract class AbstractMediaWrapper extends MediaLibraryItem implements P
protected String mAlbumArtist;
protected String mRating;
protected String mDate;
protected int mReleaseYear;
protected String mSettings;
protected String mNowPlaying;
protected String mPublisher;
......@@ -120,13 +120,14 @@ public abstract class AbstractMediaWrapper extends MediaLibraryItem implements P
public AbstractMediaWrapper(long id, String mrl, long time, long length, int type, String title,
String filename, String artist, String genre, String album, String albumArtist,
int width, int height, String artworkURL, int audio, int spu, int trackNumber,
int discNumber, long lastModified, long seen, boolean isThumbnailGenerated) {
int discNumber, long lastModified, long seen, boolean isThumbnailGenerated, int releaseDate) {
super();
if (TextUtils.isEmpty(mrl)) throw new IllegalArgumentException("uri was empty");
mUri = Uri.parse(manageVLCMrl(mrl));
mId = id;
mFilename = filename;
mReleaseYear = releaseDate;
init(time, length, type, null, title, artist, genre, album, albumArtist, width, height,
artworkURL != null ? VLCUtil.UriFromMrl(artworkURL).getPath() : null, audio, spu,
trackNumber, discNumber, lastModified, seen, null);
......@@ -556,6 +557,10 @@ public abstract class AbstractMediaWrapper extends MediaLibraryItem implements P
return mDate;
}
public int getReleaseYear() {
return mReleaseYear;
}
public String getSettings() {
return mSettings;
}
......
......@@ -41,11 +41,11 @@ public class MediaWrapper extends AbstractMediaWrapper {
public MediaWrapper(long id, String mrl, long time, long length, int type, String title,
String filename, String artist, String genre, String album, String albumArtist,
int width, int height, String artworkURL, int audio, int spu, int trackNumber,
int discNumber, long lastModified, long seen, boolean isThumbnailGenerated) {
int discNumber, long lastModified, long seen, boolean isThumbnailGenerated, int releaseDate) {
super(id, mrl, time, length, type, title, filename, artist,
genre, album, albumArtist, width, height, artworkURL,
audio, spu, trackNumber, discNumber, lastModified,
seen, isThumbnailGenerated);
seen, isThumbnailGenerated, releaseDate);
}
public MediaWrapper(Uri uri, long time, long length, int type,
......
......@@ -63,21 +63,21 @@ public class StubDataSource {
media = MLServiceLocator.getAbstractMediaWrapper(getUUID(), baseMrl + fileName, 0L, 18820L, 0,
fileName, fileName, "", "",
"", "", 416, 304, "", 0, -2,
0, 0, 1509466228L, 0L, true);
0, 0, 1509466228L, 0L, true, 0);
addVideo(media);
fileName = "FMA - MultiChapter.mkv";
media = MLServiceLocator.getAbstractMediaWrapper(getUUID(), baseMrl + fileName, 0L, 1467383L, 0,
"Encoded with MiniCoder", fileName, "", "",
"", "", 1280, 720, "", 0,
-2, 0, 0, 1512396147L, 0L, true);
-2, 0, 0, 1512396147L, 0L, true, 0);
addVideo(media);
fileName = "114_My_Heart_Will_Go_On.avi";
media = MLServiceLocator.getAbstractMediaWrapper(getUUID(), baseMrl + fileName, 0L, 20000L, 0,
"My Heart Will Go On - Celine Dion", fileName, "", "",
"", "", 352, 220, "", 0,
-2, 0, 0, 1509465852L, 0L, true);
-2, 0, 0, 1509465852L, 0L, true, 0);
addVideo(media);
// Audio
......@@ -89,7 +89,7 @@ public class StubDataSource {
"Shine On CD2", "Peter Frampton",
0, 0, "/storage/emulated/0/Music/Peter Frampton/Shine On - CD2/Folder.jpg",
0, -2, 1, 0,
1547452796L, 0L, true);
1547452796L, 0L, true, 0);
addAudio(media, "", 1965, 400);
fileName = "01-Wind Of Change.mp3";
......@@ -99,7 +99,7 @@ public class StubDataSource {
"Shine On CD1", "Peter Frampton",
0, 0, "/storage/emulated/0/Music/Peter Frampton/Shine On - CD1/Folder.jpg",
0, -2, 1, 0,
1547452786L, 0L, true);
1547452786L, 0L, true, 0);
addAudio(media, "", 1960, 250);
fileName = "03 Bloody Well Right.wma";
......@@ -109,7 +109,7 @@ public class StubDataSource {
"The Autobiography of Supertramp", "Supertramp",
0, 0, "/storage/emulated/0/Music/Supertramp/Best of/Folder.jpg", 0,
-2, 3, 0,
1547452814L, 0L, true);
1547452814L, 0L, true, 0);
addAudio(media, "", 1970, 360);
}
......
......@@ -12,11 +12,11 @@ public class StubMediaWrapper extends AbstractMediaWrapper {
public StubMediaWrapper(long id, String mrl, long time, long length, int type, String title,
String filename, String artist, String genre, String album, String albumArtist,
int width, int height, String artworkURL, int audio, int spu, int trackNumber,
int discNumber, long lastModified, long seen, boolean isThumbnailGenerated) {
int discNumber, long lastModified, long seen, boolean isThumbnailGenerated, int releaseDate) {
super(id, mrl, time, length, type, title, filename, artist,
genre, album, albumArtist, width, height, artworkURL,
audio, spu, trackNumber, discNumber, lastModified,
seen, isThumbnailGenerated);
seen, isThumbnailGenerated, releaseDate);
}
public StubMediaWrapper(Uri uri, long time, long length, int type,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment