Commit 399b9805 authored by Geoffrey Métais's avatar Geoffrey Métais

Just in time thumbnailer start

parent c326272b
......@@ -171,7 +171,7 @@ public class VideoGridFragment extends MediaBrowserFragment implements ISortable
@Override
public void onResume() {
super.onResume();
if ((getActivity() instanceof MainActivity))
if (getActivity() instanceof MainActivity)
mMainActivity = (MainActivity) getActivity();
mMediaLibrary.setBrowser(this);
mMediaLibrary.addUpdateHandler(mHandler);
......@@ -190,10 +190,6 @@ public class VideoGridFragment extends MediaBrowserFragment implements ISortable
updateViewMode();
if (animate)
mAnimator.animate();
/* Start the thumbnailer */
if (mThumbnailer != null)
mThumbnailer.start(this);
}
@Override
......@@ -394,11 +390,6 @@ public class VideoGridFragment extends MediaBrowserFragment implements ISortable
mSwipeRefreshLayout.setRefreshing(true);
final List<MediaWrapper> itemList = mMediaLibrary.getVideoItems();
if (mThumbnailer != null)
mThumbnailer.clearJobs();
else
Log.w(TAG, "Can't generate thumbnails, the thumbnailer is missing");
if (itemList.size() > 0) {
VLCApplication.runBackground(new Runnable() {
@Override
......@@ -430,6 +421,8 @@ public class VideoGridFragment extends MediaBrowserFragment implements ISortable
}
});
if (mThumbnailer != null && !jobsList.isEmpty()) {
mThumbnailer.clearJobs();
mThumbnailer.start(VideoGridFragment.this);
for (MediaWrapper item : jobsList)
mThumbnailer.addJob(item);
}
......
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