diff --git a/app/DownloadQueue.py b/app/DownloadQueue.py index 486442a2..b974cf26 100644 --- a/app/DownloadQueue.py +++ b/app/DownloadQueue.py @@ -118,8 +118,7 @@ class DownloadQueue: except KeyError: pass - is_manifestless = 'post_live' == entry.get('live_status') if 'live_status' in entry else None - + is_manifestless = entry.get('is_manifestless', False) options.update({'is_manifestless': is_manifestless}) dl = ItemDTO( @@ -134,7 +133,7 @@ class DownloadQueue: output_template=output_template if output_template else self.config.output_template, datetime=formatdate(time.time()), error=error, - is_live=entry.get('is_live', None) or live_in is not None, + is_live=entry.get('is_live', None) or 'is_live' == entry.get('live_status', None) or live_in, live_in=live_in, options=options ) diff --git a/app/Webhooks.py b/app/Webhooks.py index 5228b459..2887f98c 100644 --- a/app/Webhooks.py +++ b/app/Webhooks.py @@ -52,12 +52,17 @@ class Webhooks: async with client.ClientSession() as session: headers = req.get('headers', {}) if 'headers' in req else {} async with session.request(method=req.get('method', 'POST'), url=req.get('url'), json=item.__dict__, headers=headers) as response: - LOG.info(f"[{target.get('name')}] Response to [{event=} {item.id=}] [status: {response.status}].") - return { + respData = { 'url': req.get('url'), 'status': response.status, 'text': await response.text() } + msg = f"[{target.get('name')}] Response to [{event=} {item.id=}] [status: {response.status}]." + if respData.get('text'): + msg += f" [Body: {respData.get('text','??')}]" + LOG.info(msg) + + return respData except Exception as e: return { 'url': req.get('url'), diff --git a/app/main.py b/app/main.py index 095eccb4..6e65f265 100644 --- a/app/main.py +++ b/app/main.py @@ -31,6 +31,7 @@ class Main: connection: sqlite3.Connection = None queue: DownloadQueue = None loop: asyncio.AbstractEventLoop = None + appLoader: str = None def __init__(self): self.config = Config.get_instance() @@ -349,10 +350,14 @@ class Main: @self.routes.get(self.config.url_prefix) async def index(_) -> Response: - return web.FileResponse(os.path.join( - os.path.dirname(os.path.dirname(os.path.realpath(__file__))), - 'frontend/dist/index.html' - )) + if not self.appLoader: + with open(os.path.join( + os.path.dirname(os.path.dirname(os.path.realpath(__file__))), + 'frontend/dist/index.html' + ), 'r') as f: + self.appLoader = f.read() + + return web.Response(text=self.appLoader, content_type='text/html', charset='utf-8', status=200) @self.sio.event() async def connect(sid, environ): diff --git a/frontend/src/components/Page-Completed.vue b/frontend/src/components/Page-Completed.vue index a13156fa..6c18559f 100644 --- a/frontend/src/components/Page-Completed.vue +++ b/frontend/src/components/Page-Completed.vue @@ -4,7 +4,7 @@ - Completed ({{ getTotal }}) + History ({{ getTotal }}) @@ -197,7 +197,7 @@ - No downloads records. + No records.