Skip to content

Commit

Permalink
Expose album field when .tags is called from IRC
Browse files Browse the repository at this point in the history
  • Loading branch information
Wessie committed Oct 4, 2014
1 parent 0b64f87 commit fce6be9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bot/hanyuu_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,18 +662,18 @@ def tags(server, nick, channel, text, hostmask):
message = u'Invalid ID'
else:
with manager.MySQLNormalCursor() as cur:
cur.execute("SELECT tags,album FROM tracks WHERE id=%s", (song.id,))
for tags, in cur:
cur.execute("SELECT tags, album FROM tracks WHERE id=%s", (song.id,))
for tags, album in cur:
break
else:
tags = "no search tags"
row = cur.fetchone()
album=row['album']
album = ""

message = (u"{c}Title: {c4}{title} {c}Album: {c4}{album} {c}Faves: {c4}{faves}"
u" {c}Plays: {c4}{plays} {c}Tags: {c4}{tags}")
message = message.format(
title=song.metadata,
album=album,
faves=song.favecount,
plays=song.playcount,
tags=tags, **irc_colours
Expand Down

0 comments on commit fce6be9

Please sign in to comment.