Commit 0d9005d4 authored by Geoffrey Métais's avatar Geoffrey Métais

Less intrusive reload notification

For reloads, like on regular app launch, we show notification only if
new media are parsed
parent 9e92b94e
......@@ -119,7 +119,6 @@ public class MediaParsingService extends Service implements DevicesDiscoveryCb {
mMedialibrary.addDevice(isMainStorage ? "main-storage" : FileUtils.getFileNameFromPath(storage), storage, !isMainStorage);
}
if (mMedialibrary.init(VLCApplication.getAppContext())) {
showNotification();
LocalBroadcastManager.getInstance(MediaParsingService.this).sendBroadcast(new Intent(VLCApplication.ACTION_MEDIALIBRARY_READY));
String[] foldersList = mMedialibrary.getFoldersList();
if (foldersList.length == 0) {
......@@ -210,7 +209,8 @@ public class MediaParsingService extends Service implements DevicesDiscoveryCb {
@Override
public void onDiscoveryProgress(String entryPoint) {
mCurrentDiscovery = entryPoint;
showNotification();
if (mReload == 0)
showNotification();
}
@Override
......@@ -232,9 +232,6 @@ public class MediaParsingService extends Service implements DevicesDiscoveryCb {
public void onReloadStarted(String entryPoint) {
if (TextUtils.isEmpty(entryPoint))
++mReload;
synchronized (this) {
mLastNotificationTime = System.currentTimeMillis();
}
}
@Override
......
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