diff src/library/library.cc @ 228:d030b30526d5

config: remove unused username parameter from anilist auth
author Paper <mrpapersonic@gmail.com>
date Tue, 09 Jan 2024 08:05:36 -0500
parents c4f03f83b252
children 862d0d8619f6
line wrap: on
line diff
--- a/src/library/library.cc	Mon Jan 08 21:30:18 2024 -0500
+++ b/src/library/library.cc	Tue Jan 09 08:05:36 2024 -0500
@@ -19,13 +19,13 @@
 void SearchLibraryFolders() {
 	library.clear();
 
-	for (const auto& spath : session.config.library.paths) {
-		const std::filesystem::path path(spath);
-		for (const auto& entry : std::filesystem::recursive_directory_iterator(path)) {
-			if (!std::filesystem::is_regular_file(entry.path()))
+	for (const auto& folder : session.config.library.paths) {
+		for (const auto& entry : std::filesystem::recursive_directory_iterator(folder)) {
+			const std::filesystem::path path = entry.path();
+			if (!std::filesystem::is_regular_file(path))
 				continue;
 
-			const std::string basename = entry.path().filename().string();
+			const std::string basename = path.filename().u8string();
 
 			anitomy::Anitomy anitomy;
 			anitomy.Parse(Strings::ToWstring(basename));
@@ -41,7 +41,7 @@
 			const int episode = Strings::ToInt(Strings::ToUtf8String(elements.get(anitomy::kElementEpisodeNumber)));
 
 			// we have an ID now!
-			library[id][episode] = entry.path();
+			library[id][episode] = path.u8string();
 		}
 	}
 }