diff --git a/nonebot_plugin_acgnshow/acgnapis.py b/nonebot_plugin_acgnshow/acgnapis.py
index 6c134b7..6039ee2 100644
--- a/nonebot_plugin_acgnshow/acgnapis.py
+++ b/nonebot_plugin_acgnshow/acgnapis.py
@@ -1,5 +1,6 @@
import json
import requests
+from .util import *
CITY_API_ROOT="https://show.bilibili.com/api/ticket/city/list?channel=3"
SHOWS_API_ROOT="https://show.bilibili.com/api/ticket/project/listV2"
HEADERS = {
@@ -54,7 +55,9 @@ def process_shows_data_to_text(shows_data: dict):
venue_name = i["venue_name"]
project_id = i["project_id"]
sale_flag = i["sale_flag"]
- start_time = i["start_time"]
+ #start_time = i["start_time"]
+ start_unix = i["start_unix"]
+ start_time = convert_timestamp(start_unix)
end_time = i["end_time"]
price_low = i["price_low"] / 100
price_high = i["price_high"] / 100
@@ -76,7 +79,9 @@ def process_shows_data_to_template(shows_data: dict):
venue_name = i["venue_name"]
project_id = i["project_id"]
sale_flag = i["sale_flag"]
- start_time = i["start_time"]
+ #start_time = i["start_time"]
+ start_unix = i["start_unix"]
+ start_time = convert_timestamp(start_unix)
end_time = i["end_time"]
price_low = i["price_low"] / 100
price_high = i["price_high"] / 100
@@ -84,6 +89,11 @@ def process_shows_data_to_template(shows_data: dict):
wish = i["wish"]
cover = "https:" + i["cover"]
if district_name == None : district_name = ""
+ guests_list = i["guests"]
+ guests = ""
+ if guests_list != None:
+ for n in guests_list:
+ guests += n["name"] + ","
item_dict = {
"name": name,
"location": district_name + venue_name,
@@ -94,6 +104,7 @@ def process_shows_data_to_template(shows_data: dict):
"end_time": end_time,
"wish": wish,
"image_url": cover,
+ "guests": guests,
"page": page,
"total_pages": total_pages
}
@@ -103,4 +114,4 @@ def process_shows_data_to_template(shows_data: dict):
"total_pages": total_pages,
"total_results": total_results
}
- return [showlist, global_data_dict]
\ No newline at end of file
+ return [showlist, global_data_dict]
diff --git a/nonebot_plugin_acgnshow/res/template.html b/nonebot_plugin_acgnshow/res/template.html
index d447ae9..57030d8 100644
--- a/nonebot_plugin_acgnshow/res/template.html
+++ b/nonebot_plugin_acgnshow/res/template.html
@@ -11,7 +11,6 @@
body {
font-family: 'Source Han Sans', sans-serif;
background-image: url('{{ bgimage }}');
-
}
.background {
position: fixed;
@@ -19,7 +18,6 @@
left: 0;
width: 100%;
height: 100%;
- /*background-image: url('{{ bgimage }}');*/
background-size: cover;
filter: blur(40%);
z-index: -1;
@@ -53,7 +51,6 @@
height: 200px;
border: 1px solid black;
text-align: center;
- /*padding: 10px; */
box-sizing: border-box;
}
.details {
@@ -61,17 +58,29 @@
padding-left: 10px;
display: flex;
flex-direction: column;
- justify-content: space-between;
+ justify-content: flex-start;
position: relative;
font-size: 10px;
}
.details .title {
font-size: 10px;
font-weight: bold;
+ margin-bottom: 5px;
}
.details .venue_name {
font-size: 10px;
font-weight: normal;
+ margin-bottom: 5px;
+ }
+ .details .guests {
+ font-size: 10px;
+ word-wrap: break-word;
+ white-space: pre-wrap; /* 自动换行 */
+ margin-bottom: 5px;
+ }
+ .details .placeholder {
+ font-size: 10px;
+ margin-bottom: 5px;
}
.details .sale_flag {
color: red;
@@ -99,7 +108,7 @@
color: gray;
position: absolute;
bottom: 5px;
- left: 60px;
+ left: 60px;
}
.details .start-time,
.details .end-time {
@@ -161,12 +170,12 @@