-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Shadow403
committed
Jan 5, 2025
1 parent
036f999
commit 033a49c
Showing
24 changed files
with
78 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from .main_router import MRouter | ||
from .v1.main_router import MRouter |
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
app/pusher/router/_get_info.py → app/pusher/router/v1/_get_info.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
app/pusher/router/main_router.py → app/pusher/router/v1/main_router.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from ._task_livestatus import live_status_inspectors | ||
from ._task_liveclear import live_clear_inspectors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from blivedm import logger | ||
|
||
from .utils import func_get_live_status | ||
|
||
from database.model import UIDS | ||
from database.connector import get_db_config_session | ||
|
||
|
||
def live_clear_inspectors(): | ||
with get_db_config_session() as config_db_session: | ||
uid_query_list = config_db_session.query(UIDS.uid).filter(UIDS.is_live == True).all() | ||
uid_list = [uid[0] for uid in uid_query_list] | ||
uid_dict = {"uids": uid_list} | ||
live_config = func_get_live_status(uid_dict, False) | ||
|
||
for x in live_config: | ||
uid = x["uid"] | ||
live_status_update = config_db_session.query(UIDS).filter(UIDS.uid == uid).first() | ||
live_status_update.is_live = False | ||
|
||
config_db_session.commit() | ||
logger.info(f"PREPARING LISTENING {uid}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,27 @@ | ||
from blivedm import logger | ||
|
||
from .api import api_query_live_status | ||
|
||
def func_get_live_status(uid_list): | ||
def func_get_live_status( | ||
uid_list: list = [], | ||
check_live_code: bool = True, | ||
): | ||
live_list = [] | ||
if check_live_code: | ||
live_status = 1 | ||
else: | ||
live_status = 0 | ||
|
||
ret_json = api_query_live_status(uid_list) | ||
if ret_json["code"] != 0: | ||
return live_list | ||
|
||
for x, c in ret_json["data"].items(): | ||
if c["live_status"] == 1: | ||
live_list.append(c) | ||
try: | ||
for x, c in ret_json["data"].items(): | ||
if c["live_status"] == live_status: | ||
live_list.append(c) | ||
except: | ||
# logger.error("UID错误 {}") | ||
return [] | ||
|
||
return live_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters