rename buscribe-api to buscribe_api

to match other services that use _ instead of -
pull/414/head
Mike Lang 3 weeks ago
parent 834d27c17d
commit b16ceef96a

@ -14,7 +14,7 @@ cd "$(dirname "$(realpath "$0")")"
COMPONENTS=( COMPONENTS=(
backfiller backfiller
buscribe buscribe
buscribe-api buscribe_api
chat_archiver chat_archiver
cutter cutter
downloader downloader

@ -27,7 +27,7 @@ function query(text, start_time, end_time) {
const channel = document.getElementById("channel_select").value; const channel = document.getElementById("channel_select").value;
fetch(`/buscribe-api/${channel}/json?${query_string}`) fetch(`/buscribe_api/${channel}/json?${query_string}`)
.then(response => response.json()) .then(response => response.json())
.then(fillResults) .then(fillResults)

@ -12,8 +12,8 @@ RUN pip install /tmp/common && rm -r /tmp/common
# Install actual application # Install actual application
RUN apk add postgresql-dev postgresql-libs RUN apk add postgresql-dev postgresql-libs
COPY buscribe-api /tmp/buscribe-api COPY buscribe_api /tmp/buscribe_api
RUN pip install /tmp/buscribe-api && cp -r /tmp/buscribe-api/templates /templates \ RUN pip install /tmp/buscribe_api && cp -r /tmp/buscribe_api/templates /templates \
&& rm -r /tmp/buscribe-api && rm -r /tmp/buscribe_api
ENTRYPOINT ["python3", "-m", "buscribeapi", "--base-dir", "/mnt"] ENTRYPOINT ["python3", "-m", "buscribeapi"]

@ -7,8 +7,9 @@ from flask import request, jsonify
app = flask.Flask('buscribe') app = flask.Flask('buscribe')
@app.route('/buscribe-api/json') # WARNING: Channel is currently ignored. Multi-channel support will come later.
def get_json(): @app.route('/buscribe_api/<channel>/json')
def get_json(channel):
"""Searches the line database for *query*, with optional start_time and end_time boundaries. """Searches the line database for *query*, with optional start_time and end_time boundaries.
Search is done using PostgreSQL websearch_to_tsquery() Search is done using PostgreSQL websearch_to_tsquery()

@ -59,7 +59,7 @@ def main(database="", host='0.0.0.0', port=8010, bustime_start=None):
logging.error("Invalid --bustime-start!") logging.error("Invalid --bustime-start!")
exit(1) exit(1)
app.db_manager = DBManager(dsn=database) app.db_manager = DBManager(dsn=database, register_types=False)
stopping = gevent.event.Event() stopping = gevent.event.Event()
Loading…
Cancel
Save