diff options
author | morpheus65535 <[email protected]> | 2018-09-13 07:28:15 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2018-09-13 07:28:15 -0400 |
commit | 26ac122548862fb47b16f58d8b8a36322c09f607 (patch) | |
tree | f18cd965d137a8e320543cdf744a4ae9c9f62b58 /bazarr.py | |
parent | 850fb666b6e6d806709dfc3c3d96466320bdaee0 (diff) | |
download | bazarr-26ac122548862fb47b16f58d8b8a36322c09f607.tar.gz bazarr-26ac122548862fb47b16f58d8b8a36322c09f607.zip |
update to API to include movies
Diffstat (limited to 'bazarr.py')
-rw-r--r-- | bazarr.py | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -1677,7 +1677,7 @@ def configured(): conn.commit() c.close() -@route(base_url + 'api/wanted') +@route(base_url + 'api/series/wanted') def api_wanted(): db = sqlite3.connect(os.path.join(config_dir, 'db/bazarr.db'), timeout=30) c = db.cursor() @@ -1685,7 +1685,7 @@ def api_wanted(): c.close() return dict(subtitles=data) -@route(base_url + 'api/history') +@route(base_url + 'api/series/history') def api_history(): db = sqlite3.connect(os.path.join(config_dir, 'db/bazarr.db'), timeout=30) c = db.cursor() @@ -1693,6 +1693,22 @@ def api_history(): c.close() return dict(subtitles=data) +@route(base_url + 'api/movies/wanted') +def api_wanted(): + db = sqlite3.connect(os.path.join(config_dir, 'db/bazarr.db'), timeout=30) + c = db.cursor() + data = c.execute("SELECT table_movies.title, table_movies.missing_subtitles FROM table_movies WHERE table_movies.missing_subtitles != '[]' ORDER BY table_movies._rowid_ DESC").fetchall() + c.close() + return dict(subtitles=data) + +@route(base_url + 'api/movies/history') +def api_history(): + db = sqlite3.connect(os.path.join(config_dir, 'db/bazarr.db'), timeout=30) + c = db.cursor() + data = c.execute("SELECT table_movies.title, strftime('%Y-%m-%d', datetime(table_history_movie.timestamp, 'unixepoch')), table_history_movie.description FROM table_history_movie INNER JOIN table_movies on table_movies.radarrId = table_history_movie.radarrId WHERE table_history_movie.action = '1' ORDER BY id DESC").fetchall() + c.close() + return dict(subtitles=data) + @route(base_url + 'test_url/<protocol>/<url:path>', method='GET') @custom_auth_basic(check_credentials) def test_url(protocol, url): |