1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-11-01 13:02:38 +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:
continue
if post['id'] not in posts.keys() and post['id'] not in previous.keys():
posts[post['id']] = {'artist': ', '.join(
post['tags']['artist']), 'file_url': post['file']['url'], 'score': post['score']['total']}
posts[post['id']] = {
'artist': ', '.join(post['tags']['artist']) if post['tags']['artist'] else 'unknown',
'file_url': post['file']['url'],
'score': post['score']['total']}
if len(posts) == limit:
break

View file

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