Skip to content

Commit

Permalink
webapp update
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximilian Köhl committed May 26, 2012
1 parent 715f339 commit 579601e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/webapp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from pyweb.core.application import Application
from pyweb.handlers.directory import Directory

from grooveshark.core.client import Client, SEARCH_TYPE_SONGS, SEARCH_TYPE_ALBUMS, SEARCH_TYPE_ARTISTS
from grooveshark import Client
from grooveshark.classes.song import Song

class Cache():
Expand Down Expand Up @@ -124,9 +124,9 @@ def search(self, request, response):
if not 'type' in request.query:
request.qery['type'] = [SEARCH_TYPE_SONGS]
if 'query' in request.query:
if not request.query['type'][0] in (SEARCH_TYPE_SONGS,
SEARCH_TYPE_ALBUMS,
SEARCH_TYPE_ARTISTS):
if not request.query['type'][0] in (Client.SONGS,
Client.ALBUMS,
Client.ARTISTS):
self._bad_request('unknown type', response)
else:
result = [object.export() for object in self.client.search(request.query['query'][0], request.query['type'][0])]
Expand Down

0 comments on commit 579601e

Please sign in to comment.