Better cleaning again
This commit is contained in:
parent
fcabf365b3
commit
ca8e92f2d9
@ -73,14 +73,13 @@ updates = drive_list("nsz/updates")
|
|||||||
print("Updates OK")
|
print("Updates OK")
|
||||||
|
|
||||||
|
|
||||||
def get_title_fullid(name):
|
def get_title_shortid(name):
|
||||||
re_id = re.search(r"\[([0-9A-F]*)\]", name)
|
re_id = re.search(r"\[([0-9A-F]*)\]", name)
|
||||||
|
|
||||||
return re_id.group(1) if re_id else None
|
if not re_id:
|
||||||
|
return
|
||||||
|
|
||||||
|
id = re_id.group(1)
|
||||||
def get_title_shortid(name):
|
|
||||||
id = get_title_fullid(name)
|
|
||||||
|
|
||||||
return id[0:-4] if id in titles else None
|
return id[0:-4] if id in titles else None
|
||||||
|
|
||||||
@ -101,27 +100,25 @@ except subprocess.CalledProcessError:
|
|||||||
|
|
||||||
|
|
||||||
for base in bases:
|
for base in bases:
|
||||||
shortid = get_title_shortid(base)
|
id = get_title_shortid(base)
|
||||||
|
|
||||||
if shortid:
|
if id:
|
||||||
download("nsz/base", base)
|
download("nsz/base", base)
|
||||||
|
|
||||||
for dlc in dlcs:
|
for dlc in dlcs:
|
||||||
if shortid in dlc:
|
if id in dlc:
|
||||||
download("nsz/dlc", dlc)
|
download("nsz/dlc", dlc)
|
||||||
|
|
||||||
for update in updates:
|
for update in updates:
|
||||||
if shortid in update:
|
if id in update:
|
||||||
download("nsz/updates", update)
|
download("nsz/updates", update)
|
||||||
else:
|
else:
|
||||||
remove("nsz/base", base)
|
remove("nsz/base", base)
|
||||||
|
|
||||||
fullid = get_title_fullid(base)
|
|
||||||
|
|
||||||
for dlc in dlcs:
|
for dlc in dlcs:
|
||||||
if fullid in dlc:
|
if id in dlc:
|
||||||
remove("nsz/dlc", dlc)
|
remove("nsz/dlc", dlc)
|
||||||
|
|
||||||
for update in updates:
|
for update in updates:
|
||||||
if fullid in update:
|
if id in update:
|
||||||
remove("nsz/updates", update)
|
remove("nsz/updates", update)
|
||||||
|
Loading…
Reference in New Issue
Block a user