Add support for un/"supported_games" in mod.conf

This commit is contained in:
rubenwardy
2022-06-24 23:55:44 +01:00
parent f22911b4a0
commit d6887d7b46
4 changed files with 43 additions and 14 deletions

View File

@@ -507,8 +507,8 @@ class Package(db.Model):
return self.getSortedDependencies(False)
def getSortedSupportedGames(self):
supported = self.supported_games.all()
supported.sort(key=lambda x: -x.game.score)
supported = self.supported_games.filter_by(supports=True).all()
supported.sort(key=lambda x: -(x.game.score + 100000*x.confidence))
return supported
def getAsDictionaryKey(self):