diff --git a/app/src/DTO/ItemDTO.py b/app/src/DTO/ItemDTO.py index c80a5f64..45aecca4 100644 --- a/app/src/DTO/ItemDTO.py +++ b/app/src/DTO/ItemDTO.py @@ -21,6 +21,7 @@ class ItemDTO: output_template: str = None timestamp: float = time.time_ns() is_live: bool = None + datetime: str = None # yt-dlp injected fields. tmpfilename: str = None diff --git a/app/src/DataStore.py b/app/src/DataStore.py index b6b17d68..32815768 100644 --- a/app/src/DataStore.py +++ b/app/src/DataStore.py @@ -1,4 +1,5 @@ from collections import OrderedDict +from datetime import datetime import json import sqlite3 from src.Utils import calcDownloadPath @@ -58,6 +59,10 @@ class DataStore: key: str = data.pop('_id') item: ItemDTO = ItemDTO(**data) item._id = key + if not item.datetime: + item.datetime = datetime.fromtimestamp(item.timestamp / 1_000_000_000).strftime( + '%Y-%m-%dT%H:%M:%SZ') + items.append((row['id'], item)) return items diff --git a/app/src/DownloadQueue.py b/app/src/DownloadQueue.py index 126fe911..0b0fec26 100644 --- a/app/src/DownloadQueue.py +++ b/app/src/DownloadQueue.py @@ -104,6 +104,7 @@ class DownloadQueue: ytdlp_config=ytdlp_config, output_template=output_template if output_template else self.config.output_template, error=error, + datetime=datetime.now(timezone.utc).strftime('%Y-%m-%d %H:%M:%S %z'), is_live=entry['is_live'] if 'is_live' in entry else None, ) diff --git a/frontend/src/components/Page-Completed.vue b/frontend/src/components/Page-Completed.vue index 691b30f3..21f20874 100644 --- a/frontend/src/components/Page-Completed.vue +++ b/frontend/src/components/Page-Completed.vue @@ -85,8 +85,9 @@
- - {{ moment(item.timestamp / 1000000).fromNow() }} + + {{ moment(item.datetime).fromNow() }}
@@ -110,7 +111,8 @@
- + diff --git a/frontend/src/components/Page-Downloading.vue b/frontend/src/components/Page-Downloading.vue index c76e6b38..fec735ea 100644 --- a/frontend/src/components/Page-Downloading.vue +++ b/frontend/src/components/Page-Downloading.vue @@ -53,8 +53,9 @@
- - {{ moment(item.timestamp / 1000000).fromNow() }} + + {{ moment(item.datetime).fromNow() }}