summaryrefslogtreecommitdiff
path: root/db.py
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2012-12-27 23:29:26 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2012-12-27 23:29:26 +0100
commit30f9ffeef17eca38831cbac3cbf422b73ad458e6 (patch)
tree230c8a61b7194b812fbe2964d775896d021048fc /db.py
parent342d0cbd14cc33e8ee86b783c53e7001c41fb94c (diff)
Check title, artist and album in Track.get().HEADmaster
Diffstat (limited to 'db.py')
-rw-r--r--db.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/db.py b/db.py
index d7f1690..6caba36 100644
--- a/db.py
+++ b/db.py
@@ -153,7 +153,8 @@ class Track(Base):
@staticmethod
def get(session, name, num, filename, file_index, directory_id, artist_id, album_id):
try:
- track = session.query(Track).filter(and_(Track.filename == filename, Track.file_index == file_index)).one()
+ track = session.query(Track).filter(and_(Track.name == name, Track.filename == filename, Track.file_index == file_index,
+ Track.artist_id == artist_id, Track.album_id == album_id)).one()
except NoResultFound:
track = Track(name, num, filename, file_index, directory_id, artist_id, album_id)
session.add(track)