Skip to content

Commit

Permalink
fix formatting error in sql commands
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-klein committed Jun 4, 2018
1 parent 25d7bf1 commit 9630804
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions resources/lib/database_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DB_Handler(object):
SQLite connection is closed when object is deleted.
'''
#TODO: reimplement blocked keywords
#TODO: use **kwargs to dynamically add constraints
#TODO: combine remove_content_item functions using **kwargs

def __init__(self):
# connect to database
Expand Down Expand Up @@ -50,17 +50,17 @@ def get_content_items(self, **kwargs):
and casts results as ContentItem subclass
keyword arguments:
mediatype = string, 'movie' or 'tvshow'
status = string, 'managed' or 'staged'
show_title = string, any show title
order= string, any single column
mediatype: string, 'movie' or 'tvshow'
status: string, 'managed' or 'staged'
show_title: string, any show title
order: string, any single column
'''
# define template for this sql command
sql_templ = "SELECT * FROM Content{c}{o}"
# define constraint and/or order string usings kwargs
c_list = []
params = ()
o = ''
params = tuple()
for k, v in kwargs.iteritems():
if k == 'status':
c_list.append('Status=?')
Expand Down Expand Up @@ -119,7 +119,7 @@ def path_exists(self, path, status=None):
sql_comm = 'SELECT (Directory) FROM Content WHERE Directory=?'
params = (path,)
if status:
sql_comm += 'AND Status=?'
sql_comm += ' AND Status=?'
params += (status,)
self.c.execute(sql_comm, params)
# get result and return True if result is found
Expand Down

0 comments on commit 9630804

Please sign in to comment.