mirror of
https://github.com/lutris/lutris
synced 2024-09-18 15:22:27 +00:00
Add pcsxr deprecation migration
This commit is contained in:
parent
d8c0e38bd1
commit
03baefc04b
|
@ -2,7 +2,7 @@ import importlib
|
|||
from lutris import settings
|
||||
from lutris.util.log import logger
|
||||
|
||||
MIGRATION_VERSION = 3
|
||||
MIGRATION_VERSION = 4
|
||||
|
||||
MIGRATIONS = []
|
||||
|
||||
|
@ -19,6 +19,10 @@ MIGRATIONS.append([
|
|||
'update_runners',
|
||||
])
|
||||
|
||||
MIGRATIONS.append([
|
||||
'pcsxr_deprecation'
|
||||
])
|
||||
|
||||
|
||||
def get_migration_module(migration_name):
|
||||
return importlib.import_module('lutris.migrations.%s' % migration_name)
|
||||
|
|
17
lutris/migrations/pcsxr_deprecation.py
Normal file
17
lutris/migrations/pcsxr_deprecation.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
from lutris.pga import sql, PGA_DB
|
||||
from lutris.game import Game
|
||||
|
||||
|
||||
def migrate():
|
||||
pcsxr_game_ids = sql.db_query(PGA_DB, "select id from games where runner='pcsxr'")
|
||||
for game_id in pcsxr_game_ids:
|
||||
game = Game(game_id['id'])
|
||||
main_file = game.config.raw_game_config.get('iso')
|
||||
game.config.game_level = {
|
||||
'game': {
|
||||
'core': 'pcsx_rearmed',
|
||||
'main_file': main_file
|
||||
}
|
||||
}
|
||||
game.config.save()
|
||||
sql.db_update(PGA_DB, 'games', {'runner': 'libretro'}, where=('runner', 'pcsxr'))
|
Loading…
Reference in a new issue