|
@@ -4708,24 +4708,27 @@ class AnimeService
|
|
|
if (!$video_resolution) $video_resolution = getProp($episode, 'video_resolution', '720p');
|
|
if (!$video_resolution) $video_resolution = getProp($episode, 'video_resolution', '720p');
|
|
|
|
|
|
|
|
// 将资产中新出现的资产放到extra_products中
|
|
// 将资产中新出现的资产放到extra_products中
|
|
|
- // 满足以下要求: 遍历传入的$products,将product_name与$episode中的roles和scenes做比对,如果不在其中,则与$episode中的extra_products做比对,如果有同名的则覆盖,没有则新增后存入$episode中的extra_products字段中
|
|
|
|
|
|
|
+ // 满足以下要求: 遍历传入的$products,将product_name与$episode中的roles、scenes和props做比对,如果不在其中,则与$episode中的extra_products做比对,如果有同名的则覆盖,没有则新增后存入$episode中的extra_products字段中
|
|
|
if (!empty($products) && $episode) {
|
|
if (!empty($products) && $episode) {
|
|
|
- // 获取剧集中的角色和场景列表
|
|
|
|
|
|
|
+ // 获取剧集中的角色、场景和道具列表
|
|
|
$roles = json_decode(getProp($episode, 'roles', '[]'), true) ?: [];
|
|
$roles = json_decode(getProp($episode, 'roles', '[]'), true) ?: [];
|
|
|
$scenes = json_decode(getProp($episode, 'scenes', '[]'), true) ?: [];
|
|
$scenes = json_decode(getProp($episode, 'scenes', '[]'), true) ?: [];
|
|
|
|
|
+ $props = json_decode(getProp($episode, 'props', '[]'), true) ?: [];
|
|
|
$extra_products = json_decode(getProp($episode, 'extra_products', '[]'), true) ?: [];
|
|
$extra_products = json_decode(getProp($episode, 'extra_products', '[]'), true) ?: [];
|
|
|
|
|
|
|
|
// 构建角色名称列表
|
|
// 构建角色名称列表
|
|
|
$role_names = array_column($roles, 'role');
|
|
$role_names = array_column($roles, 'role');
|
|
|
// 构建场景名称列表
|
|
// 构建场景名称列表
|
|
|
$scene_names = array_column($scenes, 'scene');
|
|
$scene_names = array_column($scenes, 'scene');
|
|
|
|
|
+ // 构建道具名称列表
|
|
|
|
|
+ $prop_names = array_column($props, 'prop');
|
|
|
|
|
|
|
|
// 遍历传入的products
|
|
// 遍历传入的products
|
|
|
foreach ($products as $product) {
|
|
foreach ($products as $product) {
|
|
|
$product_name = getProp($product, 'product_name');
|
|
$product_name = getProp($product, 'product_name');
|
|
|
|
|
|
|
|
- // 如果product_name不在roles和scenes中
|
|
|
|
|
- if (!in_array($product_name, $role_names) && !in_array($product_name, $scene_names)) {
|
|
|
|
|
|
|
+ // 如果product_name不在roles、scenes和props中
|
|
|
|
|
+ if (!in_array($product_name, $role_names) && !in_array($product_name, $scene_names) && !in_array($product_name, $prop_names)) {
|
|
|
// 查找是否在extra_products中存在同名的
|
|
// 查找是否在extra_products中存在同名的
|
|
|
$found = false;
|
|
$found = false;
|
|
|
foreach ($extra_products as $key => $extra_product) {
|
|
foreach ($extra_products as $key => $extra_product) {
|