Browse Source

Removed all commented out db.close

pull/920/head
Ruud 13 years ago
parent
commit
269e98b049
  1. 3
      couchpotato/core/notifications/core/main.py
  2. 2
      couchpotato/core/plugins/file/main.py
  3. 1
      couchpotato/core/plugins/library/main.py
  4. 6
      couchpotato/core/plugins/profile/main.py
  5. 3
      couchpotato/core/plugins/quality/main.py
  6. 6
      couchpotato/core/plugins/release/main.py
  7. 1
      couchpotato/core/plugins/renamer/main.py
  8. 1
      couchpotato/core/plugins/scanner/main.py
  9. 3
      couchpotato/core/plugins/searcher/main.py
  10. 2
      couchpotato/core/plugins/subtitle/main.py
  11. 1
      couchpotato/core/providers/movie/_modifier/main.py
  12. 1
      couchpotato/core/providers/movie/couchpotatoapi/main.py
  13. 2
      couchpotato/core/settings/__init__.py

3
couchpotato/core/notifications/core/main.py

@ -79,7 +79,6 @@ class CoreNotifier(Notification):
q.update({Notif.read: True})
db.commit()
#db.close()
return jsonified({
'success': True
@ -107,7 +106,6 @@ class CoreNotifier(Notification):
ndict['type'] = 'notification'
notifications.append(ndict)
#db.close()
return jsonified({
'success': True,
'empty': len(notifications) == 0,
@ -133,7 +131,6 @@ class CoreNotifier(Notification):
self.frontend(type = listener, data = data)
#db.close()
return True
def frontend(self, type = 'notification', data = {}, message = None):

2
couchpotato/core/plugins/file/main.py

@ -109,7 +109,6 @@ class FileManager(Plugin):
db.commit()
type_dict = ft.to_dict()
#db.close()
return type_dict
def getTypes(self):
@ -122,5 +121,4 @@ class FileManager(Plugin):
for type_object in results:
types.append(type_object.to_dict())
#db.close()
return types

1
couchpotato/core/plugins/library/main.py

@ -53,7 +53,6 @@ class LibraryPlugin(Plugin):
library_dict = l.to_dict(self.default_dict)
#db.close()
return library_dict
def update(self, identifier, default_title = '', force = False):

6
couchpotato/core/plugins/profile/main.py

@ -47,7 +47,6 @@ class ProfilePlugin(Plugin):
for profile in profiles:
temp.append(profile.to_dict(self.to_dict))
#db.close()
return temp
def save(self):
@ -84,7 +83,6 @@ class ProfilePlugin(Plugin):
profile_dict = p.to_dict(self.to_dict)
#db.close()
return jsonified({
'success': True,
'profile': profile_dict
@ -95,7 +93,6 @@ class ProfilePlugin(Plugin):
db = get_session()
default = db.query(Profile).first()
default_dict = default.to_dict(self.to_dict)
#db.close()
return default_dict
@ -113,7 +110,6 @@ class ProfilePlugin(Plugin):
order += 1
db.commit()
#db.close()
return jsonified({
'success': True
@ -137,8 +133,6 @@ class ProfilePlugin(Plugin):
except Exception, e:
message = log.error('Failed deleting Profile: %s', e)
#db.close()
return jsonified({
'success': success,
'message': message

3
couchpotato/core/plugins/quality/main.py

@ -69,7 +69,6 @@ class QualityPlugin(Plugin):
q = mergeDicts(self.getQuality(quality.identifier), quality.to_dict())
temp.append(q)
#db.close()
return temp
def single(self, identifier = ''):
@ -81,7 +80,6 @@ class QualityPlugin(Plugin):
if quality:
quality_dict = dict(self.getQuality(quality.identifier), **quality.to_dict())
#db.close()
return quality_dict
def getQuality(self, identifier):
@ -101,7 +99,6 @@ class QualityPlugin(Plugin):
setattr(quality, params.get('value_type'), params.get('value'))
db.commit()
#db.close()
return jsonified({
'success': True
})

6
couchpotato/core/plugins/release/main.py

@ -88,8 +88,6 @@ class Release(Plugin):
fireEvent('movie.restatus', movie.id)
#db.close()
return True
@ -108,7 +106,6 @@ class Release(Plugin):
release_id = getParam('id')
#db.close()
return jsonified({
'success': self.delete(release_id)
})
@ -152,7 +149,6 @@ class Release(Plugin):
rel.status_id = available_status.get('id') if rel.status_id is ignored_status.get('id') else ignored_status.get('id')
db.commit()
#db.close()
return jsonified({
'success': True
})
@ -186,14 +182,12 @@ class Release(Plugin):
rel.status_id = status_snatched.get('id')
db.commit()
#db.close()
return jsonified({
'success': success
})
else:
log.error('Couldn\'t find release with id: %s', id)
#db.close()
return jsonified({
'success': False
})

1
couchpotato/core/plugins/renamer/main.py

@ -388,7 +388,6 @@ class Renamer(Plugin):
if self.shuttingDown():
break
#db.close()
self.renaming_started = False
def getRenameExtras(self, extra_type = '', replacements = {}, folder_name = '', file_name = '', destination = '', group = {}, current_file = ''):

1
couchpotato/core/plugins/scanner/main.py

@ -542,7 +542,6 @@ class Scanner(Plugin):
break
except:
pass
#db.close()
# Search based on OpenSubtitleHash
if not imdb_id and not group['is_dvd']:

3
couchpotato/core/plugins/searcher/main.py

@ -110,7 +110,6 @@ class Searcher(Plugin):
if self.shuttingDown():
break
#db.close()
self.in_progress = False
def single(self, movie):
@ -229,7 +228,6 @@ class Searcher(Plugin):
fireEvent('notify.frontend', type = 'searcher.ended.%s' % movie['id'], data = True)
#db.close()
return ret
def download(self, data, movie, manual = False):
@ -280,7 +278,6 @@ class Searcher(Plugin):
except Exception, e:
log.error('Failed marking movie finished: %s %s', (e, traceback.format_exc()))
#db.close()
return True
log.info('Tried to download, but none of the downloaders are enabled')

2
couchpotato/core/plugins/subtitle/main.py

@ -40,8 +40,6 @@ class Subtitle(Plugin):
# get subtitles for those files
subliminal.list_subtitles(files, cache_dir = Env.get('cache_dir'), multi = True, languages = self.getLanguages(), services = self.services)
#db.close()
def searchSingle(self, group):
if self.isDisabled(): return

1
couchpotato/core/providers/movie/_modifier/main.py

@ -70,7 +70,6 @@ class MovieResultModifier(Plugin):
except:
log.error('Tried getting more info on searched movies: %s', traceback.format_exc())
#db.close()
return temp
def checkLibrary(self, result):

1
couchpotato/core/providers/movie/couchpotatoapi/main.py

@ -94,7 +94,6 @@ class CouchPotatoApi(MovieProvider):
db = get_session()
active_movies = db.query(Movie).filter(Movie.status.has(identifier = 'active')).all()
movies = [x.library.identifier for x in active_movies]
#db.close()
suggestions = self.suggest(movies, ignore)

2
couchpotato/core/settings/__init__.py

@ -204,7 +204,6 @@ class Settings(object):
except:
pass
#db.close()
return prop
def setProperty(self, identifier, value = ''):
@ -221,4 +220,3 @@ class Settings(object):
p.value = toUnicode(value)
db.commit()
#db.close()

Loading…
Cancel
Save