[Android] Save media meta only if we change media

Geoffrey Métais git at videolan.org
Fri May 11 17:09:53 CEST 2018


vlc-android | branch: 3.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri May 11 17:09:27 2018 +0200| [35750a5559f7b9f82d78dff94aece9dfe6ecd1bb] | committer: Geoffrey Métais

Save media meta only if we change media

> https://code.videolan.org/videolan/vlc-android/commit/35750a5559f7b9f82d78dff94aece9dfe6ecd1bb
---

 vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
index 9f68277ba..88488b7d8 100644
--- a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -669,9 +669,11 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
             }
             MediaPlayer.Event.Paused -> medialibrary.resumeBackgroundOperations()
             MediaPlayer.Event.EndReached -> {
-                saveMediaMeta()
-                if (isBenchmark) player.setPreviousStats()
-                if (nextIndex == -1) savePosition(true)
+                if (currentIndex != nextIndex) {
+                    saveMediaMeta()
+                    if (isBenchmark) player.setPreviousStats()
+                    if (nextIndex == -1) savePosition(true)
+                }
                 next()
             }
             MediaPlayer.Event.EncounteredError -> {



More information about the Android mailing list