diff --git a/config/env/torrents.js b/config/env/torrents.js index 58741457..f7e246d3 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -1357,6 +1357,24 @@ module.exports = { {command: './restart.sh', eid: 'restart', desc: 'COMMAND.RESTART'} ], + /** + * @mediaInfo + * + * mediaInfo settings + * + * @subtitle: subtitles of media info + * @flag: flag icon class, can find flag icon at '/public/lib/flag-icon-css/flags' + */ + mediaInfo: { + subtitles: { + flag: { + chs: {class: 'flag-icon-cn'}, + cht: {class: 'flag-icon-tw'}, + eng: {class: 'flag-icon-gb'} + } + } + }, + /** * @resourcesTags * diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index e2608cef..2959ecff 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -381,7 +381,11 @@ TORRENT_THUMBS_FAILED: 'Thumbs-up for torrent failed', TORRENT_RATING_SUCCESSFULLY: 'Rating torrent successfully', TORRENT_RATING_FAILED: 'Rating torrent failed', - EDIT_THIS_OVERVIEW: 'Edit this Overview', + EDIT_THIS_OVERVIEW: 'Edit this overview', + EDIT_THIS_MEDIA_INFO: 'Edit this media info', + SAVE_THIS_MEDIA_INFO: 'Save this media info', + EDIT_TORRENT_NFO_SUCCESSFULLY: 'Torrent media info edited successfully', + EDIT_TORRENT_NFO_FAILED: 'Torrent media info edited failed', IMG_PAGE_INFO: 'Current: {{index}} / {{total}}', ANNOUNCE_URL: 'Announce Url', @@ -479,6 +483,8 @@ TORRENT_TOGGLE_VIP_FAILED: 'Torrent toggle VIP tag failed', TORRENT_TOGGLE_TOP_SUCCESSFULLY: 'Torrent toggle TOP tag successfully', TORRENT_TOGGLE_TOP_FAILED: 'Torrent toggle TOP tag failed', + TORRENT_TOGGLE_UNIQUE_SUCCESSFULLY: 'Torrent toggle Unique tag successfully', + TORRENT_TOGGLE_UNIQUE_FAILED: 'Torrent toggle Unique tag failed', TORRENT_SETTAGS_SUCCESSFULLY: 'Torrent tags set successfully', TORRENT_SETTAGS_ERROR: 'Torrent tags set failed', @@ -1587,6 +1593,45 @@ } }, + MEDIAINFO: { + GENERAL: { + SELF: 'General Info', + FILESIZE: 'File Size', + RUNTIME: 'Runtime', + DURATION: 'Duration', + OVERALLBITRATE: 'Overall Bit Rate' + }, + VIDEO: { + SELF: 'Video Info', + FORMAT: 'Format', + Duration: 'Duration', + BITRATE: 'Bit Rate', + WIDTH: 'Width', + HEIGHT: 'Height', + FRAMERATEMODE: 'Frame Rate Mode', + FRAMERATE: 'Frame Rate', + BITDEPTH: 'Bit Depth', + STREAMSIZE: 'Stream Size', + WRITINGLIBRARY: 'Writing Library', + RESOLUTION: 'Resolution', + CODEC: 'Video Codec' + }, + AUDIO: { + SELF: 'Audio Info', + FORMAT: 'Format', + BITRATEMODE: 'Bit Rate Mode', + BITRATE: 'Bit Rate', + CHANNEL: 'Channel', + LANGUAGE: 'Language', + INFO: 'Audio Info', + CODEC: 'Codec' + }, + TEXT: { + SELF: 'Subtitle Info', + LANGUAGE: 'Language' + } + }, + //server returned string SERVER: { USER_IS_NOT_AUTHORIZED: 'User is not authorized', diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index b4633c3c..4a018951 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -382,6 +382,10 @@ TORRENT_RATING_SUCCESSFULLY: '为种子投票成功', TORRENT_RATING_FAILED: '为种子投票失败', EDIT_THIS_OVERVIEW: '编辑详情介绍', + EDIT_THIS_MEDIA_INFO: '编辑媒体信息', + SAVE_THIS_MEDIA_INFO: '保存媒体信息', + EDIT_TORRENT_NFO_SUCCESSFULLY: '种子媒体信息编辑成功', + EDIT_TORRENT_NFO_FAILED: '种子媒体信息编辑失败', IMG_PAGE_INFO: '当前页: {{index}} / {{total}}', ANNOUNCE_URL: 'Tracker 地址', @@ -1589,6 +1593,45 @@ } }, + MEDIAINFO: { + GENERAL: { + SELF: '资源通用信息', + FILESIZE: '资源总体积', + RUNTIME: '资源总时长', + DURATION: '资源总时长', + OVERALLBITRATE: '资源总码率' + }, + VIDEO: { + SELF: '视频信息', + FORMAT: '格式', + Duration: '时长', + BITRATE: '码率', + WIDTH: '分辨率.宽', + HEIGHT: '分辨率.高', + FRAMERATEMODE: '帧率模式', + FRAMERATE: '帧率', + BITDEPTH: '位深', + STREAMSIZE: '体积', + WRITINGLIBRARY: '编码方式', + RESOLUTION: '分辨率', + CODEC: '编码' + }, + AUDIO: { + SELF: '音频信息', + FORMAT: '格式', + BITRATEMODE: '码率模式', + BITRATE: '码率', + CHANNEL: '声道', + LANGUAGE: '音轨', + INFO: '音轨信息', + CODEC: '编码' + }, + TEXT: { + SELF: '字幕信息', + LANGUAGE: '语言' + } + }, + //server returned string SERVER: { USER_IS_NOT_AUTHORIZED: '用户身份验证未通过', diff --git a/modules/core/client/less/mt.less b/modules/core/client/less/mt.less index ceb4edf8..43c178b6 100644 --- a/modules/core/client/less/mt.less +++ b/modules/core/client/less/mt.less @@ -1610,6 +1610,7 @@ body { } .all-files { + font-size: 12px; json-tree { json-node.expandable { &::before { diff --git a/modules/torrents/client/controllers/torrent-info.client.controller.js b/modules/torrents/client/controllers/torrent-info.client.controller.js index 8b7a04a6..e73e21a8 100644 --- a/modules/torrents/client/controllers/torrent-info.client.controller.js +++ b/modules/torrents/client/controllers/torrent-info.client.controller.js @@ -31,6 +31,9 @@ vm.scoreConfig = MeanTorrentConfig.meanTorrentConfig.score; vm.inputLengthConfig = MeanTorrentConfig.meanTorrentConfig.inputLength; vm.salesGlobalConfig = MeanTorrentConfig.meanTorrentConfig.torrentGlobalSales; + vm.mediaInfoConfig = MeanTorrentConfig.meanTorrentConfig.mediaInfo; + + vm.mediaInfoEditMode = false; vm.torrentTabs = []; vm.searchTags = []; @@ -1504,9 +1507,19 @@ _id: vm.torrentLocalInfo._id, torrent_nfo: vm.torrentLocalInfo.torrent_nfo }, function (res) { - console.log('updateTorrentNfo successfully'); - console.log(res); + vm.torrentLocalInfo = res; + NotifycationService.showSuccessNotify('EDIT_TORRENT_NFO_SUCCESSFULLY'); + vm.mediaInfoEditMode = false; + }, function (res) { + NotifycationService.showErrorNotify(res.data.message, 'EDIT_TORRENT_NFO_FAILED'); }); }; + + /** + * doEditMediaInfo + */ + vm.doEditMediaInfo = function () { + vm.mediaInfoEditMode = true; + }; } }()); diff --git a/modules/torrents/client/less/torrents.less b/modules/torrents/client/less/torrents.less index e20fe2bf..bdeaf977 100644 --- a/modules/torrents/client/less/torrents.less +++ b/modules/torrents/client/less/torrents.less @@ -217,6 +217,55 @@ pre.prettyprint { } } +.media-info-formated { + background-color: #fcfcfc; + border: solid 1px #f1f1f1; + border-radius: 4px; + padding: 10px 20px; + legend { + font-size: 13px; + font-weight: 400; + color: #7a7a7a; + margin-bottom: 6px; + } + .info-key { + width: 120px; + text-align: right; + color: #2a2a2a; + } + .info-value { + color: #7a7a7a; + font-size: 12px; + } + .flag-group { + font-family: monospace, 'Courier New'; + padding: 4px 5px 2px 5px; + border: solid 1px #ccc; + display: inline-block; + margin-bottom: 3px; + margin-right: 5px; + .flag-icon { + font-size: 18px; + margin-right: 5px; + } + } +} + +.dl-media-info { + margin-bottom: 10px; + dt { + color: #2a2a2a; + @media (min-width: @screen-sm-min) { + width: 120px; + } + } + dd { + @media (min-width: @screen-sm-min) { + margin-left: 140px; + } + } +} + /* csslint ignore:end */ //popup overlay---------------------------------------------- diff --git a/modules/torrents/client/views/view-torrent.client.view.html b/modules/torrents/client/views/view-torrent.client.view.html index eba21748..d352fc8f 100644 --- a/modules/torrents/client/views/view-torrent.client.view.html +++ b/modules/torrents/client/views/view-torrent.client.view.html @@ -675,10 +675,60 @@