Ejemplo n.º 1
0
def addto_playlist( udb, scuid, nwords):
    songs = systemdb.mquery( {'nwords':nwords, 'stype':'mv'})
    snolist=[s['sno'] for s in songs[:10]]
    # a shelve db can't deliberately update like a dict, we need to
    # convert it to a dict and update by shelve.update()
    udic=dict(udb)
    udic[scuid]['playlist']=snolist
    udb.update( udic)

    print 'add {0} to user {1}'.format( snolist, scuid)
    udb.sync()
Ejemplo n.º 2
0
 def func( self, d):
     songs = systemdb.mquery( { 'lang':6})
     return { 'rtype':'song', 'rdata':songs}
Ejemplo n.º 3
0
 def func( self, d):
     songs = systemdb.mquery( { 'lang':5, 'nwords': d+1})
     return { 'rtype':'song', 'rdata':songs}