Преглед на файлове

新增云存列表通过AI标签筛选

zhangdongming преди 2 години
родител
ревизия
8b317d5292
променени са 1 файла, в които са добавени 10 реда и са изтрити 2 реда
  1. 10 2
      Controller/CloudStorage.py

+ 10 - 2
Controller/CloudStorage.py

@@ -451,6 +451,7 @@ class CloudStorageView(View):
         end_time = request_dict.get('endTime', None)
         uid = request_dict.get('uid', None)
         channel = request_dict.get('channel', None)
+        event_types = request_dict.get('eventTypes', None)
 
         if not all([uid, channel, start_time, end_time]):
             return response.json(444)
@@ -486,12 +487,18 @@ class CloudStorageView(View):
             "dvQsModelOverTime": device_info_qs_time_over,
             "UidBucketModelOverTime": uid_bucket_qs_time_over,
         })
-
+        type_list = []
+        if event_types:
+            if ',' in event_types:
+                type_list = event_types.split(',')
+                type_list = [int(i.strip()) for i in type_list]
+            else:
+                type_list = [int(event_types)]
         split_vod_hls_obj = SplitVodHlsObject()
         vod_hls_qs = split_vod_hls_obj.get_vod_hls_data(uid=uid, channel=channel,
                                                         end_time__gte=now_time,
                                                         start_time__range=(start_time, end_time),
-                                                        ) \
+                                                        type_list=type_list) \
             .values("id", "start_time", "sec", "fg", "bucket_id")
 
         vod_play_list = []
@@ -542,6 +549,7 @@ class CloudStorageView(View):
                 'sec': vod['sec'],
                 'ts_num': ts_num,
                 'vod_id': vod['id'],
+                'types': split_vod_hls_obj.query_tag_type_list(vod['id'])
             })
         vod_play_list = sorted(vod_play_list, key=lambda item: -item['start_time'])
         generate_presigned_over_time = int(time.time())