[Android] medialib: Update to recent thumbnail API changes

Hugo Beauzée-Luyssen git at videolan.org
Wed Nov 27 12:28:46 CET 2019


vlc-android | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed Nov 27 11:25:43 2019 +0100| [4da3a07d5533f061accf07f29a3c86bb1154bc04] | committer: Hugo Beauzée-Luyssen

medialib: Update to recent thumbnail API changes

> https://code.videolan.org/videolan/vlc-android/commit/4da3a07d5533f061accf07f29a3c86bb1154bc04
---

 medialibrary/jni/utils.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/medialibrary/jni/utils.cpp b/medialibrary/jni/utils.cpp
index fe691777d..bf9e45316 100644
--- a/medialibrary/jni/utils.cpp
+++ b/medialibrary/jni/utils.cpp
@@ -69,12 +69,13 @@ mediaToMediaWrapper(JNIEnv* env, fields *fields, medialibrary::MediaPtr const& m
     const medialibrary::IMetadata& seenMeta =  mediaPtr->metadata( medialibrary::IMedia::MetadataType::Seen );
     int64_t seen = seenMeta.isSet() ? seenMeta.asInt() : 0;
 
+    auto hasThumbnail = mediaPtr->thumbnailStatus(medialibrary::ThumbnailSizeType::Thumbnail) == medialibrary::ThumbnailStatus::Available;
     jobject item = env->NewObject(fields->MediaWrapper.clazz, fields->MediaWrapper.initID,
                           (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), mediaPtr->releaseDate());
+                           seen, hasThumbnail, mediaPtr->releaseDate());
     if (artist != NULL)
         env->DeleteLocalRef(artist);
     if (genre != NULL)



More information about the Android mailing list