Exemplo n.º 1
0
def artist(bot, update, groups, lang):
    if groups[1] == 'ps':
        return voca_db.songs('', lang, artist_id=groups[2]), None
    elif groups[1] == 'ls':
        return voca_db.songs('', lang, artist_id=groups[2], sort='AdditionDate'), None
    elif groups[1] == 'pa':
        return voca_db.albums('', lang, artist_id=groups[2], sort='RatingAverage'), None
    elif groups[1] == 'la':
        return voca_db.albums('', lang, artist_id=groups[2], sort='ReleaseDate'), None
Exemplo n.º 2
0
def song_search(bot, update, groups, lang):
    switch_pm = (_('Searching only songs'), 'help_inline')
    originals_only = get_setting('originals', bot, update)
    return voca_db.songs(groups[0],
                         lang,
                         max_results=MAX_INLINE_RESULTS,
                         originals_only=originals_only), switch_pm
Exemplo n.º 3
0
def artist(bot, update, groups, lang):
    if groups[1] == 'ps':
        return voca_db.songs('', lang, artist_id=groups[2]), None
    elif groups[1] == 'ls':
        return voca_db.songs('',
                             lang,
                             artist_id=groups[2],
                             sort='AdditionDate'), None
    elif groups[1] == 'pa':
        return voca_db.albums('',
                              lang,
                              artist_id=groups[2],
                              sort='RatingAverage'), None
    elif groups[1] == 'la':
        return voca_db.albums('',
                              lang,
                              artist_id=groups[2],
                              sort='ReleaseDate'), None
Exemplo n.º 4
0
def search(bot, update, args, lang, songs=False, artists=False, albums=False, state=None):
    query = args if type(args) == str else ' '.join(args)
    if songs and artists and albums:
        entries = voca_db.entries(query, lang)
    elif songs:
        originals_only = get_setting('originals', bot, update)
        entries = voca_db.songs(query, lang, originals_only=originals_only)
    elif artists:
        entries = voca_db.artists(query, lang)
    elif albums:
        entries = voca_db.albums(query, lang)
    else:
        return None, None
    return entries, state
Exemplo n.º 5
0
def search(bot,
           update,
           args,
           lang,
           songs=False,
           artists=False,
           albums=False,
           state=None):
    query = args if type(args) == str else ' '.join(args)
    if songs and artists and albums:
        entries = voca_db.entries(query, lang)
    elif songs:
        originals_only = get_setting('originals', bot, update)
        entries = voca_db.songs(query, lang, originals_only=originals_only)
    elif artists:
        entries = voca_db.artists(query, lang)
    elif albums:
        entries = voca_db.albums(query, lang)
    else:
        return None, None
    return entries, state
Exemplo n.º 6
0
def song_search(bot, update, groups, lang):
    switch_pm = (_('Searching only songs'), 'help_inline')
    originals_only = get_setting('originals', bot, update)
    return voca_db.songs(groups[0], lang, max_results=MAX_INLINE_RESULTS, originals_only=originals_only), switch_pm
Exemplo n.º 7
0
def top(bot, update, lang):
    return voca_db.songs('', lang, max_results=MAX_INLINE_RESULTS), None
Exemplo n.º 8
0
def new(bot, update, lang):
    return voca_db.songs('', lang, sort='AdditionDate'), None
Exemplo n.º 9
0
def top(bot, update, lang):
    return voca_db.songs('', lang), None
Exemplo n.º 10
0
def new(bot, update, lang):
    return voca_db.songs('', lang, sort='AdditionDate'), None
Exemplo n.º 11
0
def top(bot, update, lang):
    return voca_db.songs('', lang), None
Exemplo n.º 12
0
def top(bot, update, lang):
    return voca_db.songs('', lang, max_results=MAX_INLINE_RESULTS), None