Skip to content

Commit

Permalink
add option add to skip manage scan. Fixes #28
Browse files Browse the repository at this point in the history
  • Loading branch information
clinton-hall committed Jul 2, 2016
1 parent abc6e4d commit e686891
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion couch.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ host = localhost
# The port for couchpotato
port = 5050
# Your API key here. See README for more information
api_key =
api_key = 44602ed6bd964709b493b8b6e280cd27
# Set to 'True' if you want to enable ssl connection (HTTPS)
ssl = False
# Your web root for couchpotato. Empty value is OK
Expand Down
17 changes: 15 additions & 2 deletions wanted.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,18 @@ def process(type, backup = None):
movie_list = json.load(f)
f.close()

for movie in movie_list:
# Add movies along with profile id (if not found or empty; default will be used)
if len(movie) == 1:
movie.append("")
api_call = "movie.add/?identifier=%s&profile_id=%s" %(movie[0], movie[1])
url = baseurl + api_call
result = apiCall(url)
elif type == "add":
with open(backup, 'r') as f:
movie_list = json.load(f)
f.close()

for movie in movie_list:
# Add movies along with profile id (if not found or empty; default will be used)
if len(movie) == 1:
Expand All @@ -169,10 +181,11 @@ def process(type, backup = None):
parser = argparse.ArgumentParser(description='Backup/Restore/Delete Couchpotato wanted list',
formatter_class=argparse.RawTextHelpFormatter)
# Require this option
parser.add_argument('--type', metavar='backup/restore/delete', choices=['backup', 'restore', 'delete'],
parser.add_argument('--type', metavar='backup/restore/delete/add', choices=['backup', 'restore', 'delete', 'add'],
required=True, help='''backup: Writes the wanted movies to file.
restore: Adds wanted movies from file.
delete: Delete all your wanted movies''')
delete: Delete all your wanted movies
add: Adds wanted movies from file skipping manage scan.''')
parser.add_argument('--file', help='', required=False)
parser.add_argument('--cfg', metavar='cfg-file', help='Specify an alternative cfg file')
args = parser.parse_args()
Expand Down

0 comments on commit e686891

Please sign in to comment.