fix: avoid tmdb cached response mutation

Fixes #5777
This commit is contained in:
jxxghp
2026-05-16 08:02:18 +08:00
parent 28718094e4
commit 3c055e2482
2 changed files with 52 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
import asyncio
import logging
import time
from copy import deepcopy
from datetime import datetime
import requests
@@ -145,7 +146,8 @@ class TMDb(object):
@classmethod
def _get_response_json(cls, response):
if isinstance(response, dict) and response.get(cls._RESPONSE_SNAPSHOT_MARKER):
return response.get("json")
# 调用方会补充 media_type 等字段,缓存快照必须隔离这些原地修改。
return deepcopy(response.get("json"))
return response.json()
def cache_clear(self):