From e71823b47b7a21dde2c6735801d2f56efdcf9fd8 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 3 Jun 2019 17:59:40 +0200 Subject: [PATCH] movieplayer: fix unnecessary save xml file in stream mode --- src/gui/movieplayer.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index c279b48ff..5d59e6f6c 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -2428,7 +2428,8 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) if (p_movie_info->length == 0) { p_movie_info->length = (float)duration / 60 / 1000 + 0.5; } - cMovieInfo.saveMovieInfo(*p_movie_info); + if (!isYT && !isHTTP && !isUPNP) + cMovieInfo.saveMovieInfo(*p_movie_info); //p_movie_info->fileInfoStale(); //TODO: we might to tell the Moviebrowser that the movie info has changed, but this could cause long reload times when reentering the Moviebrowser } } @@ -2538,7 +2539,8 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) new_bookmark.length = play_sec - new_bookmark.pos; TRACE("[mp] commercial length: %d\r\n", new_bookmark.length); if (cMovieInfo.addNewBookmark(p_movie_info, new_bookmark) == true) { - cMovieInfo.saveMovieInfo(*p_movie_info); /* save immediately in xml file */ + if (!isYT && !isHTTP && !isUPNP) + cMovieInfo.saveMovieInfo(*p_movie_info); /* save immediately in xml file */ } new_bookmark.pos = 0; // clear again, since this is used as flag for bookmark activity newComHintBox.hide(); @@ -2548,7 +2550,8 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) new_bookmark.pos = play_sec; TRACE("[mp] loop length: %d\r\n", new_bookmark.length); if (cMovieInfo.addNewBookmark(p_movie_info, new_bookmark) == true) { - cMovieInfo.saveMovieInfo(*p_movie_info); /* save immediately in xml file */ + if (!isYT && !isHTTP && !isUPNP) + cMovieInfo.saveMovieInfo(*p_movie_info); /* save immediately in xml file */ jump_not_until = play_sec + 5; // avoid jumping for this time } new_bookmark.pos = 0; // clear again, since this is used as flag for bookmark activity @@ -2617,7 +2620,8 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) new_bookmark.pos = play_sec; new_bookmark.length = 0; if (cMovieInfo.addNewBookmark(p_movie_info, new_bookmark) == true) - cMovieInfo.saveMovieInfo(*p_movie_info); /* save immediately in xml file */ + if (!isYT && !isHTTP && !isUPNP) + cMovieInfo.saveMovieInfo(*p_movie_info); /* save immediately in xml file */ new_bookmark.pos = 0; // clear again, since this is used as flag for bookmark activity } else if (cSelectedMenuBookStart[3].selected == true) { /* Moviebrowser jump forward bookmark */ @@ -2633,12 +2637,14 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) /* Moviebrowser movie start bookmark */ p_movie_info->bookmarks.start = play_sec; TRACE("[mp] New movie start pos: %d\r\n", p_movie_info->bookmarks.start); - cMovieInfo.saveMovieInfo(*p_movie_info); /* save immediately in xml file */ + if (!isYT && !isHTTP && !isUPNP) + cMovieInfo.saveMovieInfo(*p_movie_info); /* save immediately in xml file */ } else if (cSelectedMenuBookStart[6].selected == true) { /* Moviebrowser movie end bookmark */ p_movie_info->bookmarks.end = play_sec; TRACE("[mp] New movie end pos: %d\r\n", p_movie_info->bookmarks.end); - cMovieInfo.saveMovieInfo(*p_movie_info); /* save immediately in xml file */ + if (!isYT && !isHTTP && !isUPNP) + cMovieInfo.saveMovieInfo(*p_movie_info); /* save immediately in xml file */ } } }