From 890e701e6ac024bc4505d0a85f693aa88c6c2d22 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 4 Jul 2018 22:58:11 +0200 Subject: [PATCH] - movieinfo/moviebrowser: do not use any fake date to fill dateOfLastPlay and file.Time Signed-off-by: Thilo Graf --- src/driver/movieinfo.cpp | 27 +++++---------------------- src/gui/moviebrowser/mb.cpp | 13 ++++++++++--- 2 files changed, 15 insertions(+), 25 deletions(-) diff --git a/src/driver/movieinfo.cpp b/src/driver/movieinfo.cpp index 3e555bc38..a214eb4c9 100644 --- a/src/driver/movieinfo.cpp +++ b/src/driver/movieinfo.cpp @@ -278,7 +278,7 @@ static int find_next_char(char to_find, const char *text, int start_pos, int end bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) { int bookmark_nr = 0; - movie_info->dateOfLastPlay = 0; //100*366*24*60*60; // (date, month, year) + movie_info->dateOfLastPlay = 0; // UNIX Epoch time //bool result = false; const char *text = _text.c_str(); @@ -493,18 +493,10 @@ bool CMovieInfo::addNewBookmark(MI_MOVIE_INFO * movie_info, MI_BOOKMARK & new_bo void CMovieInfo::clearMovieInfo(MI_MOVIE_INFO * movie_info) { //TRACE("[mi]->clearMovieInfo \r\n"); - tm timePlay; - timePlay.tm_hour = 0; - timePlay.tm_min = 0; - timePlay.tm_sec = 0; - timePlay.tm_year = 100; - timePlay.tm_mday = 0; - timePlay.tm_mon = 1; - movie_info->file.Name = ""; movie_info->file.Size = 0; // Megabytes - movie_info->file.Time = mktime(&timePlay); - movie_info->dateOfLastPlay = mktime(&timePlay); // (date, month, year) + movie_info->file.Time = 0; + movie_info->dateOfLastPlay = 0; // UNIX Epoch time movie_info->dirItNr = 0; // movie_info->genreMajor = 0; //genreMajor; movie_info->genreMinor = 0; //genreMinor; @@ -543,20 +535,11 @@ void CMovieInfo::clearMovieInfo(MI_MOVIE_INFO * movie_info) void MI_MOVIE_INFO::clear(void) { - tm timePlay; - timePlay.tm_hour = 0; - timePlay.tm_min = 0; - timePlay.tm_sec = 0; - timePlay.tm_year = 100; - timePlay.tm_mday = 0; - timePlay.tm_mon = 1; - timePlay.tm_isdst = -1; - file.Name = ""; file.Url = ""; file.Size = 0; // Megabytes - file.Time = mktime(&timePlay); - dateOfLastPlay = mktime(&timePlay); + file.Time = 0; + dateOfLastPlay = 0; // UNIX Epoch time dirItNr = 0; genreMajor = 0; genreMinor = 0; diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index ad2011698..9edc12174 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3839,9 +3839,16 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite *item_string = str_tmp; break; case MB_INFO_PREVPLAYDATE: // = 12, - tm_tmp = localtime(&movie_info.dateOfLastPlay); - snprintf(str_tmp, sizeof(str_tmp),"%02d.%02d.%02d",tm_tmp->tm_mday,(tm_tmp->tm_mon)+ 1, tm_tmp->tm_year >= 100 ? tm_tmp->tm_year-100 : tm_tmp->tm_year); - *item_string = str_tmp; + if (movie_info.dateOfLastPlay == 0) + { + *item_string = "---"; + } + else + { + tm_tmp = localtime(&movie_info.dateOfLastPlay); + snprintf(str_tmp, sizeof(str_tmp),"%02d.%02d.%02d",tm_tmp->tm_mday,(tm_tmp->tm_mon)+ 1, tm_tmp->tm_year >= 100 ? tm_tmp->tm_year-100 : tm_tmp->tm_year); + *item_string = str_tmp; + } break; case MB_INFO_RECORDDATE: // = 13,