This commit is contained in:
smiRaphi 2025-01-25 22:39:11 +01:00 committed by GitHub
commit 7567819b32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -587,7 +587,7 @@ def cdn2cia(path, out='', title_ver='', cdn_dev=0, cia_dev=0):
tmd = ''
tik = ''
for i in os.listdir('.'):
if i.startswith('tmd.'):
if i.startswith('tmd.') or i == 'tmd':
tmds.append(i)
elif i == 'cetk':
tik = i
@ -597,7 +597,7 @@ def cdn2cia(path, out='', title_ver='', cdn_dev=0, cia_dev=0):
if len(tmds) == 1: # If only one tmd in CDN dir, use it
tmd = tmds[0]
else:
tmds.sort(key=lambda h: int(h.split('.')[1]))
tmds.sort(key=lambda h: int(os.path.splitext(h)[1].strip('.') or 0))
if title_ver == '': # If title version not provided, use latest one
tmd = tmds[-1]
else: