mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
EggTVData::Folder::Folder: use newest timestamp of file inside directory
The timestamp of the directory itself would change when replays are deleted.
This commit is contained in:
parent
3bc7b48b7e
commit
2a863ab985
1 changed files with 13 additions and 2 deletions
|
|
@ -174,12 +174,23 @@ void EggTVData::Folder::Cache::release(const ReplayRef& ref)
|
|||
}
|
||||
|
||||
EggTVData::Folder::Folder(EggTVData& tv, const fs::directory_entry& entry) :
|
||||
size_(std::distance(fs::directory_iterator(entry.path()), fs::directory_iterator())),
|
||||
time_(time_point_conv<decltype(time_)>(entry.last_write_time())),
|
||||
tv_(&tv),
|
||||
name_(entry.path().filename().string())
|
||||
{
|
||||
SRB2_ASSERT(entry.path().parent_path() == tv_->root_);
|
||||
|
||||
time_ = time_point_t::min();
|
||||
size_ = 0;
|
||||
|
||||
for (const fs::directory_entry& entry : fs::directory_iterator(entry.path()))
|
||||
{
|
||||
const time_point_t t = time_point_conv<time_point_t>(entry.last_write_time());
|
||||
|
||||
if (time_ < t)
|
||||
time_ = t;
|
||||
|
||||
size_++;
|
||||
}
|
||||
}
|
||||
|
||||
EggTVData::Replay::Title::operator const std::string() const
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue