@route(MUSIC_PREFIX + '/service')
def GetChannels(serv):
    """This produces the list of channels for a given service."""

    # Set some preferences. It really makes life easier if they're set.
    AA.set_service(serv)
    AA.set_listenkey(Prefs['listen_key'])
    AA.set_streampref(Prefs['stream_pref_' + serv])
    AA.set_sourcepref(Prefs['source_pref'])

    oc = ObjectContainer(title1=AA.get_servicename(serv))

    fmt = AA.get_streamdetails()['codec']
    bitrate = AA.get_streamdetails()['bitrate']

    for channel in AA.get_batchinfo(refresh=True):
        # Use the handy internal Dict api to avoid re-generating the streamurl
        # over and over.
        if (not Dict in channel['key']) or (Prefs['force_refresh'] == True):
            Dict[channel['key']] = AA.get_streamurl(channel['key'])
            if Prefs['debug']:
                Log.Debug('saving %s' % Dict[channel['key']])

        oc.add(CreateChannelObject(
            url=Dict[channel['key']],
            title=channel['name'],
            summary=channel['description'],
            fmt=fmt,
            bitrate=bitrate,
            thumb='http:' + channel['asset_url']
        ))

    oc.objects.sort(key=lambda obj: obj.title)
    return oc
dataset/ETHPy150Open phrawzty/AudioAddict.bundle/Contents/Code/__init__.py/GetChannels/swapped operands of `in`