Enhancements
This commit is contained in:
1 parent
2698fe7114
commit
b3e3a97c2b
2 files changed
+76
-53
No files matched your search
@@ -111,15 +111,19 @@ def index():
|
||||
|
||||
@app.route("/api/report")
|
||||
def report():
|
||||
week_start, week_end, cutoff_utc = current_week()
|
||||
week_start, week_end, _ = current_week() # This is the week range for display (e.g., Feb 15-21)
|
||||
total_episodes = int(os.environ.get("TOTAL_EPISODES", 1155))
|
||||
latest = get_latest_sunday()
|
||||
latest = get_latest_sunday() # This is the cutoff for searching (e.g., Feb 21 16:00 UTC)
|
||||
previous = get_previous_sunday()
|
||||
|
||||
jellyfin.clear_debug_logs()
|
||||
|
||||
# Convert latest_sunday string back to datetime for cutoff
|
||||
latest_sunday_dt = datetime.fromisoformat(latest.replace("Z", "+00:00"))
|
||||
user_id = os.environ["JELLYFIN_USER_ID"]
|
||||
|
||||
try:
|
||||
ep_info = jellyfin.find_last_one_piece_before(cutoff_utc)
|
||||
ep_info = jellyfin.find_last_one_piece_episode(latest_sunday_dt, user_id)
|
||||
except Exception as e:
|
||||
debug_output = jellyfin.get_debug_logs()
|
||||
return jsonify({"error": str(e), "debug": debug_output}), 502
|
||||
|
||||
Reference in new issue
Block a user