diff --git a/tubearchivist/api/views.py b/tubearchivist/api/views.py index 15fde1d6..357bd507 100644 --- a/tubearchivist/api/views.py +++ b/tubearchivist/api/views.py @@ -11,7 +11,7 @@ from home.src.index.channel import YoutubeChannel from home.src.index.generic import Pagination from home.src.index.reindex import ReindexProgress from home.src.index.video import SponsorBlock, YoutubeVideo -from home.src.ta.config import AppConfig +from home.src.ta.config import AppConfig, ReleaseVersion from home.src.ta.ta_redis import RedisArchivist from home.src.ta.task_manager import TaskCommand, TaskManager from home.src.ta.urlparser import Parser @@ -535,7 +535,11 @@ class PingView(ApiBaseView): @staticmethod def get(request): """get pong""" - data = {"response": "pong", "user": request.user.id} + data = { + "response": "pong", + "user": request.user.id, + "version": ReleaseVersion().get_local_version(), + } return Response(data) diff --git a/tubearchivist/home/src/ta/config.py b/tubearchivist/home/src/ta/config.py index f9b34742..671602cb 100644 --- a/tubearchivist/home/src/ta/config.py +++ b/tubearchivist/home/src/ta/config.py @@ -326,6 +326,10 @@ class ReleaseVersion: RedisArchivist().set_message(self.NEW_KEY, message) print(f"[{self.local_version}]: found new version {new_version}") + def get_local_version(self): + """read version from local""" + return self.local_version + def get_remote_version(self): """read version from remote""" self.response = requests.get(self.REMOTE_URL, timeout=20).json()