| | |
| | | } |
| | | list.add(hv.getVideo()); |
| | | } |
| | | |
| | | count = (new StringBuilder(String.valueOf(homeTypeService.getVideoCountByTypes(homeType, pageIndex)))) |
| | | .toString(); |
| | | } else if (!StringUtil.isNullOrEmpty(videoType)) { |
| | |
| | | Long startTime = System.currentTimeMillis(); |
| | | List<VideoInfo> list1 = classService.getTypeVideoList(videoType, detailSystem, pageIndex, 20, |
| | | Integer.parseInt(order), resourceList, CacheUtil.getMD5Long(resourceList)); |
| | | list = new ArrayList<VideoInfo>(); |
| | | list = new ArrayList<>(); |
| | | if (list1 != null) |
| | | for (VideoInfo info : list1) |
| | | list.add(info); |
| | |
| | | } else { |
| | | List<VideoInfo> list1 = classService.getTypeVideoList(videoType, detailSystem, pageIndex, 20, 1, |
| | | resourceList, CacheUtil.getMD5Long(resourceList)); |
| | | list = new ArrayList<VideoInfo>(); |
| | | list = new ArrayList<>(); |
| | | if (list1 != null) |
| | | for (VideoInfo info : list1) |
| | | list.add(info); |
| | |
| | | //缓存数据 |
| | | |
| | | if (list != null && list.size() > 0) { |
| | | redisManager.saveVideoList(key, new VideoListResultVO(list, count)); |
| | | redisManager.saveVideoList(key, new VideoListResultVO(list, Long.parseLong(count))); |
| | | } |
| | | |
| | | } |
| | |
| | | public void getRecommendCategoryVideoList(AcceptData acceptData, HttpServletRequest request, PrintWriter out) { |
| | | String typeid = request.getParameter("Type"); |
| | | DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName()); |
| | | // int count = |
| | | // categoryRecommendVideoService.getRankVideoNumber(Integer.parseInt(typeid)); |
| | | List<VideoInfo> rankList = categoryRecommendCacheVideoService.getVideoListByRank(Integer.parseInt(typeid), |
| | | detailSystem.getId()); |
| | | detailSystem.getId(), acceptData.getPlatform(), acceptData.getVersion()); |
| | | List<VideoInfo> list = new ArrayList<VideoInfo>(); |
| | | list.addAll(rankList); |
| | | // List<VideoInfo> list1 = |
| | | // recommendService.getCategoryRecommendVideoList(Integer.parseInt(typeid), |
| | | // count); |
| | | // int crvs = list1.size(); |
| | | // for (CategoryRecommendCacheVideo crcv : rankList) { |
| | | // int rank = crcv.getRank(); |
| | | // if(crvs > 0 && rank > 0 && rank <= crvs ){ |
| | | // list1.add(rank-1, crcv.getVideoInfo()); |
| | | // } |
| | | // } |
| | | // list.addAll(list1.subList(0, list1.size()>count?count:list1.size())); |
| | | // |
| | | // list = banQuanService.getBanQuanVideo(list, detailSystem.getId(), |
| | | // CacheUtil.getMD5VideoInfo(list)); |
| | | for (VideoInfo vi : list) {// 清除无用数据,防止浪费带宽,更改图片 |
| | | vi.setIntroduction(""); |
| | | vi.setMainActor(""); |