Skip to content

Commit

Permalink
clearer log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
bakatrouble committed Jan 20, 2020
1 parent cf4ece3 commit 6ba1fdc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,25 @@ string getLastAlbumItem() {
for (auto &entry : fs::directory_iterator(albumPath))
if (entry.is_directory() && isDigitsOnly(entry.path().filename()) && entry.path().filename().string().length() == 4)
years.push_back(entry.path());
if (years.empty()) return "no years";
if (years.empty()) return "<No years in " + albumPath + ">";
sort(years.begin(), years.end());

for (auto &entry : fs::directory_iterator(years.back()))
if (entry.is_directory() && isDigitsOnly(entry.path().filename()) && entry.path().filename().string().length() == 2)
months.push_back(entry.path());
if (months.empty()) return "no months";
if (months.empty()) return "<No years in " + years.back() + ">";
sort(months.begin(), months.end());

for (auto &entry : fs::directory_iterator(months.back()))
if (entry.is_directory() && isDigitsOnly(entry.path().filename()) && entry.path().filename().string().length() == 2)
days.push_back(entry.path());
if (days.empty()) return "no days";
if (days.empty()) return "<No years in " + months.back() + ">";
sort(days.begin(), days.end());

for (auto &entry : fs::directory_iterator(days.back()))
if (entry.is_regular_file())
files.push_back(entry.path());
if (files.empty()) return "no files";
if (files.empty()) return "<No years in " + days.back() + ">";
sort(files.begin(), files.end());

return files.back();
Expand Down

0 comments on commit 6ba1fdc

Please sign in to comment.