Skip to content

Commit

Permalink
[!] Fix post migration changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
werwolfby committed Jul 26, 2015
1 parent 99c300d commit 67d7a8a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion plugins/trackers/lostfilm.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,11 @@ def check_connection(self):

def remove_watch(self, url):
with DBSession() as db:
return db.query(LostFilmTVSeries).filter(LostFilmTVSeries.url == url).delete()
topic = db.query(LostFilmTVSeries).filter(LostFilmTVSeries.url == url).first()
if topic is None:
return False
db.delete(topic)
return True

def get_watching_torrents(self):
with DBSession() as db:
Expand Down
8 changes: 6 additions & 2 deletions plugins/trackers/rutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,19 @@ def add_watch(self, url, display_name=None):
if not display_name:
display_name = title['original_name']
hash = self.tracker.get_hash(url)
entry = RutorOrgTopic(name=display_name, url=url, hash=hash)
entry = RutorOrgTopic(display_name=display_name, url=url, hash=hash)
with DBSession() as db:
db.add(entry)
db.commit()
return entry.id

def remove_watch(self, url):
with DBSession() as db:
return db.query(RutorOrgTopic).filter(RutorOrgTopic.url == url).delete()
topic = db.query(RutorOrgTopic).filter(RutorOrgTopic.url == url).first()
if topic is None:
return False
db.delete(topic)
return True

def get_watching_torrents(self):
with DBSession() as db:
Expand Down

0 comments on commit 67d7a8a

Please sign in to comment.