88PLATFORM_EMOJI = {
99 'aplite' : ':pebble-orange:' ,
1010 'basalt' : ':pebble-time-red:' ,
11- 'chalk' : 'pebble-time-round-14-rainbow' ,
12- 'diorite' : 'pebble-2-aqua' ,
13- 'emery' : 'core-time-2-red' ,
14- 'flint' : 'core-2-duo-black'
11+ 'chalk' : ': pebble-time-round-14-rainbow: ' ,
12+ 'diorite' : ': pebble-2-aqua: ' ,
13+ 'emery' : ': core-time-2-red: ' ,
14+ 'flint' : ': core-2-duo-black: '
1515}
1616
1717if config ['DISCOURSE_API_KEY' ] is None :
@@ -53,6 +53,7 @@ def _create_or_post_to_topic(app, is_generated, text):
5353
5454 App .query .filter_by (app_uuid = app .app_uuid ).update ({'discourse_topic_id' : rv ['topic_id' ]})
5555 db .session .commit ()
56+ app .discourse_topic_id = rv ['topic_id' ]
5657 else :
5758 _client .create_post (text , category_id = config ['DISCOURSE_SHOWCASE_TOPIC_ID' ], topic_id = app .discourse_topic_id )
5859
@@ -73,7 +74,7 @@ def screenshot_section(app):
7374 screenshots = asset_collections [platform ].screenshots
7475 output += f"### { PLATFORM_EMOJI [platform ]} { platform .title ()} screenshots:\n \n "
7576 if index != 0 :
76- output += ' [details="Expand"]'
77+ output += " [details=\ " Expand\" ] \n "
7778 output += f"|{ '' .join (['|' for screenshot in screenshots ])} \n "
7879 output += f"|{ '' .join (['-|' for screenshot in screenshots ])} \n "
7980 screenshot_section = '' .join ([f"} )|" for s_index , screenshot in enumerate (screenshots )])
@@ -84,6 +85,9 @@ def screenshot_section(app):
8485 return output
8586
8687def announce_release (app , release , is_generated ):
88+ if app .discourse_topic_id == 0 :
89+ announce_new_app (app , is_generated , is_new = False )
90+
8791 _create_or_post_to_topic (app , is_generated , text = f"""
8892# { random_party_emoji ()} Update alert!
8993
@@ -97,13 +101,13 @@ def announce_release(app, release, is_generated):
97101
98102""" )
99103
100- def announce_new_app (app , is_generated ):
104+ def announce_new_app (app , is_generated , is_new = True ):
101105 _create_or_post_to_topic (app , is_generated , text = f"""
102106{ banner (app )}
103107
104108# { app .title } by { app .developer .name }
105109
106- :party: There's a new { app .type } on the Rebble App Store!
110+ :party: There's { " a new" if is_new else "another cool" } { app .type } on the Rebble App Store!
107111
108112[quote=\" { app .developer .name } says\" ]
109113{ get_app_description (app )}
0 commit comments