|
@@ -180,12 +180,12 @@ def update_video_w_h_rate(video_ids, key_name):
|
|
|
info_data = {}
|
|
|
for video_id, width, height, rotate in data:
|
|
|
|
|
|
- if rotate in (90, 270):
|
|
|
- w_h_rate = height / width
|
|
|
+ if int(rotate) in (90, 270):
|
|
|
+ w_h_rate = int(height) / int(width)
|
|
|
else:
|
|
|
- w_h_rate = width / height
|
|
|
+ w_h_rate = int(width) / int(height)
|
|
|
if w_h_rate > 1:
|
|
|
- info_data[int(video_id)] = float(w_h_rate)
|
|
|
+ info_data[int(video_id)] = w_h_rate
|
|
|
redis_helper = RedisHelper()
|
|
|
|
|
|
redis_helper.del_keys(key_name=key_name)
|
|
@@ -198,6 +198,6 @@ if __name__ == '__main__':
|
|
|
|
|
|
|
|
|
|
|
|
- video_ids = [110, 112, 113, 115, 116, 117, 118]
|
|
|
+ video_ids = [110, 112, 113, 115, 116, 117, 8289883]
|
|
|
update_video_w_h_rate(video_ids=video_ids, key_name='')
|
|
|
|