Added “getReadList” command to API

This commit is contained in:
Roberto Pastor 2016-12-20 08:54:06 +01:00 committed by evilhero
parent d1c5fa63fa
commit d2fd39471a
1 changed files with 11 additions and 4 deletions

View File

@ -27,10 +27,13 @@ import imghdr
from operator import itemgetter
from cherrypy.lib.static import serve_file, serve_download
cmd_list = ['getIndex', 'getComic', 'getUpcoming', 'getWanted', 'getHistory', 'getLogs', 'clearLogs',
'findComic', 'addComic', 'delComic', 'pauseComic', 'resumeComic', 'refreshComic',
'addIssue', 'queueIssue', 'unqueueIssue', 'forceSearch', 'forceProcess', 'getVersion', 'checkGithub',
'shutdown', 'restart', 'update', 'getComicInfo', 'getIssueInfo', 'getArt', 'downloadIssue', 'downloadNZB']
cmd_list = ['getIndex', 'getComic', 'getUpcoming', 'getWanted', 'getHistory',
'getLogs', 'clearLogs','findComic', 'addComic', 'delComic',
'pauseComic', 'resumeComic', 'refreshComic', 'addIssue',
'queueIssue', 'unqueueIssue', 'forceSearch', 'forceProcess',
'getVersion', 'checkGithub','shutdown', 'restart', 'update',
'getComicInfo', 'getIssueInfo', 'getArt', 'downloadIssue',
'downloadNZB', 'getReadList']
class Api(object):
@ -143,6 +146,10 @@ class Api(object):
self.data = self._dic_from_query('SELECT * from comics order by ComicSortName COLLATE NOCASE')
return
def _getReadList(self, **kwargs):
self.data = self._dic_from_query('SELECT * from readlist order by IssueDate ASC')
return
def _getComic(self, **kwargs):
if 'id' not in kwargs:
self.data = self._error_with_message('Missing parameter: id')