Selaa lähdekoodia

update:骑兵分类增加字幕、分辨率、原档、压缩结果显示及分类排序优化v1

tujidelv 3 vuotta sitten
vanhempi
commit
55306a1f2c

+ 5 - 0
src/main/java/top/lvzhiqiang/entity/VideoInfo.java

@@ -119,4 +119,9 @@ public class VideoInfo implements Serializable {
     private String imgPrefixSYPath;
     private List<String> imgGFList = new ArrayList<>();
     private List<String> imgSYList = new ArrayList<>();
+
+    private String resolutionRatio;
+    private Integer original;
+    private Integer subtitle;
+    private Integer recoding;
 }

+ 3 - 0
src/main/java/top/lvzhiqiang/mapper/VideoCastMapper.java

@@ -62,4 +62,7 @@ public interface VideoCastMapper {
      */
     @Select("SELECT * FROM video_cast WHERE delete_flag = 1 ORDER BY sort")
     List<VideoCast> findAll();
+
+    @Select("select name, count(id) count from video_info_cast group by name order by count(id) desc")
+    List<VideoCast> findAll4Order();
 }

+ 3 - 0
src/main/java/top/lvzhiqiang/mapper/VideoGenresMapper.java

@@ -62,4 +62,7 @@ public interface VideoGenresMapper {
      */
     @Select("SELECT * FROM video_genres WHERE delete_flag = 1 ORDER BY sort")
     List<VideoGenres> findAll();
+
+    @Select("select name, count(id) count from video_info_genres group by name order by count(id) desc")
+    List<VideoGenres> findAll4Order();
 }

+ 1 - 1
src/main/java/top/lvzhiqiang/service/impl/VideoCastServiceImpl.java

@@ -29,7 +29,7 @@ public class VideoCastServiceImpl implements VideoCastService {
      */
     @Override
     public List<VideoCast> findAll() {
-        return videoCastMapper.findAll();
+        return videoCastMapper.findAll4Order();
     }
 
     /**

+ 1 - 1
src/main/java/top/lvzhiqiang/service/impl/VideoGenresServiceImpl.java

@@ -29,7 +29,7 @@ public class VideoGenresServiceImpl implements VideoGenresService {
      */
     @Override
     public List<VideoGenres> findAll() {
-        return videoGenresMapper.findAll();
+        return videoGenresMapper.findAll4Order();
     }
 
     /**

+ 2 - 1
src/main/resources/mapper/VideoInfoMapper.xml

@@ -6,7 +6,8 @@
 <mapper namespace="top.lvzhiqiang.mapper.VideoInfoMapper">
 
     <select id="getVideoInfoList" resultType="top.lvzhiqiang.entity.VideoInfo">
-        select vi.*, IFNULL(vio.score, 0) AS score, IFNULL(vio.comment, '暂无评论') AS comment
+        select vi.*, IFNULL(vio.score, 0) AS score, IFNULL(vio.comment, '暂无评论') AS comment,
+            IFNULL(vio.resolution_ratio, '?') AS resolutionRatio,vio.original,vio.subtitle,vio.recoding
         from video_info vi
         left join video_info_other vio on vi.identification_code = vio.identification_code and vio.delete_flag = 1
         where vi.delete_flag = 1

+ 12 - 1
src/main/resources/static/js/my-video.js

@@ -116,6 +116,17 @@ function search(pageNo, startFlag, searchSelectFlag) {
                         date = videoInfo.modifyTime;
                     }
 
+                    var scoreStr = '';
+                    if (bigType == '骑兵') {
+                        scoreStr += videoInfo.resolutionRatio + '|';
+                        scoreStr += (videoInfo.original === null ? '?' : (videoInfo.original == 1 ? '原档' : '非原档')) + '|';
+                        scoreStr += (videoInfo.subtitle === null ? '?' : (videoInfo.subtitle == 1 ? '字幕' : '无字幕')) + '|';
+                        scoreStr += (videoInfo.recoding === null ? '?' : (videoInfo.recoding == 1 ? '压缩' : '未压缩')) + '|';
+                        scoreStr += videoInfo.score;
+                    } else {
+                        scoreStr = videoInfo.score;
+                    }
+
                     str += "<li class=\"col-lg-8 col-md-6 col-sm-4 col-xs-3\">" +
                         "   <div class=\"myui-vodlist__box\">" +
                         "       <a class=\"myui-vodlist__thumb lazyload\" title=\"\" style=\"background-image: url(&quot;apics/" + videoInfo.imgUrl + "&quot;);\">" +
@@ -124,7 +135,7 @@ function search(pageNo, startFlag, searchSelectFlag) {
                         "               <span class=\"tag identificationCode\" style=\"background-color: #FB7299;\">" + videoInfo.identificationCode + "</span>" +
                         "               <span class=\"tag\" style=\"background-color: #00C0FF;\">" + date + "</span>" +
                         "           </span>" +
-                        "           <span class=\"pic-text text-right\" title='" + videoInfo.comment + "'>" + videoInfo.score + "</span>" +
+                        "           <span class=\"pic-text text-right\" title='" + (videoInfo.comment === '' ? '暂无评论' : videoInfo.comment) + "'>" + scoreStr + "</span>" +
                         "       </a>" +
                         "       <div class=\"myui-vodlist__detail\">" +
                         "           <h4 class=\"videodetail title text-overflow\" identificationCode='" + videoInfo.identificationCode + "' ><a title=\" " + videoInfo.name + " \">" + videoInfo.name + "</a></h4>" +