Skip to content

Commit 8da45af

Browse files
kenmcgaughKen McGaugh
authored andcommitted
This MacOS-only fix prevents an "stroull" error message when a .DS_Store file exists in a thumbnail cache directory.
Signed-off-by: Ken McGaugh <[email protected]>
1 parent fa32aa1 commit 8da45af

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/thumbnail/src/thumbnail.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ void DiskCacheStat::populate(const std::string &path) {
1717
for (const auto &entry : fs::recursive_directory_iterator(path)) {
1818
if (fs::is_regular_file(entry.status())) {
1919
auto mtime = fs::last_write_time(entry.path());
20+
const auto stem = entry.path().stem().string();
21+
#if __apple__
22+
if (stem == ".DS_Store")
23+
continue;
24+
#endif
2025
add_thumbnail(
21-
std::stoull(entry.path().stem().string(), nullptr, 16),
26+
std::stoull(stem, nullptr, 16),
2227
fs::file_size(entry.path()),
2328
mtime);
2429
}

0 commit comments

Comments
 (0)