Ignore .nomedia file in statisitcs and flle gc.

GitOrigin-RevId: 2b1ab488b4686563d4d7368261c784c8cd7ad691
This commit is contained in:
levlam 2019-03-24 21:36:21 +03:00
parent d494a3e13f
commit 7776513651
2 changed files with 7 additions and 1 deletions

View File

@ -110,7 +110,7 @@ void FileGcWorker::run_gc(const FileGcParameters &parameters, std::vector<FullFi
return true;
}
if (static_cast<double>(info.mtime_nsec / 1000000000) > now - parameters.immunity_delay) {
// new files are immune to gc.
// new files are immune to gc
time_immunity_ignored_cnt++;
new_stats.add(FullFileInfo(info));
return true;

View File

@ -19,6 +19,7 @@
#include "td/utils/format.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h"
#include "td/utils/PathView.h"
#include "td/utils/port/path.h"
#include "td/utils/port/Stat.h"
@ -115,6 +116,11 @@ Status scan_fs(CallbackT &&callback) {
return;
}
auto stat = r_stat.move_as_ok();
if (ends_with(path, "/.nomedia") && stat.size_ == 0) {
// skip .nomedia file
return;
}
FsFileInfo info;
info.path = path.str();
info.size = stat.size_;