diff src/core/anime_db.cc @ 260:dd211ff68b36

pages/seasons: add initial functionality the menu doesn't work yet, but it's a good start
author Paper <paper@paper.us.eu.org>
date Wed, 03 Apr 2024 19:48:38 -0400
parents 862d0d8619f6
children 9a04802848c0
line wrap: on
line diff
--- a/src/core/anime_db.cc	Mon Apr 01 18:11:15 2024 -0400
+++ b/src/core/anime_db.cc	Wed Apr 03 19:48:38 2024 -0400
@@ -131,12 +131,14 @@
 		return 0;
 
 	for (const auto& [id, anime] : items) {
-		if (anime.GetUserPreferredTitle() == title)
-			return id;
+		std::vector<std::string> synonyms(anime.GetTitleSynonyms());
+		synonyms.push_back(anime.GetUserPreferredTitle());
 
-		for (const auto& synonym : anime.GetTitleSynonyms())
-			if (synonym == title)
+		for (const auto& synonym : synonyms) {
+			if (synonym == title) {
 				return id;
+			}
+		}
 	}
 
 	return 0;