Skip to content

Commit

Permalink
fixed bug with usb not listing files
Browse files Browse the repository at this point in the history
  • Loading branch information
blawar committed Oct 7, 2019
1 parent d86ac70 commit d94f355
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions Server/Controller/Api.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,21 @@ def getUser(request, response):
response.write(json.dumps(request.user.__dict__))

def getSearch(request, response):
o = []

region = request.query.get('region')
publisher = request.query.get('publisher')

dlc = request.query.get('dlc')
if dlc:
dlc = int(dlc[0])

update = request.query.get('update')
if update:
update = int(update[0])

demo = request.query.get('demo')
if demo:
demo = int(demo[0])
nsp = []
nsx = []
nsz = []

for path, f in Nsps.files.items():
o.append({'id': f.titleId, 'name': f.fileName(), 'version': int(f.version) if f.version else None })
response.write(json.dumps(o.reverse()))
name = f.fileName()
if name.endswith('.nsp'):
nsp.append({'id': f.titleId, 'name': f.fileName(), 'version': int(f.version) if f.version else None })
elif name.endswith('.nsz'):
nsz.append({'id': f.titleId, 'name': f.fileName(), 'version': int(f.version) if f.version else None })
elif name.endswith('.nsx'):
nsx.append({'id': f.titleId, 'name': f.fileName(), 'version': int(f.version) if f.version else None })

o = nsz + nsp + nsx
response.write(json.dumps(o))

def getTitles(request, response):
o = []
Expand Down

0 comments on commit d94f355

Please sign in to comment.