@@ -52,6 +52,7 @@ def _create_or_post_to_topic(app, is_generated, text):
5252
5353 App .query .filter_by (app_uuid = app .app_uuid ).update ({'discourse_topic_id' : rv ['topic_id' ]})
5454 db .session .commit ()
55+ app .discourse_topic_id = rv ['topic_id' ]
5556 else :
5657 _client .create_post (text , category_id = config ['DISCOURSE_SHOWCASE_TOPIC_ID' ], topic_id = app .discourse_topic_id )
5758
@@ -83,6 +84,9 @@ def screenshot_section(app):
8384 return output
8485
8586def announce_release (app , release , is_generated ):
87+ if app .discourse_topic_id == 0 :
88+ announce_new_app (app , is_generated , is_new = False )
89+
8690 _create_or_post_to_topic (app , is_generated , text = f"""
8791# { random_party_emoji ()} Update alert!
8892
@@ -96,13 +100,13 @@ def announce_release(app, release, is_generated):
96100
97101""" )
98102
99- def announce_new_app (app , is_generated ):
103+ def announce_new_app (app , is_generated , is_new = True ):
100104 _create_or_post_to_topic (app , is_generated , text = f"""
101105{ banner (app )}
102106
103107# { app .title } by { app .developer .name }
104108
105- :party: There's a new { app .type } on the Rebble App Store!
109+ :party: There's { " a new" if is_new else "another cool" } { app .type } on the Rebble App Store!
106110
107111[quote=\" { app .developer .name } says\" ]
108112{ get_app_description (app )}
0 commit comments