1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-12-25 14:47:29 +00:00

Merge branch 'dev'

This commit is contained in:
Myned 2020-04-16 18:39:40 -04:00
commit dc866d1564
No known key found for this signature in database
GPG key ID: 24318A323F309244
2 changed files with 7 additions and 5 deletions

View file

@ -728,8 +728,10 @@ class MsG(cmds.Cog):
except exc.Continue: except exc.Continue:
continue continue
if post['id'] not in posts.keys() and post['id'] not in previous.keys(): if post['id'] not in posts.keys() and post['id'] not in previous.keys():
posts[post['id']] = {'artist': ', '.join( posts[post['id']] = {
post['tags']['artist']), 'file_url': post['file']['url'], 'score': post['score']['total']} 'artist': ', '.join(post['tags']['artist']) if post['tags']['artist'] else 'unknown',
'file_url': post['file']['url'],
'score': post['score']['total']}
if len(posts) == limit: if len(posts) == limit:
break break

View file

@ -59,7 +59,7 @@ async def query_kheina(url):
result = { result = {
'source': content['results'][0]['sources'][0]['source'], 'source': content['results'][0]['sources'][0]['source'],
'artist': content['results'][0]['sources'][0]['artist'], 'artist': content['results'][0]['sources'][0]['artist'] if content['results'][0]['sources'][0]['artist'] else 'unknown',
'thumbnail': thumbnail, 'thumbnail': thumbnail,
'similarity': str(similarity), 'similarity': str(similarity),
'database': tld.extract(content['results'][0]['sources'][0]['source']).domain 'database': tld.extract(content['results'][0]['sources'][0]['source']).domain
@ -99,12 +99,12 @@ async def query_saucenao(url):
source = e source = e
break break
artist = 'Unknown' artist = 'unknown'
for e in ( for e in (
'author_name', 'author_name',
'member_name', 'member_name',
'creator'): 'creator'):
if e in match['data']: if e in match['data'] and match['data'][e]:
artist = match['data'][e] artist = match['data'][e]
break break