bradley6597 commited on
Commit
67cdfd9
1 Parent(s): c982cc3

More edge cases for map issues

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -100,11 +100,10 @@ def search_index(search_text, sd, ks, sort_by, max_results, user_num, search_tit
100
  output.extend(output_ai)
101
 
102
  output = [x for o in output for x in o if type(x) is not float]
103
-
104
  load_more_visible = False
105
  extra_info = ''
106
  if 'map' in search_text:
107
- extra_info = '<strong>If real-world maps are needed please check they are in the folder: Illustrations Now > Maps - Using the New Guidance (2024)</strong><br>'
108
  if len(output) > 0:
109
 
110
  output_df = (pd.DataFrame(output)
@@ -113,6 +112,10 @@ def search_index(search_text, sd, ks, sort_by, max_results, user_num, search_tit
113
  .reset_index()
114
  .drop_duplicates())
115
  output_df['Date Created'] = pd.to_datetime(output_df['Date Created'], format = 'mixed')
 
 
 
 
116
  output_df['url'] = output_df['url'].str.replace("/u/0/", f"/u/{int(user_num)}/", regex = False)
117
  if len(sd) == 1:
118
  output_df = output_df[(output_df['filepath'].str.contains(str(sd[0]), regex = False))]
 
100
  output.extend(output_ai)
101
 
102
  output = [x for o in output for x in o if type(x) is not float]
 
103
  load_more_visible = False
104
  extra_info = ''
105
  if 'map' in search_text:
106
+ extra_info = '<strong>If real-world maps are needed please check they are from the folder: Illustrations Now > Maps - Using the New Guidance (2024)</strong><br>'
107
  if len(output) > 0:
108
 
109
  output_df = (pd.DataFrame(output)
 
112
  .reset_index()
113
  .drop_duplicates())
114
  output_df['Date Created'] = pd.to_datetime(output_df['Date Created'], format = 'mixed')
115
+ map_df = output_df[output_df['title'].str.contains('map|Map', regex = True)]
116
+ if map_df.shape[0] > 0:
117
+ extra_info = '<strong>If real-world maps are needed please check they are from the folder: Illustrations Now > Maps - Using the New Guidance (2024)</strong><br>'
118
+
119
  output_df['url'] = output_df['url'].str.replace("/u/0/", f"/u/{int(user_num)}/", regex = False)
120
  if len(sd) == 1:
121
  output_df = output_df[(output_df['filepath'].str.contains(str(sd[0]), regex = False))]