admin
2020-10-26 89e370bfdda29ac8a8f7080a18dc09a6ddc75c09
src/main/java/com/yeshi/buwan/service/imp/juhe/FunTVService.java
@@ -37,8 +37,10 @@
    @Resource
    private FunTVVideoDao funTVVideoDao;
    @Resource
    private FunTVAlbumDao funTVAlbumDao;
    @Resource
    private FunTVAlbumVideoMapDao funTVAlbumVideoMapDao;
@@ -62,6 +64,9 @@
    @Resource
    private VideoManager videoManager;
    @Resource
    private ResourceVideoService resourceVideoService;
    static Logger logger = Logger.getLogger(FunTVService.class);
@@ -464,31 +469,37 @@
        return playUrl;
    }
    public List<VideoDetailInfo> getVideoDetailList(String videoid) {
    public List<VideoDetailInfo> getVideoDetailList(String videoid, int page, int pageSize) {
        List<VideoFunTV> list = videoFunTVNewDao.listByVideoId(Long.parseLong(videoid));
        if (list != null && list.size() > 0) {
            final VideoFunTV vft = list.get(0);
            if (vft != null && vft.getAid() != null) {// 按节目查找视频
                FunTVAlbum album = funTVAlbumDao.get(vft.getAid());
                List<FunTVVideo> videoList = funTVVideoDao.listByAid(album.getAid(), "num", Sort.Direction.ASC, 0, 1000);
                Comparator<FunTVVideo> cp = new Comparator<FunTVVideo>() {
                    public int compare(FunTVVideo o1, FunTVVideo o2) {
                String aid = vft.getAid();
                FunTVAlbum album = funTVAlbumDao.get(aid);
                if (album == null) {
                    resourceVideoService.delete(videoid, FunTVUtil.RESOURCE_ID + "");
                }
                final String type = album.getVideoType();
                Sort.Direction sort = Sort.Direction.ASC;
                if (type != null)
                    if (type.contains("电影")) {
                        sort = Sort.Direction.DESC;
                    } else if (type.contains("电视剧")) {
                        sort = Sort.Direction.ASC;
                    } else if (type.contains("综艺")) {
                        sort = Sort.Direction.DESC;
                    } else if (type.contains("动漫")) {
                        sort = Sort.Direction.ASC;
                    } else
                        sort = Sort.Direction.DESC;
                        long t1 = o1.getNum();
                        long t2 = o2.getNum();
                        if (album.getVideoType().contains("电影")) {
                            return (int) (t2 - t1);
                        } else if (album.getVideoType().contains("电视剧")) {
                            return (int) (t1 - t2);
                        } else if (album.getVideoType().contains("综艺")) {
                            return (int) (t2 - t1);
                        } else if (album.getVideoType().contains("动漫")) {
                            return (int) (t1 - t2);
                        } else
                            return (int) (t2 - t1);
                    }
                };
                Collections.sort(videoList, cp);
                List<FunTVVideo> videoList = funTVVideoDao.listByAid(aid, "num", sort, (page - 1) * pageSize, pageSize);
                if (album == null && videoList.size() > 0) {//处理电影
                    album = new FunTVAlbum();
                    album.setTitle(videoList.get(0).getTitle());
                    album.setVideoType(videoList.get(0).getCate());
                }
                List<VideoDetailInfo> detailList = new ArrayList<>();
                for (FunTVVideo pv : videoList)