From 163ed5bc7567f933ac1e64ae465c07d7b0ab3ce9 Mon Sep 17 00:00:00 2001 From: Ruud Date: Mon, 16 Apr 2012 00:21:08 +0200 Subject: [PATCH] Restatus, even when no profile is set --- couchpotato/core/plugins/movie/main.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/couchpotato/core/plugins/movie/main.py b/couchpotato/core/plugins/movie/main.py index 073e2fc7..50042453 100644 --- a/couchpotato/core/plugins/movie/main.py +++ b/couchpotato/core/plugins/movie/main.py @@ -379,18 +379,17 @@ class MoviePlugin(Plugin): m = db.query(Movie).filter_by(id = movie_id).first() - if not m.profile: - return - log.debug('Changing status for %s' % (m.library.titles[0].title)) + if not m.profile: + m.status_id = done_status.get('id') + else: + move_to_wanted = True - move_to_wanted = True + for t in m.profile.types: + for release in m.releases: + if t.quality.identifier is release.quality.identifier and (release.status_id is done_status.get('id') and t.finish): + move_to_wanted = False - for t in m.profile.types: - for release in m.releases: - if t.quality.identifier is release.quality.identifier and (release.status_id is done_status.get('id') and t.finish): - move_to_wanted = False - - m.status_id = active_status.get('id') if move_to_wanted else done_status.get('id') + m.status_id = active_status.get('id') if move_to_wanted else done_status.get('id') db.commit()