- movieinfo/moviebrowser: do not use any fake date to fill dateOfLastPlay and file.Time

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2018-07-04 22:58:11 +02:00
committed by Thilo Graf
parent 14384c8ad6
commit 890e701e6a
2 changed files with 15 additions and 25 deletions

View File

@@ -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) bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info)
{ {
int bookmark_nr = 0; 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; //bool result = false;
const char *text = _text.c_str(); 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) void CMovieInfo::clearMovieInfo(MI_MOVIE_INFO * movie_info)
{ {
//TRACE("[mi]->clearMovieInfo \r\n"); //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.Name = "";
movie_info->file.Size = 0; // Megabytes movie_info->file.Size = 0; // Megabytes
movie_info->file.Time = mktime(&timePlay); movie_info->file.Time = 0;
movie_info->dateOfLastPlay = mktime(&timePlay); // (date, month, year) movie_info->dateOfLastPlay = 0; // UNIX Epoch time
movie_info->dirItNr = 0; // movie_info->dirItNr = 0; //
movie_info->genreMajor = 0; //genreMajor; movie_info->genreMajor = 0; //genreMajor;
movie_info->genreMinor = 0; //genreMinor; movie_info->genreMinor = 0; //genreMinor;
@@ -543,20 +535,11 @@ void CMovieInfo::clearMovieInfo(MI_MOVIE_INFO * movie_info)
void MI_MOVIE_INFO::clear(void) 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.Name = "";
file.Url = ""; file.Url = "";
file.Size = 0; // Megabytes file.Size = 0; // Megabytes
file.Time = mktime(&timePlay); file.Time = 0;
dateOfLastPlay = mktime(&timePlay); dateOfLastPlay = 0; // UNIX Epoch time
dirItNr = 0; dirItNr = 0;
genreMajor = 0; genreMajor = 0;
genreMinor = 0; genreMinor = 0;

View File

@@ -3839,9 +3839,16 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite
*item_string = str_tmp; *item_string = str_tmp;
break; break;
case MB_INFO_PREVPLAYDATE: // = 12, case MB_INFO_PREVPLAYDATE: // = 12,
if (movie_info.dateOfLastPlay == 0)
{
*item_string = "---";
}
else
{
tm_tmp = localtime(&movie_info.dateOfLastPlay); 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); 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; *item_string = str_tmp;
}
break; break;
case MB_INFO_RECORDDATE: // = 13, case MB_INFO_RECORDDATE: // = 13,