mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-02-13 09:31:50 +08:00
update to API to include movies
This commit is contained in:
parent
850fb666b6
commit
26ac122548
1 changed files with 18 additions and 2 deletions
20
bazarr.py
20
bazarr.py
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue