Advertisement
Guest User

Untitled

a guest
Jun 16th, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.87 KB | None | 0 0
  1. From 2abe3ec6f2c9a333e712a8753ef3a50b2c9d663b Mon Sep 17 00:00:00 2001
  2. From: montellese <montellese@xbmc.org>
  3. Date: Sat, 16 Jun 2012 21:58:17 +0200
  4. Subject: [PATCH] dateadded: more debug logging
  5.  
  6. ---
  7. xbmc/video/VideoDatabase.cpp |   13 +++++++++++++
  8.  1 files changed, 13 insertions(+), 0 deletions(-)
  9.  
  10. diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp
  11. index 6ada8ad..19e7737 100644
  12. --- a/xbmc/video/VideoDatabase.cpp
  13. +++ b/xbmc/video/VideoDatabase.cpp
  14. @@ -705,6 +705,13 @@ void CVideoDatabase::UpdateFileDateAdded(int idFile, const CStdString& strFileNa
  15.        if (CFile::Stat(file, &buffer) == 0)
  16.        {
  17.          time_t now = time(NULL);
  18. +
  19. +        CLog::Log(LOGDEBUG, "CFile::Stat(%s):", strFileNameAndPath.c_str());
  20. +        CLog::Log(LOGDEBUG, "    atime: %d", (int)buffer.st_atime);
  21. +        CLog::Log(LOGDEBUG, "    mtime: %d", (int)buffer.st_mtime);
  22. +        CLog::Log(LOGDEBUG, "    ctime: %d", (int)buffer.st_ctime);
  23. +        CLog::Log(LOGDEBUG, "    now:   %d", (int)now);
  24. +
  25.          time_t addedTime;
  26.          // Prefer the modification time if it's valid
  27.          if (g_advancedSettings.m_iVideoLibraryDateAdded == 1)
  28. @@ -723,6 +730,12 @@ void CVideoDatabase::UpdateFileDateAdded(int idFile, const CStdString& strFileNa
  29.                CLog::Log(LOGWARNING, "invalid mtime %d for file %s; falling back to ctime", (int)buffer.st_mtime, strFileNameAndPath.c_str());
  30.  
  31.              addedTime = (time_t)buffer.st_ctime;
  32. +            struct tm *cTime = localtime(&addedTime);
  33. +            if (cTime)
  34. +            {
  35. +              CDateTime ctime = *cTime;
  36. +              CLog::Log(LOGWARNING, "falling back to ctime %s (%d) for file %s", ctime.GetAsDBDateTime().c_str(), (int)addedTime, strFileNameAndPath.c_str());
  37. +            }
  38.            }
  39.          }
  40.          // Use the newer of the creation and modification time
  41. --
  42. 1.7.7.msysgit.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement