Game Support: Show correct conf file name

This commit is contained in:
rubenwardy 2023-06-19 22:33:45 +01:00
parent bb41ea7dcc
commit c7ee42a4d5
2 changed files with 10 additions and 2 deletions

@ -765,6 +765,14 @@ class Package(db.Model):
review_scores = [ 100 * r.as_weight() for r in self.reviews ]
self.score = self.score_downloads + sum(review_scores)
def get_conf_file_name(self):
if self.type == PackageType.MOD:
return "mod.conf"
elif self.type == PackageType.TXP:
return "texture_pack.conf"
elif self.type == PackageType.GAME:
return "game.conf"
class MetaPackage(db.Model):
id = db.Column(db.Integer, primary_key=True)

@ -48,7 +48,7 @@
{% elif support.confidence == 11 %}
{{ _("Added by Editor") }}
{% elif support.confidence == 10 %}
{{ _("mod.conf") }}
{{ package.get_conf_file_name() }}
{% else %}
{{ support.confidence }}
{% endif %}
@ -72,7 +72,7 @@
</div>
{% if mod_conf_lines %}
<h3>{{ _("Generated mod.conf lines") }}</h3>
<h3>{{ _("Generated %(conf)s lines", conf=package.get_conf_file_name()) }}</h3>
<pre><code>{{ mod_conf_lines }}</code></pre>
{% endif %}