From 30f9ffeef17eca38831cbac3cbf422b73ad458e6 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Thu, 27 Dec 2012 23:29:26 +0100 Subject: Check title, artist and album in Track.get(). --- db.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3