Commit 7d8cfdad authored by Geoffrey Métais's avatar Geoffrey Métais

Implement medialibrary forceRescan()

parent 064699c4
......@@ -166,6 +166,12 @@ AndroidMediaLibrary::forceParserRetry()
p_ml->forceParserRetry();
}
void
AndroidMediaLibrary::forceRescan()
{
p_ml->forceRescan();
}
bool
AndroidMediaLibrary::increasePlayCount(int64_t mediaId)
{
......
......@@ -45,6 +45,7 @@ public:
void reload();
void reload( const std::string& entryPoint );
void forceParserRetry();
void forceRescan();
bool increasePlayCount(int64_t mediaId);
/* History */
std::vector<medialibrary::MediaPtr> lastMediaPlayed();
......
......@@ -191,6 +191,13 @@ forceParserRetry(JNIEnv* env, jobject thiz)
aml->forceParserRetry();
}
void
forceRescan(JNIEnv* env, jobject thiz)
{
AndroidMediaLibrary *aml = MediaLibrary_getInstance(env, thiz);
aml->forceRescan();
}
jboolean
increasePlayCount(JNIEnv* env, jobject thiz, jlong id)
{
......@@ -804,6 +811,7 @@ static JNINativeMethod methods[] = {
{"nativeReload", "()V", (void*)reload },
{"nativeReload", "(Ljava/lang/String;)V", (void*)reloadEntryPoint },
{"nativeForceParserRetry", "()V", (void*)forceParserRetry },
{"nativeForceRescan", "()V", (void*)forceRescan },
{"nativeIncreasePlayCount", "(J)Z", (void*)increasePlayCount },
{"nativeSetMediaUpdatedCbFlag", "(I)V", (void*)setMediaUpdatedCbFlag },
{"nativeSetMediaAddedCbFlag", "(I)V", (void*)setMediaAddedCbFlag },
......
......@@ -242,8 +242,11 @@ public class Medialibrary {
}
public void forceParserRetry() {
if (mIsInitiated)
nativeForceParserRetry();
if (mIsInitiated) nativeForceParserRetry();
}
public void forceRescan() {
if (mIsInitiated) nativeForceRescan();
}
@WorkerThread
......@@ -651,6 +654,7 @@ public class Medialibrary {
private native void nativeReload();
private native void nativeReload(String entryPoint);
private native void nativeForceParserRetry();
private native void nativeForceRescan();
private native boolean nativeIncreasePlayCount(long mediaId);
private native void nativeSetMediaUpdatedCbFlag(int flags);
private native void nativeSetMediaAddedCbFlag(int flags);
......
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