Updated DLC code to use list file

This commit is contained in:
polaris 2014-05-07 17:40:25 -04:00
parent 624514a69d
commit 45af5c1222
8 changed files with 8 additions and 8 deletions

1
dlc/A5FE/_list.txt Normal file
View File

@ -0,0 +1 @@
wifi_encode26.dat MgA2AE9V7l1XMP9mSDA* 116

2
dlc/B2KJ/_list.txt Normal file
View File

@ -0,0 +1,2 @@
distribution110609.bin 24
tweet111209.bin 2416

Binary file not shown.

BIN
dlc/B2KJ/tweet111209.bin Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +0,0 @@
ô Î<>Ÿô¦'O÷Ò~> çDÌs•ì­ˆ)ÕÝŸÃ4m/“}b¸©´åÔ±S— ÷®­,šítydÛf2t¥šyävVx!Ö¦Ÿ€ ãÔÆà-Äè4i¸ëñIµûn¶œoÉK¤<4B>!(ÀõWÚ0êxá7õ‡]ùd$<FFWÓZçýläk½ð2Ôa^!

View File

@ -93,7 +93,7 @@ class NintendoNasHTTPServerHandler(BaseHTTPServer.BaseHTTPRequestHandler):
# TODO: Cache all DLC information in a database instead of querying the folder.
ret = ""
dlcpath = "dlc/" + post["rhgamecd"]
dlcpath = "dlc/" + post["gamecd"]
dlc_contenttype = False
if action == "count":
@ -109,12 +109,10 @@ class NintendoNasHTTPServerHandler(BaseHTTPServer.BaseHTTPRequestHandler):
offset = int(post["offset"])
if os.path.exists(dlcpath):
filelist = os.listdir(dlcpath)
if offset + num <= len(filelist):
for file in filelist[offset:offset+num]:
filesize = os.path.getsize(dlcpath + "/" + file)
ret += "%s\t\t\t\t%d\r\n" % (file, filesize)
# Look for a list file first.
# If the list file exists, send the entire thing back to the client.
if os.path.isfile(dlcpath + "/_list.txt"):
ret = open(dlcpath + "/_list.txt", "rb").read()
if action == "contents":
# Get only the base filename just in case there is a path involved somewhere in the filename string.