Skip to content

Commit

Permalink
add translation db for games that have a broken name in system.cnf
Browse files Browse the repository at this point in the history
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
  • Loading branch information
sahlberg committed Jul 17, 2023
1 parent c1c52fd commit 501b0db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions gamedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -58620,6 +58620,11 @@
},
}

gameid_translation = {
'SLPS0208': {
'id': 'SLPS00208'
}
}

libcrypt = {
'SCES00311': {'magic_word': 34730, 'url': 'http://redump.org/disc/592/'},
Expand Down
7 changes: 5 additions & 2 deletions pop-fe.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
from pathlib import Path
from bchunk import bchunk
from document import create_document
from gamedb import games, libcrypt, themes
from gamedb import games, libcrypt, themes, gameid_translation
try:
from make_isoedat import pack
except:
Expand Down Expand Up @@ -134,6 +134,9 @@ def get_gameid_from_iso(path='NORMAL01.iso'):
buf = buf.replace(i, "")

game_id = buf.upper()
# Special handling of games with broken id in system.cnf
if game_id in gameid_translation:
game_id = gameid_translation[game_id]['id']
return game_id


Expand Down Expand Up @@ -1780,7 +1783,7 @@ def create_manual(source, gameid, subdir='./pop-fe-work/'):
try:
tmpfile = subdir + '/DOCUMENT-' + source.split('/')[-1]
temp_files.append(tmpfile)
subprocess.run(['wget', source, '-O', tmpfile], timeout=120, check=True)
subprocess.run(['wget', source, '-O', tmpfile], timeout=240, check=True)
print('Downloaded manual as', tmpfile)
source = tmpfile
except:
Expand Down

0 comments on commit 501b0db

Please sign in to comment.