3v324v23 commited on
Commit
6d2c2d9
·
1 Parent(s): 432ec27

Easter Egg update: Show 'Your Name' quotes whenever 0 results are found to 'cheer up' the user

Browse files
server/src/controllers/search.controller.js CHANGED
@@ -132,7 +132,7 @@ async function handleSearch(req, res, next) {
132
  ]);
133
  logger.info('AI ranking complete', { topCount: rankedResults.length });
134
 
135
- // --- Easter Egg: Your Name (Kimi no Na wa) ---
136
  const quotes = [
137
  "Musubi is the old way of calling the guardian god. To tie thread is Musubi. To connect people is Musubi. The flow of time is Musubi.",
138
  "I’m always searching for something, a person, a place... I don't know what it is or where it is, but I know it's important to me...",
@@ -140,15 +140,20 @@ async function handleSearch(req, res, next) {
140
  "Wherever you are in the world, I'll search for you.",
141
  "It's like a dream. It's like a miracle.",
142
  "The names are... Mitsuha! Taki!",
143
- "Once in a while when I wake up. I find myself crying."
 
 
144
  ];
145
 
146
- const isEasterEgg = query.toLowerCase().includes('your name') ||
147
  query.toLowerCase().includes('kimi no na wa') ||
148
  (intent.reasoning && intent.reasoning.toLowerCase().includes('kimi no na wa')) ||
149
  (intent.reasoning && intent.reasoning.toLowerCase().includes('your name'));
150
 
151
- const easterEgg = isEasterEgg ? quotes[Math.floor(Math.random() * quotes.length)] : null;
 
 
 
152
 
153
  success(res, {
154
  query,
 
132
  ]);
133
  logger.info('AI ranking complete', { topCount: rankedResults.length });
134
 
135
+ // --- Discovery Quotes (Your Name & Inspiration) ---
136
  const quotes = [
137
  "Musubi is the old way of calling the guardian god. To tie thread is Musubi. To connect people is Musubi. The flow of time is Musubi.",
138
  "I’m always searching for something, a person, a place... I don't know what it is or where it is, but I know it's important to me...",
 
140
  "Wherever you are in the world, I'll search for you.",
141
  "It's like a dream. It's like a miracle.",
142
  "The names are... Mitsuha! Taki!",
143
+ "Once in a while when I wake up. I find myself crying.",
144
+ "I wanted to tell you that... wherever you may end up in this world, I will search for you.",
145
+ "There's no way we could meet. But one thing is certain. If we see each other, we'll know. That you were the one who lived inside me. That I am the one who lived inside you."
146
  ];
147
 
148
+ const isMovieQuery = query.toLowerCase().includes('your name') ||
149
  query.toLowerCase().includes('kimi no na wa') ||
150
  (intent.reasoning && intent.reasoning.toLowerCase().includes('kimi no na wa')) ||
151
  (intent.reasoning && intent.reasoning.toLowerCase().includes('your name'));
152
 
153
+ // Activate quote if results are 0 (to cheer up the user) OR if it's a specific movie query
154
+ const easterEgg = (isMovieQuery || rankedResults.length === 0)
155
+ ? quotes[Math.floor(Math.random() * quotes.length)]
156
+ : null;
157
 
158
  success(res, {
159
  query,