From dd91f6b57fe165797e832a5074ad7440af522822 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Thu, 10 May 2018 11:08:09 +0800 Subject: [PATCH 01/96] fix(torrents): css of genres-item --- modules/core/client/less/mt.less | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/core/client/less/mt.less b/modules/core/client/less/mt.less index 258b2f7a..fd1f355b 100644 --- a/modules/core/client/less/mt.less +++ b/modules/core/client/less/mt.less @@ -1093,6 +1093,10 @@ body { .media-heading { margin-bottom: 5px; } + .genres-item { + font-size: 12px; + color: @gray-light; + } } .td-imdb { min-width: 90px; @@ -1133,10 +1137,7 @@ body { } .list-all-genres { - font-size: 12px; .genres-item { - color: @gray-light; - font-size: 12px; &:not(:first-child) { &::before { content: " | "; From 3190624d643073592715b071c4a4728c97f453f2 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Fri, 11 May 2018 23:04:44 +0800 Subject: [PATCH 02/96] fix(requests): check request post condition of score number --- .../controllers/requests-add.client.controller.js | 12 ++++++++++++ .../client/views/requests-add.client.view.html | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/modules/requests/client/controllers/requests-add.client.controller.js b/modules/requests/client/controllers/requests-add.client.controller.js index b8086d82..8e4fe191 100644 --- a/modules/requests/client/controllers/requests-add.client.controller.js +++ b/modules/requests/client/controllers/requests-add.client.controller.js @@ -36,6 +36,18 @@ return marked(ts, {sanitize: true}); }; + /** + * getCanNotAddDesc + * @returns {*} + */ + vm.getCanNotAddDesc = function () { + var ts = $translate.instant('REQUESTS.CAN_NTO_TO_ADD', { + add_score: vm.requestsConfig.scoreForAddRequest + }); + + return marked(ts, {sanitize: true}); + }; + /** * create * @param isValid diff --git a/modules/requests/client/views/requests-add.client.view.html b/modules/requests/client/views/requests-add.client.view.html index 0104b0fc..76cf7124 100644 --- a/modules/requests/client/views/requests-add.client.view.html +++ b/modules/requests/client/views/requests-add.client.view.html @@ -40,7 +40,17 @@ -
+
+
+
+ +
+
+
+ +
@@ -70,7 +80,7 @@ -
+

{{ 'REQUESTS.FORM_DESC_REQUIRED' | translate}}

From 8ae849779e53fde7564b548c3088e0cca52ad34c Mon Sep 17 00:00:00 2001 From: OldHawk Date: Fri, 11 May 2018 23:46:10 +0800 Subject: [PATCH 03/96] fix(peers): recount user download percent of torrent --- modules/torrents/server/models/peer.server.model.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/torrents/server/models/peer.server.model.js b/modules/torrents/server/models/peer.server.model.js index 87a5ace6..445e9225 100644 --- a/modules/torrents/server/models/peer.server.model.js +++ b/modules/torrents/server/models/peer.server.model.js @@ -135,7 +135,8 @@ function countPercent(p) { if (p.peer_status === 'seeder') { p.peer_percent = 100; } else { - p.peer_percent = (Math.round((p.peer_downloaded / (p.peer_downloaded + p.peer_left)) * 10000) / 100) || 0; + // p.peer_percent = (Math.round((p.peer_downloaded / (p.peer_downloaded + p.peer_left)) * 10000) / 100) || 0; + p.peer_percent = Math.round((p.torrent.torrent_size - p.peer_left) / p.torrent.torrent_size * 10000) / 100; } } From e21127b2990ddb1398ceb013b41f3461f81acc6c Mon Sep 17 00:00:00 2001 From: OldHawk Date: Fri, 11 May 2018 23:49:01 +0800 Subject: [PATCH 04/96] fix(announce): find announced torrent to populate out peers info --- .../server/controllers/announces.server.controller.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/announce/server/controllers/announces.server.controller.js b/modules/announce/server/controllers/announces.server.controller.js index 2d4de6c2..3729f962 100644 --- a/modules/announce/server/controllers/announces.server.controller.js +++ b/modules/announce/server/controllers/announces.server.controller.js @@ -282,7 +282,8 @@ exports.announce = function (req, res) { }) .populate('user') .populate({ - path: '_peers' + path: '_peers', + match: { user: req.passkeyuser._id} }) .exec(function (err, t) { if (err) { @@ -940,6 +941,7 @@ exports.announce = function (req, res) { req.selfpeer.every(function (p) { if (p.peer_id === query.peer_id) { req.currentPeer = p; + req.currentPeer.torrent = req.torrent; req.currentPeer.isNewCreated = false; if (req.seeder && req.currentPeer.peer_status !== PEERSTATE_SEEDER && event(query.event) !== EVENT_COMPLETED) { From 50a0c0d6f62d736a93dc93fdb8d92a1228931b2c Mon Sep 17 00:00:00 2001 From: OldHawk Date: Sat, 12 May 2018 02:59:18 +0800 Subject: [PATCH 05/96] feat(torrents): resource title and subtitle support --- config/env/torrents.js | 35 +- config/lib/multer.js | 11 +- .../controllers/about.client.controller.js | 13 +- .../client/views/maker-view.client.view.html | 112 +----- .../views/collection-view.client.view.html | 116 +------ modules/core/client/app/trans-string-en.js | 25 +- modules/core/client/app/trans-string-zh.js | 23 +- .../torrent-list-item.client.directive.js | 322 ++++++++++++++++++ modules/core/client/less/btn-size.less | 40 +++ modules/core/client/less/media-margin.less | 7 + modules/core/client/less/mt.less | 76 ++++- modules/requests/client/less/requests.less | 27 +- .../views/requests-view.client.view.html | 132 +------ .../admin/admin-list.client.controller.js | 168 +-------- .../torrent-info.client.controller.js | 3 + .../controllers/uploads.client.controller.js | 33 ++ .../torrent-file-link.client.directive.js | 53 +++ modules/torrents/client/less/torrents.less | 1 + .../torrent-get-info.client.service.js | 53 +++ .../templates/torrent-item.client.view.html | 281 +++++++++++++++ .../views/admin/admin-list.client.view.html | 171 +--------- .../views/list-torrents.client.view.html | 116 +------ .../views/search-torrents.client.view.html | 154 +++------ .../views/uploads-torrents.client.view.html | 70 ++-- .../controllers/torrents.server.controller.js | 6 +- .../server/models/complete.server.model.js | 2 +- .../admin/user-uploaded.client.controller.js | 47 ++- .../status/uploaded.client.controller.js | 50 ++- .../admin/user-leeching.client.view.html | 123 +------ .../views/admin/user-seeding.client.view.html | 119 +------ .../views/admin/user-uplist.client.view.html | 113 +----- .../views/admin/user-warning.client.view.html | 124 +------ .../views/status/downloading.client.view.html | 120 +------ .../views/status/seeding.client.view.html | 116 +------ .../views/status/uploaded.client.view.html | 111 +----- .../views/status/warning.client.view.html | 120 +------ .../controllers/vip.client.controller.js | 2 + modules/vip/client/views/vip.client.view.html | 116 +------ 38 files changed, 1182 insertions(+), 2029 deletions(-) create mode 100644 modules/core/client/directives/torrent-list-item.client.directive.js create mode 100644 modules/core/client/less/media-margin.less create mode 100644 modules/torrents/client/templates/torrent-item.client.view.html diff --git a/config/env/torrents.js b/config/env/torrents.js index fc8591d0..5db83830 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -524,24 +524,29 @@ module.exports = { }, /** - * @inputLength + * @inputLength * - * input string length limit settings + * input string length limit settings * - * @userSignatureLength: user signature of forum string length limit - * @chatMessageMaxLength: chat room send message string length limit - * @messageTitleLength: user message send title length limit - * @messageBoxContentLength: user message send content length limit - * @messageBoxReplyLength: user message send reply content length limit - * @ticketContentLength: ticket content length limit - * @torrentCommentLength: torrent comment send content length limit - * @forumTopicTitleLength: forum topic title length limit - * @forumTopicContentLength: forum topic content length limit - * @forumReplyContentLength: forum reply content length limit - * @makerGroupDescLength: resources group desc content length limit - * @collectionsOverviewLength: movie collections overview content length limit + * @uploadTorrentTitleLength: torrent title length on upload page + * @uploadTorrentSubTitleLength: torrent sub title length on upload page + * @userSignatureLength: user signature of forum string length limit + * @chatMessageMaxLength: chat room send message string length limit + * @messageTitleLength: user message send title length limit + * @messageBoxContentLength: user message send content length limit + * @messageBoxReplyLength: user message send reply content length limit + * @ticketContentLength: ticket content length limit + * @torrentCommentLength: torrent comment send content length limit + * @forumTopicTitleLength: forum topic title length limit + * @forumTopicContentLength: forum topic content length limit + * @forumReplyContentLength: forum reply content length limit + * @makerGroupDescLength: resources group desc content length limit + * @collectionsOverviewLength: movie collections overview content length limit */ inputLength: { + uploadTorrentTitleLength: 128, + uploadTorrentSubTitleLength: 128, + userSignatureLength: 512, chatMessageMaxLength: 512, @@ -1181,7 +1186,7 @@ module.exports = { * @resourcesLanguage: settings for language of dropdown resource info */ tmdbConfig: { - key: 'this is access key from tmdb', + key: '7888f0042a366f63289ff571b68b7ce0', tmdbHome: 'https://www.themoviedb.org', tmdbMovieLinkUrl: 'https://www.themoviedb.org/movie/', tmdbTvserialLinkUrl: 'https://www.themoviedb.org/tv/', diff --git a/config/lib/multer.js b/config/lib/multer.js index 6f539bd7..c02e0988 100644 --- a/config/lib/multer.js +++ b/config/lib/multer.js @@ -59,7 +59,10 @@ module.exports.createUploadFilename = function (req, file, cb) { } //replace other pt site prefix - filename = filename.replace(/^\{([^}]+)\}[\.\s]|^\{([^}]+)\}/, ''); + var reg = /^\{([^}]+)\}[\.\s]|^\{([^}]+)\}/i; + while (reg.test(filename)) { + filename = filename.replace(reg, ''); + } if (fs.existsSync(config.uploads.torrent.file.dest + filename)) { var err = new Error(); @@ -98,7 +101,11 @@ module.exports.createUploadAttachFilename = function (req, file, cb) { } //replace other pt site prefix - filename = filename.replace(/^\{([^}]+)\}[\.\s]|^\{([^}]+)\}/, ''); + var reg = /^\{([^}]+)\}[\.\s]|^\{([^}]+)\}/i; + while (reg.test(filename)) { + filename = filename.replace(reg, ''); + } + if (fs.existsSync(config.uploads.attach.file.dest + filename)) { var ext = file.originalname.replace(/^.+\./, ''); diff --git a/modules/about/client/controllers/about.client.controller.js b/modules/about/client/controllers/about.client.controller.js index ba035bef..a9156b46 100644 --- a/modules/about/client/controllers/about.client.controller.js +++ b/modules/about/client/controllers/about.client.controller.js @@ -43,6 +43,11 @@ vm.groupTorrentType = localStorageService.get('maker_last_selected_type') || 'movie'; vm.searchTags = []; + vm.searchKey = ''; + vm.releaseYear = undefined; + vm.filterHnR = false; + vm.filterSale = false; + vm.torrentRLevel = 'level0'; uibButtonConfig.activeClass = 'btn-success'; @@ -275,7 +280,13 @@ torrent_status: 'reviewed', maker: vm.maker._id, torrent_vip: false, - keys: vm.search + keys: vm.search, + + torrent_rlevel: vm.torrentRLevel, + torrent_release: vm.releaseYear, + torrent_tags: vm.searchTags, + torrent_hnr: vm.filterHnR, + torrent_sale: vm.filterSale }, function (data) { mtDebug.info(data); callback(data); diff --git a/modules/about/client/views/maker-view.client.view.html b/modules/about/client/views/maker-view.client.view.html index a153ab4f..90cea3ac 100644 --- a/modules/about/client/views/maker-view.client.view.html +++ b/modules/about/client/views/maker-view.client.view.html @@ -174,120 +174,16 @@ {{ 'TABLE_FIELDS.PUBLISHER' | translate}} - - + +
-

{{vm.tooltipMsg | translate}}

+

{{vm.tooltipMsg | translate}}

- - - -
-
- {{vm.TGI.getTorrentTitle(item)}} - -
- -
-
-
-
- {{vm.TGI.getTorrentDoubleTitle(item)}} - -
- -
{{item.torrent_filename | filename}}
-
{{item.resource_detail_info.subtitle}}
- -
- {{t.name}} -
- -
- - {{ item.resource_detail_info.release_date}} - - {{'STATUS_TOP_KEY' | translate}} - - {{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent_recommended.toUpperCase() | translate}} - - - {{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}} - - S{{item.torrent_seasons}}E{{item.torrent_episodes}} - - H&R - - VIP - - - - {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} - - -
-
-
- - - {{vm.TGI.getVoteTitle(item)}} {{item.resource_detail_info.vote_average | number : 1}} - - {{item.createdat | life}} - {{item.torrent_size | bytes:2}} - -

- - {{item.torrent_seeds}} -

- -

- - {{item.torrent_leechers}} -

- -

- - {{item.torrent_finished}} -

- - - - {{ 'ANONYMOUS' | translate }} - -
- - - - - - -
- - +
diff --git a/modules/collections/client/views/collection-view.client.view.html b/modules/collections/client/views/collection-view.client.view.html index a48ce0ab..e331929f 100644 --- a/modules/collections/client/views/collection-view.client.view.html +++ b/modules/collections/client/views/collection-view.client.view.html @@ -95,121 +95,7 @@ {{ 'TABLE_FIELDS.PUBLISHER' | translate}} - - - - -
-
- {{vm.TGI.getTorrentTitle(item)}} - -
- -
-
-
-
- {{vm.TGI.getTorrentDoubleTitle(item)}} - -
- -
{{item.torrent_filename | filename}}
-
{{item.resource_detail_info.subtitle}}
- -
- {{t.name}} -
- -
- - {{ item.resource_detail_info.release_date}} - - {{'STATUS_TOP_KEY' | translate}} - - {{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent_recommended.toUpperCase() | translate}} - - - {{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}} - - S{{item.torrent_seasons}}E{{item.torrent_episodes}} - - H&R - - VIP - - - - {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} - - -
-
-
- - - {{vm.TGI.getVoteTitle(item)}} {{item.resource_detail_info.vote_average | number : 1}} - - {{item.createdat | life}} - {{item.torrent_size | bytes:2}} - -

- - {{item.torrent_seeds}} -

- -

- - {{item.torrent_leechers}} -

- -

- - {{item.torrent_finished}} -

- - -
- - {{ 'ANONYMOUS' | translate }} - -
- - -
-
- -
- - - - -
- - - +
diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 920a609d..2dba28d7 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -23,6 +23,7 @@ VALUE_CUSTOM: 'CUSTOM', VALUE_SELECT_ALL: 'Select All', BTN_REMOVE: 'Remove', + BTN_CONTINUE: 'Continue', //Support SUPPORT_GROUP_NAME_DESC: 'Management group', @@ -162,16 +163,12 @@ TITLE_LIFE: 'orderBy life', //status - UPLOADED_SPEED: 'U/S', - DOWNLOADED_RATIO: 'D/R', - DOWNLOADED_SPEED: 'D/S', - UPLOADED_RATIO_PERCENT: 'U/R/P', + UPLOADED_SPEED: 'U/S/R', + DOWNLOADED_SPEED: 'D/S/P', UP_DOWN_RATIO_TIME: 'U/D/R/T', - ABBR_UPLOADED_SPEED: 'uploaded/speed', - ABBR_DOWNLOADED_RATIO: 'downloaded/ratio', - ABBR_DOWNLOADED_SPEED: 'downloaded/speed', - ABBR_UPLOADED_RATIO_PERCENT: 'uploaded/ratio/percent', + ABBR_UPLOADED_SPEED: 'uploaded/speed/ratio', + ABBR_DOWNLOADED_SPEED: 'downloaded/speed/percent', ABBR_UP_DOWN_RATIO_TIME: 'uploaded/downloaded/ratio/seeding time', //peer @@ -347,6 +344,7 @@ COPY_LINK_TO_CLIPBOARD: 'Copy torrent file download link to clipboard', COPY_LINK_TEXT: 'Copy torrent file link', COPY_TO_CLIPBOARD_SUCCESSFULLY: 'Copy data to clipboard successfully!', + TORRENT_LABEL_LINK: 'Torrent Link', PH_KEYWORD: 'Search keyword', CLEAR_ALL_CONDITION: 'Clear All Condition', MORE_TAGS: 'More Tags', @@ -510,7 +508,7 @@ SELECT_TORRENT_FILE: '1. Please select the torrent file', SELECT_FILE: 'Select file', DO_UPLOAD: 'Upload', - ENTER_TMDB_ID: '3. Please enter theMovieDB id', + ENTER_TMDB_ID: '3 Please enter theMovieDB id', LOAD_TMDB_INFO: 'Load info', SEARCH_FROM_TMDB: 'Search From TMDB', TMDB_ID: 'TMDB ID', @@ -553,8 +551,8 @@ ERROR_ONLY_IMAGE: 'Only image files support(gif, png, bmp, jpg, jpeg)', FILE_TYPE_ERROR: 'File type that is not accepted', - ENTER_RESOURCE_TITLE: '3. Please enter the resource title and desc', - RESOURCE_TITLE: 'resource title', + ENTER_RESOURCE_TITLE: '4.1 Please enter the resource main title and sub title', + RESOURCE_TITLE: 'resource main title', RESOURCE_SUB_TITLE: 'resource sub title', SELECT_RESOURCE_IMAGE: '3.1 Please select resource cover image', ENTER_RESOURCE_DETAIL_INFO: '4. Please enter the resource detail info', @@ -848,9 +846,10 @@ COMMENT_REMOVE_ERROR: 'Comment removed failed!', DESC_LIST: '### NOTE: \n - The list contains only the last `{{days}}` days of the requests. \n - If your response is accepted, the requestor\'s reward score will be automatically transferred to your account. \n - Only the torrents reviewed by the administrator can be accepted by the requestor. \n - The requester can only accept one of the responses. \n - If your response is complains, your account may be punished, Please respond to the user\'s request carefully.', DESC_MY: '### NOTE: \n - If you accept a response, your reward score will be transferred to the respondent\'s account that you accept. \n - Only the torrents reviewed by the administrator can be accepted by you. \n - You can only accept one of the responses. \n - The request over `{{days}}` days has expired and cannot accept the response, you can only post the request again. \n - If your score is maliciously damaged, Please contact our {{sNameDesc | translate}} by **[Message](/messages/send?to={{sName}})** or **[Email](mailto:{{sMail}})** to complaints.', - DESC_ADD: '### NOTE: \n - Each request will be automatically deducted from `{{add_score}}` points, but your reward score will only be transferred to the responder\'s account that you eventually accept. \n - Only the torrents reviewed by the administrator can be accepted by you. \n - Each request is only valid for `{{days}}` days. After expiry, you can only post the request again. \n - Please give a clear resources description of your request when you post the request.', + DESC_ADD: '### NOTE: \n - Each request will be automatically deducted from `{{add_score}}` points, and your reward score will only be transferred to the responder\'s account that you eventually accept. \n - Only the torrents reviewed by the administrator can be accepted by you. \n - Each request is only valid for `{{days}}` days. After expiry, you can only post the request again. \n - Please give a clear resources description of your request when you post the request.', DESC_RES: '### NOTE: \n - If requestor accept your response, the reward score will be transferred to your account. \n - Only the torrents reviewed by the administrator can be accepted by requestor. \n - Requestor can only accept one of the responses.', - DESC_VIEW: '### NOTE: \n - If you want to response a request, please upload the torrent file and seed, Please respond to the user\'s request carefully. \n - If you are a requestor, you can choose a responder and accept it, and only the torrents reviewed by the administrator can be accepted. \n - If you accept a response, your reward score will be transferred to the respondent\'s account that you accept. \n - The request over `{{days}}` days has expired and cannot accept or response(upload).' + DESC_VIEW: '### NOTE: \n - If you want to response a request, please upload the torrent file and seed, Please respond to the user\'s request carefully. \n - If you are a requestor, you can choose a responder and accept it, and only the torrents reviewed by the administrator can be accepted. \n - If you accept a response, your reward score will be transferred to the respondent\'s account that you accept. \n - The request over `{{days}}` days has expired and cannot accept or response(upload).', + CAN_NTO_TO_ADD: 'Each request will be automatically deducted from `{{add_score}}` points,your scores are too small, please try again later ...' }, //user status diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index 1e73dee7..8a8d2bcf 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -23,6 +23,7 @@ VALUE_CUSTOM: '自定义', VALUE_SELECT_ALL: '全选', BTN_REMOVE: '删除', + BTN_CONTINUE: '继续', //Support SUPPORT_GROUP_NAME_DESC: '管理组', @@ -162,16 +163,12 @@ TITLE_LIFE: '按上传时间排序', //status - UPLOADED_SPEED: '上/速', - DOWNLOADED_RATIO: '下/比', - DOWNLOADED_SPEED: '下/速', - UPLOADED_RATIO_PERCENT: '上/比/进度', + UPLOADED_SPEED: '上/速/分享', + DOWNLOADED_SPEED: '下/速/进度', UP_DOWN_RATIO_TIME: '上/下/比/时', - ABBR_UPLOADED_SPEED: '上传量/速度', - ABBR_DOWNLOADED_RATIO: '下载量/分享率', - ABBR_DOWNLOADED_SPEED: '下载量/速度', - ABBR_UPLOADED_RATIO_PERCENT: '上传量/分享率/完成百分比', + ABBR_UPLOADED_SPEED: '上传量/速度/分享率', + ABBR_DOWNLOADED_SPEED: '下载量/速度/完成进度', ABBR_UP_DOWN_RATIO_TIME: '上传量/下载量/分享率/做种时间', //peer @@ -347,6 +344,7 @@ COPY_LINK_TO_CLIPBOARD: '复制种子文件下载连接到剪切板', COPY_LINK_TEXT: '复制种子文件地址', COPY_TO_CLIPBOARD_SUCCESSFULLY: '内容已复制到剪切板!', + TORRENT_LABEL_LINK: '种子连接', PH_KEYWORD: '搜索关键字', CLEAR_ALL_CONDITION: '清空所有条件', MORE_TAGS: '显示更多标签', @@ -510,7 +508,7 @@ SELECT_TORRENT_FILE: '1. 请选择种子文件', SELECT_FILE: '选择文件', DO_UPLOAD: '上传', - ENTER_TMDB_ID: '3. 请输入TMDB_ID', + ENTER_TMDB_ID: '3 请输入TMDB_ID', LOAD_TMDB_INFO: '检索信息', TMDB_ID: 'TMDB ID', SEARCH_FROM_TMDB: '从 TMDB 搜索', @@ -553,8 +551,8 @@ ERROR_ONLY_IMAGE: '此处只支持图片文件上传(gif, png, bmp, jpg, jpeg)', FILE_TYPE_ERROR: '文件类型不被接受', - ENTER_RESOURCE_TITLE: '3. 请输入资源标题与描述', - RESOURCE_TITLE: '资源标题', + ENTER_RESOURCE_TITLE: '4.1 请输入资源主副标题', + RESOURCE_TITLE: '资源主标题', RESOURCE_SUB_TITLE: '资源副标题', SELECT_RESOURCE_IMAGE: '3.1 请选择资源封面图片', ENTER_RESOURCE_DETAIL_INFO: '4. 请输入资源详细信息', @@ -850,7 +848,8 @@ DESC_MY: '### 提示: \n - 如果您接受一个响应, 您的悬赏积分就会转入您接受的响应者的帐户. \n - 只有被管理员审核通过的种子才能被您接受. \n - 您只能接受多个响应中的一个. \n - 超过 `{{days}}` 天的请求已经过期且不能接受响应, 如果需要您只能再次发起请求. \n - 如果您的积分受到恶意损害, 请给{{sNameDesc | translate}}发送 **[消息](/messages/send?to={{sName}})** 或 **[邮件](mailto:{{sMail}})** 进行投诉.', DESC_ADD: '### 提示: \n - 每发布一个请求会被自动扣除 `{{add_score}}` 积分, 而您的悬赏积分会转入您最终接受的响应者的帐户. \n - 只有被管理员审核通过的种子才能被您接受. \n - 每一个发布的请求只有 `{{days}}` 天的有效期, 过期后您只能再次发起请求. \n - 请在发布请求时明确描述您对资源的要求.', DESC_RES: '### NOTE: \n - 如果请求者接受了您的响应, 悬赏积分将自动转入您的帐户. \n - 只有被管理员审核通过的种子才能被请求者接受. \n - 请求者只会接受多个响应中的一个.', - DESC_VIEW: '### NOTE: \n - 如果您是一个响应者, 请上传您的种子文件并开始做种, 请认真响应用户的请求. \n - 如果您是一个请求者, 您可以选择一个响应并接受它, 只有被管理员审核通过的种子才能被您接受. \n - 如果您接受一个响应, 您的悬赏积分就会转入您接受的响应者的帐户. \n - 超过 `{{days}}` 天的请求已经过期且不能接受响应或上传种子.' + DESC_VIEW: '### NOTE: \n - 如果您是一个响应者, 请上传您的种子文件并开始做种, 请认真响应用户的请求. \n - 如果您是一个请求者, 您可以选择一个响应并接受它, 只有被管理员审核通过的种子才能被您接受. \n - 如果您接受一个响应, 您的悬赏积分就会转入您接受的响应者的帐户. \n - 超过 `{{days}}` 天的请求已经过期且不能接受响应或上传种子.', + CAN_NTO_TO_ADD: '每发布一个请求会被自动扣除 `{{add_score}}` 积分,您的积分太少,请稍候再试 ...' }, //user status diff --git a/modules/core/client/directives/torrent-list-item.client.directive.js b/modules/core/client/directives/torrent-list-item.client.directive.js new file mode 100644 index 00000000..7755ad5b --- /dev/null +++ b/modules/core/client/directives/torrent-list-item.client.directive.js @@ -0,0 +1,322 @@ +(function () { + 'use strict'; + + angular.module('core') + .directive('torrentListItem', torrentListItem); + + function torrentListItem() { + var TorrentsItemController = ['$scope', '$state', 'TorrentGetInfoServices', 'ResourcesTagsServices', '$timeout', 'DownloadService', 'MeanTorrentConfig', + 'TorrentsService', 'Authentication', 'NotifycationService', 'ModalConfirmService', '$translate', + function ($scope, $state, TorrentGetInfoServices, ResourcesTagsServices, $timeout, DownloadService, MeanTorrentConfig, TorrentsService, Authentication, + NotifycationService, ModalConfirmService, $translate) { + var vm = this; + + vm.user = Authentication.user; + vm.state = $state; + vm.TGI = TorrentGetInfoServices; + vm.RTS = ResourcesTagsServices; + vm.DLS = DownloadService; + vm.torrentSalesType = MeanTorrentConfig.meanTorrentConfig.torrentSalesType; + vm.torrentRLevels = MeanTorrentConfig.meanTorrentConfig.torrentRecommendLevel; + + /** + * buildPager + */ + function buildPager() { + if (typeof $scope.parent.torrentBuildPager === 'function') { + $scope.parent.torrentBuildPager(); + } else if (typeof $scope.parent.buildPager === 'function') { + $scope.parent.buildPager(); + } + } + + /** + * getTagUsedStatus + * @param t + * @returns {boolean} + */ + vm.getTagUsedStatus = function (t) { + return $scope.parent.searchTags.indexOf(t) !== -1; + }; + + /** + * onTagClicked + * @param tag: tag name + */ + vm.onTagClicked = function (tag) { + if ($('#tag_' + tag) && $('#tag_' + tag).val()) { + $timeout(function () { + angular.element('#tag_' + tag).trigger('click'); + }, 10); + } else { + if ($scope.parent.searchTags.includes(tag)) { + $scope.parent.searchTags.splice($scope.parent.searchTags.indexOf(tag), 1); + } else { + $scope.parent.searchTags.push(tag); + } + buildPager(); + } + }; + + /** + * onReleaseClicked + * @param y + */ + vm.onReleaseClicked = function (y) { + if ($scope.parent.releaseYear === y) { + $scope.parent.releaseYear = undefined; + } else { + $scope.parent.releaseYear = y; + } + + buildPager(); + }; + + /** + * onTorrentTypeClicked + * @param t + */ + vm.onTorrentTypeClicked = function (t) { + if ($scope.parent.filterType === t) { + $scope.parent.filterType = undefined; + } else { + $scope.parent.filterType = t; + } + + buildPager(); + }; + + /** + * onRLevelClicked + * @param y + */ + vm.onRLevelClicked = function (l) { + if ($scope.parent.torrentRLevel === l) { + $scope.parent.torrentRLevel = 'level0'; + } else { + $scope.parent.torrentRLevel = l; + } + + buildPager(); + }; + + /** + * onHnRClicked + */ + vm.onHnRClicked = function () { + $scope.parent.filterHnR = !$scope.parent.filterHnR; + + buildPager(); + }; + + /** + * onSaleChanged + */ + vm.onSaleClicked = function () { + $scope.parent.filterSale = !$scope.parent.filterSale; + + buildPager(); + }; + + /** + * onVIPClicked, onVIPChanged + */ + vm.onVIPClicked = function () { + $scope.parent.filterVIP = !$scope.parent.filterVIP; + + buildPager(); + }; + + /** + * toggleTop + */ + vm.toggleTop = function (item) { + var dt = new TorrentsService(item); + dt.$toggleTopStatus(function (res) { + $scope.list[$scope.list.indexOf(item)] = res; + NotifycationService.showSuccessNotify('TORRENT_TOGGLE_TOP_SUCCESSFULLY'); + }, function (res) { + NotifycationService.showErrorNotify(res.data.message, 'TORRENT_TOGGLE_TOP_FAILED'); + }); + }; + + /** + * toggleHnR + */ + vm.toggleHnR = function (item) { + var dt = new TorrentsService(item); + dt.$toggleHnRStatus(function (res) { + $scope.list[$scope.list.indexOf(item)] = res; + NotifycationService.showSuccessNotify('TORRENT_TOGGLE_HNR_SUCCESSFULLY'); + }, function (res) { + NotifycationService.showErrorNotify(res.data.message, 'TORRENT_TOGGLE_HNR_FAILED'); + }); + }; + + /** + * toggleVIP + */ + vm.toggleVIP = function (item) { + var dt = new TorrentsService(item); + dt.$toggleVIPStatus(function (res) { + $scope.list[$scope.list.indexOf(item)] = res; + NotifycationService.showSuccessNotify('TORRENT_TOGGLE_VIP_SUCCESSFULLY'); + }, function (res) { + NotifycationService.showErrorNotify(res.data.message, 'TORRENT_TOGGLE_VIP_FAILED'); + }); + }; + + /** + * vm.setRecommendLevel + */ + vm.setRecommendLevel = function (item, rl) { + TorrentsService.setRecommendLevel({ + _torrentId: item._id, + _rlevel: rl.value + }, function (res) { + $scope.list[$scope.list.indexOf(item)] = res; + NotifycationService.showSuccessNotify('TORRENT_SETRLEVEL_SUCCESSFULLY'); + }, function (res) { + NotifycationService.showErrorNotify(res.data.message, 'TORRENT_SETRLEVEL_ERROR'); + }); + }; + + /** + * setSaleType + */ + vm.setSaleType = function (item, st) { + TorrentsService.setSaleType({ + _torrentId: item._id, + _saleType: st.name + }, function (res) { + $scope.list[$scope.list.indexOf(item)] = res; + NotifycationService.showSuccessNotify('TORRENT_SETSALETYPE_SUCCESSFULLY'); + }, function (res) { + NotifycationService.showErrorNotify(res.data.message, 'TORRENT_SETSALETYPE_ERROR'); + }); + }; + + /** + * deleteTorrent + */ + vm.deleteTorrent = function (item) { + var modalOptions = { + closeButtonText: $translate.instant('TORRENT_DELETE_CONFIRM_CANCEL'), + actionButtonText: $translate.instant('TORRENT_DELETE_CONFIRM_OK'), + headerText: $translate.instant('TORRENT_DELETE_CONFIRM_HEADER_TEXT'), + bodyText: $translate.instant('TORRENT_DELETE_CONFIRM_BODY_TEXT'), + bodyParams: item.torrent_filename, + + selectOptions: { + enable: true, + title: 'TORRENT_DELETE_REASON', + options: [ + 'TORRENT_DELETE_REASON_OVERVIEW', + 'TORRENT_DELETE_REASON_NFO', + 'TORRENT_DELETE_REASON_QUALITY', + 'TORRENT_DELETE_REASON_ILLEGAL' + ] + } + }; + + ModalConfirmService.showModal({}, modalOptions) + .then(function (result) { + var reason = result.reason; + if (reason === 'CUSTOM') reason = result.custom; + + var dt = new TorrentsService(item); + dt.$remove({ + reason: reason + }, function (response) { + successCallback(response); + }, function (errorResponse) { + errorCallback(errorResponse); + }); + + function successCallback(res) { + $scope.list.splice($scope.list.indexOf(item), 1); + NotifycationService.showSuccessNotify('TORRENT_DELETE_SUCCESSFULLY'); + } + + function errorCallback(res) { + NotifycationService.showErrorNotify(res.data.message, 'TORRENT_DELETE_ERROR'); + } + }); + }; + + /** + * reviewedTorrentStatus + * @param item + */ + vm.reviewedTorrentStatus = function (item) { + TorrentsService.setReviewedStatus({ + _torrentId: item._id + }, function (res) { + $scope.list[$scope.list.indexOf(item)] = res; + NotifycationService.showSuccessNotify('TORRENT_SETREVIEWED_SUCCESSFULLY'); + }, function (res) { + NotifycationService.showErrorNotify(res.data.message, 'TORRENT_SETREVIEWED_ERROR'); + }); + }; + + /** + * showByLabel + * @returns {boolean} + */ + vm.showByLabel = function () { + if (vm.state.current.name.startsWith('admin.torrents')) { + return true; + } else if (vm.state.current.name.indexOf('seeding') > 0) { + return true; + } else if (vm.state.current.name.indexOf('leeching') > 0) { + return true; + } else if (vm.state.current.name.indexOf('warning') > 0) { + return true; + } else if (vm.state.current.name.indexOf('downloading') > 0) { + return true; + } else { + return false; + } + }; + + /** + * showByUser + * @returns {boolean} + */ + vm.showByUser = function () { + if (vm.state.current.name.startsWith('admin.torrents')) { + return false; + } else if (vm.state.current.name.indexOf('seeding') > 0) { + return false; + } else if (vm.state.current.name.indexOf('leeching') > 0) { + return false; + } else if (vm.state.current.name.indexOf('warning') > 0) { + return false; + } else if (vm.state.current.name.indexOf('downloading') > 0) { + return false; + } else if (vm.state.current.name.startsWith('collections')) { + return false; + } else if (vm.state.current.name.startsWith('requests')) { + return false; + } else { + return true; + } + }; + + }]; + + return { + restrict: 'AE', + templateUrl: '/modules/torrents/client/templates/torrent-item.client.view.html', + controller: TorrentsItemController, + controllerAs: 'vm', + scope: { + item: '=', + list: '=', + peer: '=', + warning: '=', + parent: '=' + } + }; + } +}()); diff --git a/modules/core/client/less/btn-size.less b/modules/core/client/less/btn-size.less index 1de14495..1226af3f 100644 --- a/modules/core/client/less/btn-size.less +++ b/modules/core/client/less/btn-size.less @@ -108,6 +108,46 @@ min-width: 500px !important; } +.max-width-10 { + max-width: 10px !important; +} + +.max-width-20 { + max-width: 20px !important; +} + +.max-width-30 { + max-width: 30px !important; +} + +.max-width-40 { + max-width: 40px !important; +} + +.max-width-50 { + max-width: 50px !important; +} + +.max-width-60 { + max-width: 60px !important; +} + +.max-width-70 { + max-width: 70px !important; +} + +.max-width-80 { + max-width: 80px !important; +} + +.max-width-90 { + max-width: 90px !important; +} + +.max-width-100 { + max-width: 100px !important; +} + .max-width-300 { max-width: 300px !important; } diff --git a/modules/core/client/less/media-margin.less b/modules/core/client/less/media-margin.less new file mode 100644 index 00000000..5ba962dc --- /dev/null +++ b/modules/core/client/less/media-margin.less @@ -0,0 +1,7 @@ +@import (reference) "../../../core/client/less/mt-var.less"; + +.xs-margin-top-10 { + @media (max-width: @screen-xs-max) { + margin-top: 10px; + } +} diff --git a/modules/core/client/less/mt.less b/modules/core/client/less/mt.less index fd1f355b..23fdf247 100644 --- a/modules/core/client/less/mt.less +++ b/modules/core/client/less/mt.less @@ -438,6 +438,7 @@ body { color: #FF6600; > kbd { background-color: #FF6600; + font-size: 12px; } } @@ -908,6 +909,12 @@ body { .coll-item-remove { display: block; } + .warning-btn { + display: block; + } + .warning-data { + display: none; + } } .media-left { position: relative; @@ -918,8 +925,8 @@ body { > .td-text-overflow { .text-long { @media (min-width: @screen-lg-min) { - max-width: 570px; - min-width: 560px; + max-width: 550px; + min-width: 540px; } @media (max-width: @screen-md-max) { max-width: 420px; @@ -1064,14 +1071,15 @@ body { position: relative; .torrent-filename { margin-top: 2px; - font-size: 12px; + font-size: 13px; color: @gray-light; } .list-all-tags { - position: absolute; - bottom: 1px; + min-height: 52px; + margin-top: 10px; + width: 100%; .label { - margin-top: 3px; + margin-top: 5px; } span { position: relative; @@ -1089,13 +1097,23 @@ body { border: solid 1px #fff; } } + .label-torrent-link { + color: #8a8a8a; + border: solid 1px #dedede; + background-color: #fafafa; + &:hover { + color: #f00; + } + } } .media-heading { margin-bottom: 5px; } - .genres-item { + .list-all-genres { font-size: 12px; - color: @gray-light; + .genres-item { + color: @gray-light; + } } } .td-imdb { @@ -1115,7 +1133,10 @@ body { } .td-admin-cmd { min-width: 143px; - padding: 0 !important; + padding: 5px !important; + } + .warning-btn { + display: none; } } @@ -1216,6 +1237,7 @@ body { .label-tag { color: #0366d6; background-color: #f1f8ff; + border: solid 1px #ddeeff; &:hover { cursor: pointer; color: #f00; @@ -1226,6 +1248,7 @@ body { } .label-rlevel { + border: solid 1px darken(@brand-info, 2%); &:hover { cursor: pointer; color: #f00; @@ -1235,6 +1258,7 @@ body { .label-hnr-info { color: #eee; background-color: #333; + border: solid 1px #000; &:hover { cursor: pointer; color: #f00; @@ -1243,9 +1267,9 @@ body { } .label-vip-info { - color: @mt-base-color; - font-weight: bold; - background-color: #f1f8ff; + color: #fff; + background-color: @mt-base-color; + border: solid 1px darken(@mt-base-color, 2%); &:hover { cursor: pointer; color: #f00; @@ -1255,9 +1279,16 @@ body { } } +.upload-by { + color: #888; + background-color: #dedede; + border: solid 1px #8a8a8a; +} + .label-se-info { color: @mt-base-color; background-color: #f1f8ff; + border: solid 1px #ddeeff; &:hover { cursor: pointer; color: #f00; @@ -1265,6 +1296,7 @@ body { } .label-ttype { + border: solid 1px darken(@brand-primary, 2%); &:hover { cursor: pointer; color: #f00; @@ -1279,6 +1311,7 @@ body { } .label-sale { + border: solid 1px darken(@brand-success, 2%); &:hover { cursor: pointer; color: #f00; @@ -1286,6 +1319,17 @@ body { } .label-release { + border: solid 1px darken(@brand-warning, 2%); + &:hover { + cursor: pointer; + color: #f00; + } +} + +.torrent-top { + color: @mt-base-color; + border: solid 1px darken(@mt-base-color, 2%); + background-color: #fafafa; &:hover { cursor: pointer; color: #f00; @@ -1659,6 +1703,9 @@ body { padding: 15px 8px; } } + + tbody { + border-top: none; + } } } } @@ -1761,11 +1808,6 @@ body { padding-top: 5px; } -.upload-by { - color: #888; - font-size: 12px; -} - .status-avatar { border-radius: 3px; height: 44px; diff --git a/modules/requests/client/less/requests.less b/modules/requests/client/less/requests.less index 0868c70d..f479392c 100644 --- a/modules/requests/client/less/requests.less +++ b/modules/requests/client/less/requests.less @@ -84,6 +84,10 @@ margin-bottom: 0; tbody { tr { + td { + padding: 15px 8px; + } + .td-text-overflow { .text-long { @media (min-width: @screen-lg-min) { @@ -102,6 +106,9 @@ } } } + + tbody { + border-top: none; + } } } } @@ -162,16 +169,22 @@ } } +.add-warning { + font-size: 16px; + font-weight: 500; + margin-top: 10px; +} + .response-wrapper { margin-bottom: 30px; .response-list { .fa-accept { position: absolute; - top: -60px; - left: -100px; - font-size: 150px; + top: -10px; + left: 300px; + font-size: 120px; color: #d9534f; - opacity: 0.25; + opacity: 0.5; overflow: hidden; } .div-overlay-accept { @@ -180,7 +193,7 @@ background-color: rgba(128, 128, 128, 0.5); left: 95px; right: 15px; - height: 116px; + height: 130px; z-index: 5; font-size: 24px; font-weight: 500; @@ -191,8 +204,8 @@ background-color: #444 !important; background-color: rgba(128, 128, 128, 0.5) !important; } - span { - margin-top: 50%; + p { + margin-top: 15px; } } .btn-response-accept { diff --git a/modules/requests/client/views/requests-view.client.view.html b/modules/requests/client/views/requests-view.client.view.html index ca17cdf5..d66bc5b4 100644 --- a/modules/requests/client/views/requests-view.client.view.html +++ b/modules/requests/client/views/requests-view.client.view.html @@ -153,6 +153,7 @@ + @@ -165,136 +166,7 @@ - - - - - - - - - - - - +
{{ 'TABLE_FIELDS.INFO' | translate}} {{ 'TABLE_FIELDS.VOTES' | translate}} {{ 'TABLE_FIELDS.LIFETIME' | translate}}{{ 'TABLE_FIELDS.PUBLISHER' | translate}}
-
-
- {{vm.TGI.getTorrentTitle(item)}} - -
- -
-
-
-
- {{vm.TGI.getTorrentDoubleTitle(item)}} - -
- -
{{item.torrent_filename | filename}}
-
{{item.resource_detail_info.subtitle}}
- -
- {{t.name}} -
- -
- - - {{'TORRENT_TYPE_LABEL.' + item.torrent_type.toUpperCase() | translate}} - - - {{'TORRENT_STATUS_LABEL.' + item.torrent_status.toUpperCase() | translate}} - - - {{ item.resource_detail_info.release_date}} - - {{'STATUS_TOP_KEY' | translate}} - - {{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent_recommended.toUpperCase() | translate}} - - - {{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}} - - S{{item.torrent_seasons}}E{{item.torrent_episodes}} - - H&R - - VIP - - - - {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} - - -
- -
-
-
- {{vm.TGI.getVoteTitle(item)}} {{item.resource_detail_info.vote_average | number : 1}} - {{item.createdat | life}}{{item.torrent_size | bytes:2}} -
- - {{ 'ANONYMOUS' | translate }} -
-
- -
- -
-
- - -
-

{{ 'REQUESTS.WAITING_REVIEW' | translate}}

-
diff --git a/modules/torrents/client/controllers/admin/admin-list.client.controller.js b/modules/torrents/client/controllers/admin/admin-list.client.controller.js index a31cd6f3..908f48ee 100644 --- a/modules/torrents/client/controllers/admin/admin-list.client.controller.js +++ b/modules/torrents/client/controllers/admin/admin-list.client.controller.js @@ -22,7 +22,7 @@ vm.resourcesTags = MeanTorrentConfig.meanTorrentConfig.resourcesTags; vm.torrentSalesType = MeanTorrentConfig.meanTorrentConfig.torrentSalesType; vm.torrentRLevels = MeanTorrentConfig.meanTorrentConfig.torrentRecommendLevel; - vm.torrentType = MeanTorrentConfig.meanTorrentConfig.torrentType; + vm.torrentTypeConfig = MeanTorrentConfig.meanTorrentConfig.torrentType; vm.selectedType = localStorageService.get('admin_last_selected_type') || 'movie'; vm.filterVIP = isSelectedVipType(vm.selectedType); @@ -31,9 +31,12 @@ vm.releaseYear = undefined; vm.filterHnR = false; vm.filterSale = false; + vm.filterType = undefined; vm.torrentStatus = 'reviewed'; vm.torrentRLevel = 'level0'; + vm.torrentType = vm.selectedType === 'newest' ? 'all' : vm.selectedType; + /** * commentBuildPager * pagination init @@ -52,6 +55,8 @@ vm.searchTags = []; vm.filterVIP = isSelectedVipType(vm.selectedType); + vm.torrentType = vm.selectedType === 'newest' ? 'all' : vm.selectedType; + vm.torrentBuildPager(); localStorageService.set('admin_last_selected_type', vm.selectedType); }; @@ -63,7 +68,7 @@ */ function isSelectedVipType(type) { var v = false; - angular.forEach(vm.torrentType.value, function (t) { + angular.forEach(vm.torrentTypeConfig.value, function (t) { if (t.value === type) { if (t.role === 'vip') { v = true; @@ -204,7 +209,7 @@ keys: vm.searchKey.trim(), torrent_status: vm.selectedType === 'newest' ? 'new' : vm.torrentStatus, torrent_rlevel: vm.torrentRLevel, - torrent_type: vm.selectedType === 'newest' ? 'all' : vm.selectedType, + torrent_type: vm.filterType ? vm.filterType : (vm.torrentType === 'aggregate' ? 'all' : vm.torrentType), torrent_release: vm.releaseYear, torrent_tags: vm.searchTags, torrent_hnr: vm.filterHnR, @@ -343,162 +348,5 @@ i.removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); } }; - - /** - * toggleHnR - */ - vm.toggleHnR = function (item) { - var dt = new TorrentsService(item); - dt.$toggleHnRStatus(function (res) { - vm.torrentPagedItems[vm.torrentPagedItems.indexOf(item)] = res; - NotifycationService.showSuccessNotify('TORRENT_TOGGLE_HNR_SUCCESSFULLY'); - }, function (res) { - NotifycationService.showErrorNotify(res.data.message, 'TORRENT_TOGGLE_HNR_FAILED'); - }); - }; - - /** - * toggleVIP - */ - vm.toggleVIP = function (item) { - var dt = new TorrentsService(item); - dt.$toggleVIPStatus(function (res) { - vm.torrentPagedItems[vm.torrentPagedItems.indexOf(item)] = res; - NotifycationService.showSuccessNotify('TORRENT_TOGGLE_VIP_SUCCESSFULLY'); - }, function (res) { - NotifycationService.showErrorNotify(res.data.message, 'TORRENT_TOGGLE_VIP_FAILED'); - }); - }; - - /** - * toggleTop - */ - vm.toggleTop = function (item) { - var dt = new TorrentsService(item); - dt.$toggleTopStatus(function (res) { - vm.torrentPagedItems[vm.torrentPagedItems.indexOf(item)] = res; - NotifycationService.showSuccessNotify('TORRENT_TOGGLE_TOP_SUCCESSFULLY'); - }, function (res) { - NotifycationService.showErrorNotify(res.data.message, 'TORRENT_TOGGLE_TOP_FAILED'); - }); - }; - - /** - * deleteTorrent - */ - vm.deleteTorrent = function (item) { - var modalOptions = { - closeButtonText: $translate.instant('TORRENT_DELETE_CONFIRM_CANCEL'), - actionButtonText: $translate.instant('TORRENT_DELETE_CONFIRM_OK'), - headerText: $translate.instant('TORRENT_DELETE_CONFIRM_HEADER_TEXT'), - bodyText: $translate.instant('TORRENT_DELETE_CONFIRM_BODY_TEXT'), - bodyParams: item.torrent_filename, - - selectOptions: { - enable: true, - title: 'TORRENT_DELETE_REASON', - options: [ - 'TORRENT_DELETE_REASON_OVERVIEW', - 'TORRENT_DELETE_REASON_NFO', - 'TORRENT_DELETE_REASON_QUALITY', - 'TORRENT_DELETE_REASON_ILLEGAL' - ] - } - }; - - ModalConfirmService.showModal({}, modalOptions) - .then(function (result) { - var reason = result.reason; - if (reason === 'CUSTOM') reason = result.custom; - - var dt = new TorrentsService(item); - dt.$remove({ - reason: reason - }, function (response) { - successCallback(response); - }, function (errorResponse) { - errorCallback(errorResponse); - }); - - function successCallback(res) { - vm.torrentPagedItems.splice(vm.torrentPagedItems.indexOf(item), 1); - Notification.success({ - message: ' ' + $translate.instant('TORRENT_DELETE_SUCCESSFULLY') - }); - } - - function errorCallback(res) { - vm.error_msg = res.data.message; - Notification.error({ - message: res.data.message, - title: ' ' + $translate.instant('TORRENT_DELETE_ERROR') - }); - } - }); - }; - - - /** - * setSaleType - */ - vm.setSaleType = function (item, st) { - TorrentsService.setSaleType({ - _torrentId: item._id, - _saleType: st.name - }, function (res) { - Notification.success({ - message: ' ' + $translate.instant('TORRENT_SETSALETYPE_SUCCESSFULLY') - }); - - vm.torrentPagedItems[vm.torrentPagedItems.indexOf(item)] = res; - }, function (res) { - Notification.error({ - message: res.data.message, - title: ' ' + $translate.instant('TORRENT_SETSALETYPE_ERROR') - }); - }); - }; - - /** - * vm.setRecommendLevel - */ - vm.setRecommendLevel = function (item, rl) { - TorrentsService.setRecommendLevel({ - _torrentId: item._id, - _rlevel: rl.value - }, function (res) { - Notification.success({ - message: ' ' + $translate.instant('TORRENT_SETRLEVEL_SUCCESSFULLY') - }); - - vm.torrentPagedItems[vm.torrentPagedItems.indexOf(item)] = res; - }, function (res) { - Notification.error({ - message: res.data.message, - title: ' ' + $translate.instant('TORRENT_SETRLEVEL_ERROR') - }); - }); - }; - - /** - * reviewedTorrentStatus - * @param item - */ - vm.reviewedTorrentStatus = function (item) { - TorrentsService.setReviewedStatus({ - _torrentId: item._id - }, function (res) { - Notification.success({ - message: ' ' + $translate.instant('TORRENT_SETREVIEWED_SUCCESSFULLY') - }); - - vm.torrentPagedItems[vm.torrentPagedItems.indexOf(item)] = res; - }, function (res) { - Notification.error({ - message: res.data.message, - title: ' ' + $translate.instant('TORRENT_SETREVIEWED_ERROR') - }); - }); - }; } }()); diff --git a/modules/torrents/client/controllers/torrent-info.client.controller.js b/modules/torrents/client/controllers/torrent-info.client.controller.js index 7c7076a7..c14100e4 100644 --- a/modules/torrents/client/controllers/torrent-info.client.controller.js +++ b/modules/torrents/client/controllers/torrent-info.client.controller.js @@ -1000,6 +1000,9 @@ * @param minfo */ vm.doUpdateTorrentInfo = function (resinfo) { + resinfo.custom_title = vm.torrentLocalInfo.resource_detail_info.custom_title; + resinfo.custom_subtitle = vm.torrentLocalInfo.resource_detail_info.custom_subtitle; + vm.torrentLocalInfo.resource_detail_info = resinfo; vm.torrentLocalInfo.$update(function (response) { diff --git a/modules/torrents/client/controllers/uploads.client.controller.js b/modules/torrents/client/controllers/uploads.client.controller.js index e70a1dc8..4110e4af 100644 --- a/modules/torrents/client/controllers/uploads.client.controller.js +++ b/modules/torrents/client/controllers/uploads.client.controller.js @@ -320,6 +320,7 @@ vm.inputedEpisodesError = undefined; vm.inputedEpisodesOK = false; + vm.showResourceTitleInput = false; vm.showResourcesTag = false; vm.movieinfo = undefined; @@ -334,6 +335,22 @@ vm.showAgreeAndSubmit = false; }; + /** + * getTitleFromResourceFileName + * @param fname + * @returns {*} + */ + function getTitleFromResourceFileName(fname) { + if (fname) { + //replace other pt site prefix + fname = fname.replace(/^\{([^}]+)\}[\.\s]|^\{([^}]+)\}/, ''); + fname = fname.replace(/.torrent/g, ''); + return fname; + } else { + return ''; + } + } + /** * isSelectedVipType * @param type @@ -386,8 +403,12 @@ tmdbid: tmdbid, language: getStorageLangService.getLang() }, function (res) { + vm.customTorrent.title = getTitleFromResourceFileName(vm.torrentInfo.filename); + vm.customTorrent.subtitle = res.title; + vm.tmdb_info_ok = true; vm.tmdb_isloading = false; + vm.showResourceTitleInput = true; vm.showResourcesTag = true; vm.showVideoNfo = true; vm.showAgreeAndSubmit = true; @@ -428,6 +449,9 @@ tmdbid: tmdbid, language: getStorageLangService.getLang() }, function (res) { + vm.customTorrent.title = getTitleFromResourceFileName(vm.torrentInfo.filename); + vm.customTorrent.subtitle = res.name; + vm.tmdb_info_ok = true; vm.tmdb_isloading = false; Notification.success({ @@ -464,6 +488,7 @@ vm.inputedEpisodesError = false; vm.inputedEpisodesOK = true; vm.showResourcesTag = true; + vm.showResourceTitleInput = true; vm.showVideoNfo = true; vm.showAgreeAndSubmit = true; } @@ -496,6 +521,9 @@ var l = vm.getTorrentSize(); var t = vm.getResourceTag(); + vm.movieinfo.custom_title = vm.customTorrent.title; + vm.movieinfo.custom_subtitle = vm.customTorrent.subtitle; + var torrent = new TorrentsService({ info_hash: vm.torrentInfo.info_hash, maker: vm.maker === 'NULL' ? undefined : vm.maker, @@ -539,6 +567,9 @@ var l = vm.getTorrentSize(); var t = vm.getResourceTag(); + vm.tvinfo.custom_title = vm.customTorrent.title; + vm.tvinfo.custom_subtitle = vm.customTorrent.subtitle; + var torrent = new TorrentsService({ info_hash: vm.torrentInfo.info_hash, maker: vm.maker === 'NULL' ? undefined : vm.maker, @@ -588,6 +619,8 @@ artist: vm.customTorrent.artist || undefined, title: vm.customTorrent.title, subtitle: vm.customTorrent.subtitle, + custom_title: vm.customTorrent.title, + custom_subtitle: vm.customTorrent.subtitle, cover: vm.customTorrent.coverFileName, overview: vm.customTorrent.detail, diff --git a/modules/torrents/client/directives/torrent-file-link.client.directive.js b/modules/torrents/client/directives/torrent-file-link.client.directive.js index 73249799..6187b187 100644 --- a/modules/torrents/client/directives/torrent-file-link.client.directive.js +++ b/modules/torrents/client/directives/torrent-file-link.client.directive.js @@ -50,6 +50,59 @@ } } + //============================================================== + + angular.module('users') + .directive('torrentFileLinkLabel', torrentFileLinkLabel); + + torrentFileLinkLabel.$inject = ['$compile', '$translate', 'MeanTorrentConfig']; + + function torrentFileLinkLabel($compile, $translate, MeanTorrentConfig) { + var appConfig = MeanTorrentConfig.meanTorrentConfig.app; + + var directive = { + restrict: 'A', + link: link + }; + + return directive; + + function link(scope, element, attrs) { + scope.$watch(attrs.torrentFileLinkLabel, function (s) { + if (s) { + var torrent = s; + var user = scope.$eval(attrs.torrentUser); + + if (user && torrent) { + var link = makeTorrentFileLink(torrent, user); + var txt = $translate.instant('TORRENT_LABEL_LINK'); + var title = $translate.instant('COPY_LINK_TO_CLIPBOARD'); + var cls = attrs.infoClass; + var e = angular.element('' + txt + ''); + + if (e) { + e.addClass(cls ? cls : ''); + e.attr('title', title); + + element.html(e); + $compile(element.contents())(scope); + } + } + } + }); + } + + function makeTorrentFileLink(t, u) { + var link = appConfig.domain; + link += '/api/torrents/download'; + link += '/' + t._id; + link += '/' + u.passkey; + + return link; + } + } + + //================================================================ angular.module('users') .directive('torrentFileLinkButton', torrentFileLinkButton); diff --git a/modules/torrents/client/less/torrents.less b/modules/torrents/client/less/torrents.less index 1d042a0d..05542481 100644 --- a/modules/torrents/client/less/torrents.less +++ b/modules/torrents/client/less/torrents.less @@ -10,6 +10,7 @@ margin-bottom: 5px; color: #0366d6; background-color: #c9e4ff; + border: solid 1px #aad4ff; border-radius: 4px; padding: 5px 10px; position: relative; diff --git a/modules/torrents/client/services/torrent-get-info.client.service.js b/modules/torrents/client/services/torrent-get-info.client.service.js index b7559919..2bea4f45 100644 --- a/modules/torrents/client/services/torrent-get-info.client.service.js +++ b/modules/torrents/client/services/torrent-get-info.client.service.js @@ -18,6 +18,9 @@ getTorrentTitle: getTorrentTitle, getTorrentOriginalTitle: getTorrentOriginalTitle, getTorrentDoubleTitle: getTorrentDoubleTitle, + getTorrentCustomTitle: getTorrentCustomTitle, + getTorrentCustomSubTitle: getTorrentCustomSubTitle, + getTitleFromResourceFileName: getTitleFromResourceFileName, getTorrentListImage: getTorrentListImage, getTorrentListTopImage: getTorrentListTopImage, getTorrentTopOneImage: getTorrentTopOneImage, @@ -95,6 +98,56 @@ } } + /** + * getTorrentCustomTitle + * @param item + * @returns {*} + */ + function getTorrentCustomTitle(item) { + if (item.resource_detail_info.custom_title) { + return item.resource_detail_info.custom_title; + } else { + return getTitleFromResourceFileName(item.torrent_filename); + } + } + + /** + * getTorrentCustomSubTitle + * @param item + * @returns {*} + */ + function getTorrentCustomSubTitle(item) { + console.log(item); + if (item.resource_detail_info.custom_subtitle) { + return item.resource_detail_info.custom_subtitle; + } else if (item.resource_detail_info.subtitle) { + return item.resource_detail_info.subtitle; + } else { + return getTorrentDoubleTitle(item); + } + } + + /** + * getTitleFromResourceFileName + * @param fname + * @returns {*} + */ + function getTitleFromResourceFileName(fname) { + if (fname) { + var reg = /^\{([^}]+)\}[\.\s]|^\{([^}]+)\}/i; + //replace other pt site prefix + while (reg.test(fname)) { + fname = fname.replace(reg, ''); + } + + fname = fname.replace(/.torrent/g, ''); + + return fname; + } else { + return ''; + } + } + /** * getTorrentListImage * @param item diff --git a/modules/torrents/client/templates/torrent-item.client.view.html b/modules/torrents/client/templates/torrent-item.client.view.html new file mode 100644 index 00000000..268cda58 --- /dev/null +++ b/modules/torrents/client/templates/torrent-item.client.view.html @@ -0,0 +1,281 @@ + + + +
+
+ {{vm.TGI.getTorrentTitle(item)}} + +
+ +
+
+
+
+ +
+ +
{{vm.TGI.getTorrentCustomSubTitle(item)}}
+ + + + + +
+
+ + + {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} + + +
+ + + {{'TORRENT_TYPE_LABEL.' + item.torrent_type.toUpperCase() | translate}} + + + + {{ item.resource_detail_info.release_date}} + + + + {{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent_recommended.toUpperCase() | translate}} + + + + {{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}} + + + S{{item.torrent_seasons}}E{{item.torrent_episodes}} + + H&R + + VIP + + {{'STATUS_TOP_KEY' | translate}} + + + + + by: + + + + +
+ +
+
+ + + {{vm.TGI.getVoteTitle(item)}} {{item.resource_detail_info.vote_average | number : 1}} + + + {{item.createdat | life}} + {{item.torrent_size | bytes:2}} + +

+ + {{item.torrent_seeds}} +

+ +

+ + {{item.torrent_leechers}} +

+ +

+ + {{item.torrent_finished}} +

+ + +
+ + {{ 'ANONYMOUS' | translate }} + +
+ + +
+
+

+ {{peer.peer_uploaded | bytes:2}} +

+ +

+ {{peer.peer_uspeed | bytes:2}}/s +

+ +

+ {{peer.peer_ratio | ratio}} +

+
+
+

+ {{peer.peer_downloaded | bytes:2}} +

+ +

+ {{peer.peer_dspeed | bytes:2}}/s +

+ +

+ {{peer.peer_percent | ratio}}% +

+
+
+
+

+ {{warning.total_uploaded | bytes:2}} +

+ +

+ {{warning.total_downloaded | bytes:2}} +

+ +

+ {{warning.total_ratio | ratio}} +

+ +

+ {{warning.total_seed_time | seedlife}} +

+
+ +
+
+
+ + {{ 'ANONYMOUS' | translate }} +
+
+
+ +
+
+
+
+ + {{ 'ANONYMOUS' | translate }} +
+
+ +
+ +
+
+ + +
+
+
+ +
+
+ +
+
+ + +
+
+
+ + +
+
+
+
+ + +
+
+
+ +
+
+ + +

{{ 'REQUESTS.WAITING_REVIEW' | translate}}

+ + + + +
+ + diff --git a/modules/torrents/client/views/admin/admin-list.client.view.html b/modules/torrents/client/views/admin/admin-list.client.view.html index cdbe3ae5..b0c16fb5 100644 --- a/modules/torrents/client/views/admin/admin-list.client.view.html +++ b/modules/torrents/client/views/admin/admin-list.client.view.html @@ -55,7 +55,7 @@ @@ -198,6 +198,7 @@ + @@ -210,173 +211,7 @@ - - - - - - - - - - +
{{ 'TABLE_FIELDS.INFO' | translate}} {{ 'TABLE_FIELDS.VOTES' | translate}} {{ 'TABLE_FIELDS.LIFETIME' | translate}}{{ 'TABLE_FIELDS.ADMIN_TOOLS' | translate}}
-
-
- {{vm.TGI.getTorrentTitle(item)}} - -
- -
-
-
-
- {{vm.TGI.getTorrentDoubleTitle(item)}} - (By: - ) - -
- -
{{item.torrent_filename | filename}}
-
{{item.resource_detail_info.subtitle}}
- -
- {{t.name}} -
- -
- - - {{'TORRENT_TYPE_LABEL.' + item.torrent_type.toUpperCase() | translate}} - - - {{'TORRENT_STATUS_LABEL.' + item.torrent_status.toUpperCase() | translate}} - - - {{ item.resource_detail_info.release_date}} - - {{'STATUS_TOP_KEY' | translate}} - - {{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent_recommended.toUpperCase() | translate}} - - - {{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}} - - S{{item.torrent_seasons}}E{{item.torrent_episodes}} - - H&R - - VIP - - - - {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} - - -
-
-
-
- {{vm.TGI.getVoteTitle(item)}} {{item.resource_detail_info.vote_average | number : 1}} - {{item.createdat | life}}{{item.torrent_size | bytes:2}} -
- -
-
- -
-
- - -
-
-
- - -
-
-
-
- - -
-
-
- -
-
diff --git a/modules/torrents/client/views/list-torrents.client.view.html b/modules/torrents/client/views/list-torrents.client.view.html index 9e00f2c1..e3d39890 100644 --- a/modules/torrents/client/views/list-torrents.client.view.html +++ b/modules/torrents/client/views/list-torrents.client.view.html @@ -243,121 +243,7 @@ {{ 'TABLE_FIELDS.PUBLISHER' | translate}} - - - - -
-
- {{vm.TGI.getTorrentTitle(item)}} - -
- -
-
-
-
- {{vm.TGI.getTorrentDoubleTitle(item)}} - -
- -
{{item.torrent_filename | filename}}
-
{{item.resource_detail_info.subtitle}}
- -
- {{t.name}} -
- -
- - - {{'TORRENT_TYPE_LABEL.' + item.torrent_type.toUpperCase() | translate}} - - - {{ item.resource_detail_info.release_date}} - - {{'STATUS_TOP_KEY' | translate}} - - {{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent_recommended.toUpperCase() | translate}} - - - {{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}} - - - S{{item.torrent_seasons}}E{{item.torrent_episodes}} - - H&R - - VIP - - - - {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} - - -
-
-
- - - {{vm.TGI.getVoteTitle(item)}} {{item.resource_detail_info.vote_average | number : 1}} - - {{item.createdat | life}} - {{item.torrent_size | bytes:2}} - -

- - {{item.torrent_seeds}} -

- -

- - {{item.torrent_leechers}} -

- -

- - {{item.torrent_finished}} -

- - - - {{ 'ANONYMOUS' | translate }} - -
- - - - - - -
- - - + diff --git a/modules/torrents/client/views/search-torrents.client.view.html b/modules/torrents/client/views/search-torrents.client.view.html index 2124201f..af271cdf 100644 --- a/modules/torrents/client/views/search-torrents.client.view.html +++ b/modules/torrents/client/views/search-torrents.client.view.html @@ -4,6 +4,48 @@

{{'TAGS_SEARCH_GLOBAL' | translate}}

+
+
+ {{'TORRENT_TYPE_LABEL.' + vm.filterType.toUpperCase() | translate}} + + + + {{vm.releaseYear}} + + + + {{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + vm.torrentRLevel.toUpperCase() | translate}} + + + + {{ 'CA_TORRENT_SALE_NOW' | translate}} + + + + H&R + + + + VIP + + + + + {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} + + + + +
+
{{'CA_RESOURCE_TYPE' | translate}}
@@ -154,118 +196,8 @@ {{ 'TABLE_FIELDS.PUBLISHER' | translate}} + - - - -
-
- {{vm.TGI.getTorrentTitle(item)}} - -
- -
-
-
-
- {{vm.TGI.getTorrentDoubleTitle(item)}} - -
- -
{{item.torrent_filename | filename}}
-
{{item.resource_detail_info.subtitle}}
- -
- {{t.name}} -
- -
- - - {{'TORRENT_TYPE_LABEL.' + item.torrent_type.toUpperCase() | translate}} - - - {{ item.resource_detail_info.release_date}} - - {{'STATUS_TOP_KEY' | translate}} - - {{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent_recommended.toUpperCase() | translate}} - - - {{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}} - - - S{{item.torrent_seasons}}E{{item.torrent_episodes}} - - H&R - - VIP - - - - {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} - - -
-
-
- - - {{vm.TGI.getVoteTitle(item)}} {{item.resource_detail_info.vote_average | number : 1}} - - {{item.createdat | life}} - {{item.torrent_size | bytes:2}} - -

- - {{item.torrent_seeds}} -

- -

- - {{item.torrent_leechers}} -

- -

- - {{item.torrent_finished}} -

- - - - {{ 'ANONYMOUS' | translate }} - -
- - - - - - -
- - -
diff --git a/modules/torrents/client/views/uploads-torrents.client.view.html b/modules/torrents/client/views/uploads-torrents.client.view.html index 8660770e..b13e7acd 100644 --- a/modules/torrents/client/views/uploads-torrents.client.view.html +++ b/modules/torrents/client/views/uploads-torrents.client.view.html @@ -18,7 +18,7 @@
-
+
@@ -32,13 +32,14 @@
-
- +
+
-
+
-
+
@@ -294,6 +295,20 @@
+
+
+ +
+ +
+
+ +
+
+
+
@@ -480,8 +495,8 @@ ng-pattern="/(^[0-9]{1,4}$)|(^[0-9]{1,2}[\-]{1}[0-9]{1,4}$)/" ng-model="vm.inputedEpisodes" ng-disabled="vm.inputedEpisodesOK" required>
-
- +
+
+
+
+ +
+ +
+
+ +
+
+
+
@@ -557,17 +586,17 @@
-
+
+ maxlength="{{vm.inputLengthConfig.uploadTorrentTitleLength}}" autofocus>
-
-
- +
+
-
-
- +
+
@@ -676,12 +705,13 @@
-
- +
+
-
-
- +
+
diff --git a/modules/torrents/server/controllers/torrents.server.controller.js b/modules/torrents/server/controllers/torrents.server.controller.js index 3982760f..2de7082e 100644 --- a/modules/torrents/server/controllers/torrents.server.controller.js +++ b/modules/torrents/server/controllers/torrents.server.controller.js @@ -551,7 +551,7 @@ exports.download = function (req, res) { var user = req.user || req.passkeyuser || undefined; if (user) { - if (req.torrent.torrent_vip && !user.isVip) { + if (req.torrent.torrent_vip && !user.isVip && !user.isOper) { return res.status(701).send({ message: 'SERVER.ONLY_VIP_CAN_DOWNLOAD' }); @@ -563,7 +563,7 @@ exports.download = function (req, res) { return res.status(703).send({ message: 'SERVER.CAN_NOT_DOWNLOAD_IDLE' }); - } else if (req.torrent.torrent_status !== 'reviewed') { + } else if (req.torrent.torrent_status !== 'reviewed' && !user._id.equals(req.torrent.user._id)) { return res.status(704).send({ message: 'SERVER.TORRENT_STATUS_ERROR' }); @@ -1617,6 +1617,8 @@ exports.list = function (req, res) { {info_hash: {'$all': keysA}}, {'resource_detail_info.title': {'$all': keysA}}, {'resource_detail_info.subtitle': {'$all': keysA}}, + {'resource_detail_info.custom_title': {'$all': keysA}}, + {'resource_detail_info.custom_subtitle': {'$all': keysA}}, {'resource_detail_info.name': {'$all': keysA}}, {'resource_detail_info.original_title': {'$all': keysA}}, {'resource_detail_info.original_name': {'$all': keysA}} diff --git a/modules/torrents/server/models/complete.server.model.js b/modules/torrents/server/models/complete.server.model.js index e51514c4..8ccf5750 100644 --- a/modules/torrents/server/models/complete.server.model.js +++ b/modules/torrents/server/models/complete.server.model.js @@ -108,7 +108,7 @@ CompleteSchema.methods.globalUpdateMethod = function (callback) { */ CompleteSchema.methods.countHnRWarning = function (countAdd = true, countRemove = true) { if (this.complete) { - if (this.user.isVip || this.total_seed_time >= hnrConfig.condition.seedTime || this.total_downloaded === 0 || this.total_ratio >= hnrConfig.condition.ratio) { + if (this.user.isOper || this.user.isVip || this.total_seed_time >= hnrConfig.condition.seedTime || this.total_downloaded === 0 || this.total_ratio >= hnrConfig.condition.ratio) { if (countRemove) { if (this.hnr_warning) { this.update({ diff --git a/modules/users/client/controllers/admin/user-uploaded.client.controller.js b/modules/users/client/controllers/admin/user-uploaded.client.controller.js index ff15d076..b7036fdf 100644 --- a/modules/users/client/controllers/admin/user-uploaded.client.controller.js +++ b/modules/users/client/controllers/admin/user-uploaded.client.controller.js @@ -18,6 +18,12 @@ vm.itemsPerPageConfig = MeanTorrentConfig.meanTorrentConfig.itemsPerPage; vm.searchTags = []; + vm.releaseYear = undefined; + vm.filterType = undefined; + vm.filterHnR = false; + vm.filterSale = false; + vm.torrentRLevel = 'level0'; + vm.torrentType = 'aggregate'; /** * buildPager @@ -33,15 +39,18 @@ * figureOutItemsToDisplay */ vm.figureOutItemsToDisplay = function (callback) { - vm.filteredItems = $filter('filter')(vm.userUploadedList, { - $: vm.search - }); - vm.filterLength = vm.filteredItems.length; - var begin = ((vm.currentPage - 1) * vm.itemsPerPage); - var end = begin + vm.itemsPerPage; - vm.pagedItems = vm.filteredItems.slice(begin, end); + vm.tooltipMsg = 'VIP.VIP_TORRENTS_IS_LOADING'; + vm.getUserUploadedTorrent(vm.currentPage, function (items) { + vm.filterLength = items.total; + vm.pagedItems = items.rows; - if (callback) callback(); + if (vm.pagedItems.length === 0) { + vm.tooltipMsg = 'VIP.VIP_TORRENTS_IS_EMPTY'; + } else { + vm.tooltipMsg = undefined; + } + if (callback) callback(); + }); }; /** @@ -64,15 +73,25 @@ /** * getUserUploadedTorrent + * @param p + * @param callback */ - vm.getUserUploadedTorrent = function () { + vm.getUserUploadedTorrent = function (p, callback) { TorrentsService.get({ + skip: (p - 1) * vm.itemsPerPage, + limit: vm.itemsPerPage, userid: $state.params.userId, - torrent_type: 'all', - torrent_status: 'all' - }, function (items) { - vm.userUploadedList = items.rows; - vm.buildPager(); + torrent_type: vm.filterType ? vm.filterType : (vm.torrentType === 'aggregate' ? 'all' : vm.torrentType), + torrent_status: 'all', + torrent_vip: vm.filterVIP ? vm.filterVIP : undefined, + torrent_rlevel: vm.torrentRLevel, + torrent_release: vm.releaseYear, + torrent_tags: vm.searchTags, + torrent_hnr: vm.filterHnR, + torrent_sale: vm.filterSale + }, function (data) { + mtDebug.info(data); + callback(data); }, function (err) { Notification.error({ message: ' ' + $translate.instant('UPLOADED_LIST_ERROR') diff --git a/modules/users/client/controllers/status/uploaded.client.controller.js b/modules/users/client/controllers/status/uploaded.client.controller.js index ac11e959..37e021b0 100644 --- a/modules/users/client/controllers/status/uploaded.client.controller.js +++ b/modules/users/client/controllers/status/uploaded.client.controller.js @@ -9,7 +9,7 @@ 'MeanTorrentConfig', '$window', '$filter', 'DownloadService', 'DebugConsoleService', 'TorrentGetInfoServices', 'ResourcesTagsServices']; function UploadedController($scope, $state, $translate, $timeout, Authentication, Notification, TorrentsService, MeanTorrentConfig, - $window, $filter, DownloadService, mtDebug, TorrentGetInfoServices, ResourcesTagsServices) { + $window, $filter, DownloadService, mtDebug, TorrentGetInfoServices, ResourcesTagsServices) { var vm = this; vm.DLS = DownloadService; vm.TGI = TorrentGetInfoServices; @@ -18,6 +18,12 @@ vm.itemsPerPageConfig = MeanTorrentConfig.meanTorrentConfig.itemsPerPage; vm.searchTags = []; + vm.releaseYear = undefined; + vm.filterType = undefined; + vm.filterHnR = false; + vm.filterSale = false; + vm.torrentRLevel = 'level0'; + vm.torrentType = 'aggregate'; /** * buildPager @@ -33,15 +39,18 @@ * figureOutItemsToDisplay */ vm.figureOutItemsToDisplay = function (callback) { - vm.filteredItems = $filter('filter')(vm.uploadedList, { - $: vm.search - }); - vm.filterLength = vm.filteredItems.length; - var begin = ((vm.currentPage - 1) * vm.itemsPerPage); - var end = begin + vm.itemsPerPage; - vm.pagedItems = vm.filteredItems.slice(begin, end); + vm.tooltipMsg = 'VIP.VIP_TORRENTS_IS_LOADING'; + vm.getUploadedTorrent(vm.currentPage, function (items) { + vm.filterLength = items.total; + vm.pagedItems = items.rows; - if (callback) callback(); + if (vm.pagedItems.length === 0) { + vm.tooltipMsg = 'VIP.VIP_TORRENTS_IS_EMPTY'; + } else { + vm.tooltipMsg = undefined; + } + if (callback) callback(); + }); }; /** @@ -64,16 +73,25 @@ /** * getUploadedTorrent + * @param p + * @param callback */ - vm.getUploadedTorrent = function () { + vm.getUploadedTorrent = function (p, callback) { TorrentsService.get({ + skip: (p - 1) * vm.itemsPerPage, + limit: vm.itemsPerPage, userid: vm.user._id, - torrent_type: 'all', - torrent_status: 'all' - }, function (items) { - vm.uploadedList = items.rows; - mtDebug.info(items); - vm.buildPager(); + torrent_type: vm.filterType ? vm.filterType : (vm.torrentType === 'aggregate' ? 'all' : vm.torrentType), + torrent_status: 'all', + torrent_vip: vm.filterVIP ? vm.filterVIP : undefined, + torrent_rlevel: vm.torrentRLevel, + torrent_release: vm.releaseYear, + torrent_tags: vm.searchTags, + torrent_hnr: vm.filterHnR, + torrent_sale: vm.filterSale + }, function (data) { + mtDebug.info(data); + callback(data); }, function (err) { Notification.error({ message: ' ' + $translate.instant('UPLOADED_LIST_ERROR') diff --git a/modules/users/client/views/admin/user-leeching.client.view.html b/modules/users/client/views/admin/user-leeching.client.view.html index cce0654f..5941840c 100644 --- a/modules/users/client/views/admin/user-leeching.client.view.html +++ b/modules/users/client/views/admin/user-leeching.client.view.html @@ -3,7 +3,7 @@

- {{vm.user.displayName}} - {{'PAGETITLE.STATUS_DOWNLOADING' | translate}} + {{vm.user.displayName}} - {{'PAGETITLE.ADMIN_USER_LEECHING' | translate}}

@@ -28,131 +28,24 @@ + + - - - - - - - - - - - +
{{ 'TABLE_FIELDS.INFO' | translate}} {{ 'TABLE_FIELDS.VOTES' | translate}} {{ 'TABLE_FIELDS.LIFETIME' | translate}} {{ 'TABLE_FIELDS.SIZE' | translate}} + + {{ 'TABLE_FIELDS.SEEDS_LEECHERS_FINISHED' | translate}} + + {{ 'TABLE_FIELDS.DOWNLOADED_SPEED' | translate}} - - {{ 'TABLE_FIELDS.UPLOADED_RATIO_PERCENT' | translate}} - -
-
-
- {{vm.TGI.getTorrentTitle(item.torrent)}} - -
- -
-
-
-
- {{vm.TGI.getTorrentDoubleTitle(item.torrent)}} - (By: - ) - -
- -
{{item.torrent.torrent_filename | filename}}
-
{{item.torrent.resource_detail_info.subtitle}}
- -
- {{t.name}} -
- -
- - - {{'TORRENT_TYPE_LABEL.' + item.torrent.torrent_type.toUpperCase() | translate}} - - - {{'TORRENT_STATUS_LABEL.' + item.torrent.torrent_status.toUpperCase() | translate}} - - - {{ item.torrent.resource_detail_info.release_date}} - - {{'STATUS_TOP_KEY' | translate}} - - {{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent.torrent_recommended.toUpperCase() | translate}} - - - {{item.torrent.torrent_sale_status}} {{item.torrent.torrent_sale_expires | unlife}} - - S{{item.torrent.torrent_seasons}}E{{item.torrent.torrent_episodes}} - - H&R - - VIP - - - - {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} - - -
-
-
-
- {{vm.TGI.getVoteTitle(item.torrent)}} {{item.torrent.resource_detail_info.vote_average | number : 1}} - {{item.torrent.createdat | life}}{{item.torrent.torrent_size | bytes:2}} -

- {{item.peer_uploaded | bytes:2}} -

- -

- {{item.peer_ratio | ratio}} -

- -

- {{item.peer_percent}}% -

-
diff --git a/modules/users/client/views/admin/user-seeding.client.view.html b/modules/users/client/views/admin/user-seeding.client.view.html index 1031d7b5..733dc556 100644 --- a/modules/users/client/views/admin/user-seeding.client.view.html +++ b/modules/users/client/views/admin/user-seeding.client.view.html @@ -3,7 +3,7 @@

- {{vm.user.displayName}} - {{'PAGETITLE.STATUS_SEEDING' | translate}} + {{vm.user.displayName}} - {{'PAGETITLE.ADMIN_USER_SEEDING' | translate}}

@@ -28,127 +28,24 @@ + + - - - - - - - - - - - +
{{ 'TABLE_FIELDS.INFO' | translate}} {{ 'TABLE_FIELDS.VOTES' | translate}} {{ 'TABLE_FIELDS.LIFETIME' | translate}} {{ 'TABLE_FIELDS.SIZE' | translate}} + + {{ 'TABLE_FIELDS.SEEDS_LEECHERS_FINISHED' | translate}} + + {{ 'TABLE_FIELDS.UPLOADED_SPEED' | translate}} - - {{ 'TABLE_FIELDS.DOWNLOADED_RATIO' | translate}} - -
-
-
- {{vm.TGI.getTorrentTitle(item.torrent)}} - -
- -
-
-
-
- {{vm.TGI.getTorrentDoubleTitle(item.torrent)}} - (By: - ) - -
- -
{{item.torrent.torrent_filename | filename}}
-
{{item.torrent.resource_detail_info.subtitle}}
- -
- {{t.name}} -
- -
- - - {{'TORRENT_TYPE_LABEL.' + item.torrent.torrent_type.toUpperCase() | translate}} - - - {{'TORRENT_STATUS_LABEL.' + item.torrent.torrent_status.toUpperCase() | translate}} - - - {{ item.torrent.resource_detail_info.release_date}} - - {{'STATUS_TOP_KEY' | translate}} - - {{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent.torrent_recommended.toUpperCase() | translate}} - - - {{item.torrent.torrent_sale_status}} {{item.torrent.torrent_sale_expires | unlife}} - - S{{item.torrent.torrent_seasons}}E{{item.torrent.torrent_episodes}} - - H&R - - VIP - - - - {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} - - -
-
-
-
- {{vm.TGI.getVoteTitle(item.torrent)}} {{item.torrent.resource_detail_info.vote_average | number : 1}} - {{item.torrent.createdat | life}}{{item.torrent.torrent_size | bytes:2}} -

- {{item.peer_downloaded | bytes:2}} -

- -

- {{item.peer_ratio | ratio}} -

-
diff --git a/modules/users/client/views/admin/user-uplist.client.view.html b/modules/users/client/views/admin/user-uplist.client.view.html index d8849686..e87ada73 100644 --- a/modules/users/client/views/admin/user-uplist.client.view.html +++ b/modules/users/client/views/admin/user-uplist.client.view.html @@ -1,9 +1,9 @@ -
+

- {{vm.user.displayName}} - {{'PAGETITLE.STATUS_UPLOADED' | translate}} + {{vm.user.displayName}} - {{'PAGETITLE.ADMIN_USER_UPLIST' | translate}}

@@ -28,6 +28,7 @@ + @@ -40,113 +41,7 @@ - - - - - - - - - - +
{{ 'TABLE_FIELDS.INFO' | translate}} {{ 'TABLE_FIELDS.VOTES' | translate}} {{ 'TABLE_FIELDS.LIFETIME' | translate}}{{ 'TABLE_FIELDS.PUBLISHER' | translate}}
-
-
- {{vm.TGI.getTorrentTitle(item)}} - -
- -
-
-
-
- {{vm.TGI.getTorrentDoubleTitle(item)}} - -
- -
{{item.torrent_filename | filename}}
-
{{item.resource_detail_info.subtitle}}
- -
- {{t.name}} -
- -
- - - {{'TORRENT_TYPE_LABEL.' + item.torrent_type.toUpperCase() | translate}} - - - {{'TORRENT_STATUS_LABEL.' + item.torrent_status.toUpperCase() | translate}} - - - {{ item.resource_detail_info.release_date}} - - {{'STATUS_TOP_KEY' | translate}} - - {{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent_recommended.toUpperCase() | translate}} - - - {{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}} - - S{{item.torrent_seasons}}E{{item.torrent_episodes}} - - H&R - - VIP - - - - {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} - - -
-
-
-
- {{vm.TGI.getVoteTitle(item)}} {{item.resource_detail_info.vote_average | number : 1}} - {{item.createdat | life}}{{item.torrent_size | bytes:2}} - - -
- - -
diff --git a/modules/users/client/views/admin/user-warning.client.view.html b/modules/users/client/views/admin/user-warning.client.view.html index 9c79b6e9..702cb9a6 100644 --- a/modules/users/client/views/admin/user-warning.client.view.html +++ b/modules/users/client/views/admin/user-warning.client.view.html @@ -3,7 +3,7 @@

- {{vm.user.displayName}} - {{'PAGETITLE.STATUS_WARNING' | translate}} + {{vm.user.displayName}} - {{'PAGETITLE.ADMIN_USER_WARNING' | translate}}

@@ -28,131 +28,25 @@ + + - - - - - - - - - - - -
{{ 'TABLE_FIELDS.INFO' | translate}} {{ 'TABLE_FIELDS.VOTES' | translate}} {{ 'TABLE_FIELDS.LIFETIME' | translate}} {{ 'TABLE_FIELDS.SIZE' | translate}} + + {{ 'TABLE_FIELDS.SEEDS_LEECHERS_FINISHED' | translate}} + + {{ 'TABLE_FIELDS.UP_DOWN_RATIO_TIME' | translate}} - CMD -
-
-
- {{vm.TGI.getTorrentTitle(item.torrent)}} - -
- -
-
-
-
- {{vm.TGI.getTorrentDoubleTitle(item.torrent)}} - (By: - ) - -
- -
{{item.torrent.torrent_filename | filename}}
-
{{item.torrent.resource_detail_info.subtitle}}
- -
- {{t.name}} -
- -
- - - {{'TORRENT_TYPE_LABEL.' + item.torrent.torrent_type.toUpperCase() | translate}} - - - {{'TORRENT_STATUS_LABEL.' + item.torrent.torrent_status.toUpperCase() | translate}} - - - {{ item.torrent.resource_detail_info.release_date}} - - {{'STATUS_TOP_KEY' | translate}} - - {{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent.torrent_recommended.toUpperCase() | translate}} - - - {{item.torrent.torrent_sale_status}} {{item.torrent.torrent_sale_expires | unlife}} - - S{{item.torrent.torrent_seasons}}E{{item.torrent.torrent_episodes}} - - H&R - - VIP - - - - {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} - - -
-
-
-
- {{vm.TGI.getVoteTitle(item.torrent)}} {{item.torrent.resource_detail_info.vote_average | number : 1}} - {{item.torrent.createdat | life}}{{item.torrent.torrent_size | bytes:2}} - -
+ +
diff --git a/modules/users/client/views/status/downloading.client.view.html b/modules/users/client/views/status/downloading.client.view.html index 568a50a4..e2d7e80c 100644 --- a/modules/users/client/views/status/downloading.client.view.html +++ b/modules/users/client/views/status/downloading.client.view.html @@ -28,130 +28,24 @@ + + - - - - - - - - - - - +
{{ 'TABLE_FIELDS.INFO' | translate}} {{ 'TABLE_FIELDS.VOTES' | translate}} {{ 'TABLE_FIELDS.LIFETIME' | translate}} {{ 'TABLE_FIELDS.SIZE' | translate}} + + {{ 'TABLE_FIELDS.SEEDS_LEECHERS_FINISHED' | translate}} + + {{ 'TABLE_FIELDS.DOWNLOADED_SPEED' | translate}} - - {{ 'TABLE_FIELDS.UPLOADED_RATIO_PERCENT' | translate}} - -
-
-
- {{vm.TGI.getTorrentTitle(item.torrent)}} - -
- -
-
-
-
- {{vm.TGI.getTorrentDoubleTitle(item.torrent)}} - (By: - ) - -
- -
{{item.torrent.torrent_filename | filename}}
-
{{item.torrent.resource_detail_info.subtitle}}
- -
- {{t.name}} -
- -
- - - {{'TORRENT_TYPE_LABEL.' + item.torrent.torrent_type.toUpperCase() | translate}} - - - {{'TORRENT_STATUS_LABEL.' + item.torrent.torrent_status.toUpperCase() | translate}} - - - {{ item.torrent.resource_detail_info.release_date}} - - {{'STATUS_TOP_KEY' | translate}} - - {{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent.torrent_recommended.toUpperCase() | translate}} - - - {{item.torrent.torrent_sale_status}} {{item.torrent.torrent_sale_expires | unlife}} - - S{{item.torrent.torrent_seasons}}E{{item.torrent.torrent_episodes}} - - H&R - - VIP - - - - {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} - - -
-
-
-
- {{vm.TGI.getVoteTitle(item.torrent)}} {{item.torrent.resource_detail_info.vote_average | number : 1}} - {{item.torrent.createdat | life}}{{item.torrent.torrent_size | bytes:2}} -

- {{item.peer_uploaded | bytes:2}} -

- -

- {{item.peer_ratio | ratio}} -

- -

- {{item.peer_percent}}% -

-
diff --git a/modules/users/client/views/status/seeding.client.view.html b/modules/users/client/views/status/seeding.client.view.html index ac008f6a..411dfa53 100644 --- a/modules/users/client/views/status/seeding.client.view.html +++ b/modules/users/client/views/status/seeding.client.view.html @@ -28,126 +28,24 @@ + + - - - - - - - - - - - +
{{ 'TABLE_FIELDS.INFO' | translate}} {{ 'TABLE_FIELDS.VOTES' | translate}} {{ 'TABLE_FIELDS.LIFETIME' | translate}} {{ 'TABLE_FIELDS.SIZE' | translate}} + + {{ 'TABLE_FIELDS.SEEDS_LEECHERS_FINISHED' | translate}} + + {{ 'TABLE_FIELDS.UPLOADED_SPEED' | translate}} - - {{ 'TABLE_FIELDS.DOWNLOADED_RATIO' | translate}} - -
-
-
- {{vm.TGI.getTorrentTitle(item.torrent)}} - -
- -
-
-
-
- {{vm.TGI.getTorrentDoubleTitle(item.torrent)}} - (By: - ) - -
- -
{{item.torrent.torrent_filename | filename}}
-
{{item.torrent.resource_detail_info.subtitle}}
- -
- {{t.name}} -
- -
- - - {{'TORRENT_TYPE_LABEL.' + item.torrent.torrent_type.toUpperCase() | translate}} - - - {{'TORRENT_STATUS_LABEL.' + item.torrent.torrent_status.toUpperCase() | translate}} - - - {{ item.torrent.resource_detail_info.release_date}} - - {{'STATUS_TOP_KEY' | translate}} - - {{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent.torrent_recommended.toUpperCase() | translate}} - - - {{item.torrent.torrent_sale_status}} {{item.torrent.torrent_sale_expires | unlife}} - - S{{item.torrent.torrent_seasons}}E{{item.torrent.torrent_episodes}} - - H&R - - VIP - - - - {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} - - -
-
-
-
- {{vm.TGI.getVoteTitle(item.torrent)}} {{item.torrent.resource_detail_info.vote_average | number : 1}} - {{item.torrent.createdat | life}}{{item.torrent.torrent_size | bytes:2}} -

- {{item.peer_downloaded | bytes:2}} -

- -

- {{item.peer_ratio | ratio}} -

-
diff --git a/modules/users/client/views/status/uploaded.client.view.html b/modules/users/client/views/status/uploaded.client.view.html index 65288575..2c50443c 100644 --- a/modules/users/client/views/status/uploaded.client.view.html +++ b/modules/users/client/views/status/uploaded.client.view.html @@ -1,4 +1,4 @@ -
+
@@ -28,6 +28,7 @@ + @@ -40,113 +41,7 @@ - - - - - - - - - - +
{{ 'TABLE_FIELDS.INFO' | translate}} {{ 'TABLE_FIELDS.VOTES' | translate}} {{ 'TABLE_FIELDS.LIFETIME' | translate}}{{ 'TABLE_FIELDS.PUBLISHER' | translate}}
-
-
- {{vm.TGI.getTorrentTitle(item)}} - -
- -
-
-
-
- {{vm.TGI.getTorrentDoubleTitle(item)}} - -
- -
{{item.torrent_filename | filename}}
-
{{item.resource_detail_info.subtitle}}
- -
- {{t.name}} -
- -
- - - {{'TORRENT_TYPE_LABEL.' + item.torrent_type.toUpperCase() | translate}} - - - {{'TORRENT_STATUS_LABEL.' + item.torrent_status.toUpperCase() | translate}} - - - {{ item.resource_detail_info.release_date}} - - {{'STATUS_TOP_KEY' | translate}} - - {{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent_recommended.toUpperCase() | translate}} - - - {{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}} - - S{{item.torrent_seasons}}E{{item.torrent_episodes}} - - H&R - - VIP - - - - {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} - - -
-
-
-
- {{vm.TGI.getVoteTitle(item)}} {{item.resource_detail_info.vote_average | number : 1}} - {{item.createdat | life}}{{item.torrent_size | bytes:2}} - - -
- - -
diff --git a/modules/users/client/views/status/warning.client.view.html b/modules/users/client/views/status/warning.client.view.html index e2e4dd23..93bec93f 100644 --- a/modules/users/client/views/status/warning.client.view.html +++ b/modules/users/client/views/status/warning.client.view.html @@ -18,131 +18,27 @@
- +
+ + - - - - - - - - - - - +
{{ 'TABLE_FIELDS.INFO' | translate}} {{ 'TABLE_FIELDS.VOTES' | translate}} {{ 'TABLE_FIELDS.LIFETIME' | translate}} {{ 'TABLE_FIELDS.SIZE' | translate}} + + {{ 'TABLE_FIELDS.SEEDS_LEECHERS_FINISHED' | translate}} + + {{ 'TABLE_FIELDS.UP_DOWN_RATIO_TIME' | translate}} - CMD -
-
-
- {{vm.TGI.getTorrentTitle(item.torrent)}} - -
- -
-
-
-
- {{vm.TGI.getTorrentDoubleTitle(item.torrent)}} - (By: - ) - -
- -
{{item.torrent.torrent_filename | filename}}
-
{{item.torrent.resource_detail_info.subtitle}}
- -
- {{t.name}} -
- -
- - - {{'TORRENT_TYPE_LABEL.' + item.torrent.torrent_type.toUpperCase() | translate}} - - - {{'TORRENT_STATUS_LABEL.' + item.torrent.torrent_status.toUpperCase() | translate}} - - - {{ item.torrent.resource_detail_info.release_date}} - - {{'STATUS_TOP_KEY' | translate}} - - {{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent.torrent_recommended.toUpperCase() | translate}} - - - {{item.torrent.torrent_sale_status}} {{item.torrent.torrent_sale_expires | unlife}} - - S{{item.torrent.torrent_seasons}}E{{item.torrent.torrent_episodes}} - - H&R - - VIP - - - - {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} - - -
-
-
-
- {{vm.TGI.getVoteTitle(item.torrent)}} {{item.torrent.resource_detail_info.vote_average | number : 1}} - {{item.torrent.createdat | life}}{{item.torrent.torrent_size | bytes:2}} - -
diff --git a/modules/vip/client/controllers/vip.client.controller.js b/modules/vip/client/controllers/vip.client.controller.js index 6553e790..98203ab7 100644 --- a/modules/vip/client/controllers/vip.client.controller.js +++ b/modules/vip/client/controllers/vip.client.controller.js @@ -268,6 +268,7 @@ torrent_vip: true, keys: vm.searchKey.trim(), + torrent_rlevel: vm.torrentRLevel, torrent_release: vm.releaseYear, torrent_tags: vm.searchTags, torrent_hnr: vm.filterHnR, @@ -382,6 +383,7 @@ vm.releaseYear = undefined; vm.filterHnR = false; vm.filterSale = false; + vm.torrentRLevel = 'level0'; vm.buildPager(); }; diff --git a/modules/vip/client/views/vip.client.view.html b/modules/vip/client/views/vip.client.view.html index 0f8ba10e..7ef3d7c9 100644 --- a/modules/vip/client/views/vip.client.view.html +++ b/modules/vip/client/views/vip.client.view.html @@ -162,7 +162,9 @@
-
{{'CA_MAKE_RSS_URL' | translate}}:
+
{{'CA_MAKE_RSS_URL' | translate}}: +
{{'DESC_MAKE_RSS_URL' | translate}}
{{vm.rssUrl}} @@ -226,122 +228,16 @@ {{ 'TABLE_FIELDS.PUBLISHER' | translate}} - - + +

{{vm.tooltipMsg | translate}}

- - - -
-
- {{vm.TGI.getTorrentTitle(item)}} - -
- -
-
-
-
- {{vm.TGI.getTorrentDoubleTitle(item)}} - -
- -
{{item.torrent_filename | filename}}
-
{{item.resource_detail_info.subtitle}}
- -
- {{t.name}} -
- -
- - {{ item.resource_detail_info.release_date}} - - {{'STATUS_TOP_KEY' | translate}} - - {{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent_recommended.toUpperCase() | translate}} - - - {{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}} - - S{{item.torrent_seasons}}E{{item.torrent_episodes}} - - H&R - - VIP - - - - {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} - - -
-
-
- - - {{vm.TGI.getVoteTitle(item)}} {{item.resource_detail_info.vote_average | number : 1}} - - {{item.createdat | life}} - {{item.torrent_size | bytes:2}} - -

- - {{item.torrent_seeds}} -

- -

- - {{item.torrent_leechers}} -

- -

- - {{item.torrent_finished}} -

- - - - {{ 'ANONYMOUS' | translate }} - -
- - - - - - -
- - +
From 979038a38142b2da5de67ddbebb6190647bac544 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Sat, 12 May 2018 03:00:10 +0800 Subject: [PATCH 06/96] fix(torrents): remove default tmdb config value --- config/env/torrents.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/env/torrents.js b/config/env/torrents.js index 5db83830..f02dc368 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -1186,7 +1186,7 @@ module.exports = { * @resourcesLanguage: settings for language of dropdown resource info */ tmdbConfig: { - key: '7888f0042a366f63289ff571b68b7ce0', + key: 'this is access key from tmdb', tmdbHome: 'https://www.themoviedb.org', tmdbMovieLinkUrl: 'https://www.themoviedb.org/movie/', tmdbTvserialLinkUrl: 'https://www.themoviedb.org/tv/', From 78478b8e9ff791154061fc9975d12968e2f9e7ad Mon Sep 17 00:00:00 2001 From: OldHawk Date: Sat, 12 May 2018 03:42:55 +0800 Subject: [PATCH 07/96] fix(torrents): css of torrent list --- modules/core/client/less/mt.less | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/core/client/less/mt.less b/modules/core/client/less/mt.less index 23fdf247..661596cd 100644 --- a/modules/core/client/less/mt.less +++ b/modules/core/client/less/mt.less @@ -1076,7 +1076,7 @@ body { } .list-all-tags { min-height: 52px; - margin-top: 10px; + margin-top: 8px; width: 100%; .label { margin-top: 5px; @@ -1107,6 +1107,7 @@ body { } } .media-heading { + line-height: 1.2; margin-bottom: 5px; } .list-all-genres { From f46fa8215129aea77d826d9b6ef02dee3c9604a9 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Sat, 12 May 2018 11:21:22 +0800 Subject: [PATCH 08/96] fix(core): change languages order --- config/env/torrents.js | 4 ++-- modules/core/client/views/footer.client.view.html | 2 +- modules/core/client/views/header.client.view.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/env/torrents.js b/config/env/torrents.js index 0c201d9a..060a31f4 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -84,8 +84,8 @@ module.exports = { * */ language: [ - {name: 'zh', index: 0, class: 'flag-icon-cn', title: '中文'}, - {name: 'en', index: 1, class: 'flag-icon-gb', title: 'English'}, + {name: 'en', index: 0, class: 'flag-icon-gb', title: 'English'}, + {name: 'zh', index: 1, class: 'flag-icon-cn', title: '中文'}, {name: 'zh-tw', index: 2, class: 'flag-icon-tw', title: '繁體中文'} ], diff --git a/modules/core/client/views/footer.client.view.html b/modules/core/client/views/footer.client.view.html index fae498d4..b9ca8778 100644 --- a/modules/core/client/views/footer.client.view.html +++ b/modules/core/client/views/footer.client.view.html @@ -36,7 +36,7 @@
  • + ng-repeat="l in vm.language">
  • diff --git a/modules/core/client/views/header.client.view.html b/modules/core/client/views/header.client.view.html index 9cbed53e..b496259e 100644 --- a/modules/core/client/views/header.client.view.html +++ b/modules/core/client/views/header.client.view.html @@ -58,7 +58,7 @@
  • + ng-repeat="l in vm.language">
  • From a96abac21a416676c34584a2176ace0f7f6b47a5 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Sat, 12 May 2018 12:34:08 +0800 Subject: [PATCH 09/96] feat(torrents): add torrent top status filter --- .../controllers/about.client.controller.js | 4 +++- modules/core/client/app/trans-string-en.js | 1 + modules/core/client/app/trans-string-zh-tw.js | 1 + modules/core/client/app/trans-string-zh.js | 1 + .../torrent-list-item.client.directive.js | 8 ++++++++ .../admin/admin-list.client.controller.js | 16 +++++++++++++++- .../controllers/torrents.client.controller.js | 17 ++++++++++++++++- .../services/torrent-get-info.client.service.js | 1 - .../templates/torrent-item.client.view.html | 4 ++-- .../views/admin/admin-list.client.view.html | 16 +++++++++++++++- .../client/views/list-torrents.client.view.html | 16 +++++++++++++++- .../admin/user-uploaded.client.controller.js | 4 +++- .../status/uploaded.client.controller.js | 4 +++- .../client/controllers/vip.client.controller.js | 17 ++++++++++++++++- modules/vip/client/views/vip.client.view.html | 16 +++++++++++++++- 15 files changed, 114 insertions(+), 12 deletions(-) diff --git a/modules/about/client/controllers/about.client.controller.js b/modules/about/client/controllers/about.client.controller.js index a9156b46..ab2b8f4c 100644 --- a/modules/about/client/controllers/about.client.controller.js +++ b/modules/about/client/controllers/about.client.controller.js @@ -46,6 +46,7 @@ vm.searchKey = ''; vm.releaseYear = undefined; vm.filterHnR = false; + vm.filterTop = false; vm.filterSale = false; vm.torrentRLevel = 'level0'; @@ -286,7 +287,8 @@ torrent_release: vm.releaseYear, torrent_tags: vm.searchTags, torrent_hnr: vm.filterHnR, - torrent_sale: vm.filterSale + torrent_sale: vm.filterSale, + isTop: vm.filterTop }, function (data) { mtDebug.info(data); callback(data); diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 2dba28d7..4b9b22a6 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -337,6 +337,7 @@ CA_TORRENT_SALE_STATUS: 'Sale Status', CA_TORRENT_SALE_NOW: 'Saling', CA_TORRENT_VIP: 'VIP resources', + CA_TORRENT_TOP: 'Top Status', CA_RESOURCE_TYPE: 'Resource type', CA_MAKE_RSS_URL: 'Rss Url', DESC_MAKE_RSS_URL: 'This RSS url is make with above filter conditions, you can used it in the BT client (such as uTorrent) that supports the RSS subscription function to download torrent and resources automatic.', diff --git a/modules/core/client/app/trans-string-zh-tw.js b/modules/core/client/app/trans-string-zh-tw.js index 01fb4b62..934e362e 100644 --- a/modules/core/client/app/trans-string-zh-tw.js +++ b/modules/core/client/app/trans-string-zh-tw.js @@ -340,6 +340,7 @@ CA_TORRENT_SALE_STATUS: '促銷狀態', CA_TORRENT_SALE_NOW: '正在促銷', CA_TORRENT_VIP: 'VIP 資源', + CA_TORRENT_TOP: '置頂狀態', CA_RESOURCE_TYPE: '資源型別', CA_MAKE_RSS_URL: 'RSS連線', DESC_MAKE_RSS_URL: '這個 RSS 地址是通過上面的過濾條件生成的,您可以使用支援 RSS 訂閱功能的BT客戶端(如uTorrent)來自動下載您想要的這些種子和資原始檔.', diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index 8a8d2bcf..9b050a89 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -337,6 +337,7 @@ CA_TORRENT_SALE_STATUS: '促销状态', CA_TORRENT_SALE_NOW: '正在促销', CA_TORRENT_VIP: 'VIP 资源', + CA_TORRENT_TOP: '置顶状态', CA_RESOURCE_TYPE: '资源类型', CA_MAKE_RSS_URL: 'RSS连接', DESC_MAKE_RSS_URL: '这个 RSS 地址是通过上面的过滤条件生成的,您可以使用支持 RSS 订阅功能的BT客户端(如uTorrent)来自动下载您想要的这些种子和资源文件.', diff --git a/modules/core/client/directives/torrent-list-item.client.directive.js b/modules/core/client/directives/torrent-list-item.client.directive.js index 7755ad5b..a1074e3d 100644 --- a/modules/core/client/directives/torrent-list-item.client.directive.js +++ b/modules/core/client/directives/torrent-list-item.client.directive.js @@ -127,6 +127,14 @@ buildPager(); }; + /** + * onTopClicked, onTopChanged + */ + vm.onTopClicked = function () { + $scope.parent.filterTop = !$scope.parent.filterTop; + buildPager(); + }; + /** * toggleTop */ diff --git a/modules/torrents/client/controllers/admin/admin-list.client.controller.js b/modules/torrents/client/controllers/admin/admin-list.client.controller.js index 908f48ee..41199f33 100644 --- a/modules/torrents/client/controllers/admin/admin-list.client.controller.js +++ b/modules/torrents/client/controllers/admin/admin-list.client.controller.js @@ -31,6 +31,7 @@ vm.releaseYear = undefined; vm.filterHnR = false; vm.filterSale = false; + vm.filterTop = false; vm.filterType = undefined; vm.torrentStatus = 'reviewed'; vm.torrentRLevel = 'level0'; @@ -214,7 +215,8 @@ torrent_tags: vm.searchTags, torrent_hnr: vm.filterHnR, torrent_vip: vm.filterVIP ? vm.filterVIP : undefined, - torrent_sale: vm.filterSale + torrent_sale: vm.filterSale, + isTop: vm.filterTop }, function (items) { if (items.length === 0) { Notification.error({ @@ -242,6 +244,7 @@ vm.releaseYear = undefined; vm.filterHnR = false; vm.filterSale = false; + vm.filterTop = false; vm.torrentStatus = 'reviewed'; vm.torrentRLevel = 'level0'; @@ -318,6 +321,17 @@ vm.torrentBuildPager(); }; + /** + * onTopClicked, onTopChanged + */ + vm.onTopClicked = function () { + vm.filterTop = !vm.filterTop; + vm.torrentBuildPager(); + }; + vm.onTopChanged = function () { + vm.torrentBuildPager(); + }; + /** * onRLevelClicked * @param y diff --git a/modules/torrents/client/controllers/torrents.client.controller.js b/modules/torrents/client/controllers/torrents.client.controller.js index 148cf0ee..9bf4caf9 100644 --- a/modules/torrents/client/controllers/torrents.client.controller.js +++ b/modules/torrents/client/controllers/torrents.client.controller.js @@ -28,6 +28,7 @@ vm.releaseYear = undefined; vm.filterType = undefined; vm.filterHnR = false; + vm.filterTop = false; vm.filterSale = false; vm.topItems = 6; vm.torrentRLevel = 'level0'; @@ -307,7 +308,8 @@ torrent_release: vm.releaseYear, torrent_tags: vm.searchTags, torrent_hnr: vm.filterHnR, - torrent_sale: vm.filterSale + torrent_sale: vm.filterSale, + isTop: vm.filterTop }, function (items) { if (items.length === 0) { Notification.error({ @@ -336,6 +338,7 @@ vm.rssUrl += vm.releaseYear ? '&torrent_release=' + vm.releaseYear : ''; vm.rssUrl += vm.searchTags.length ? '&torrent_tags=' + vm.searchTags : ''; vm.rssUrl += '&torrent_hnr=' + vm.filterHnR; + vm.rssUrl += '&isTop=' + vm.filterTop; vm.rssUrl += vm.filterSale ? '&torrent_sale=' + vm.filterSale : ''; }; @@ -348,6 +351,7 @@ $('.btn-tag').removeClass('btn-success').addClass('btn-default'); vm.releaseYear = undefined; vm.filterHnR = false; + vm.filterTop = false; vm.filterSale = false; vm.torrentRLevel = 'level0'; vm.filterType = undefined; @@ -415,6 +419,17 @@ vm.torrentBuildPager(); }; + /** + * onTopClicked, onTopChanged + */ + vm.onTopClicked = function () { + vm.filterTop = !vm.filterTop; + vm.torrentBuildPager(); + }; + vm.onTopChanged = function () { + vm.torrentBuildPager(); + }; + /** * onSaleChanged */ diff --git a/modules/torrents/client/services/torrent-get-info.client.service.js b/modules/torrents/client/services/torrent-get-info.client.service.js index 2bea4f45..40fa058d 100644 --- a/modules/torrents/client/services/torrent-get-info.client.service.js +++ b/modules/torrents/client/services/torrent-get-info.client.service.js @@ -117,7 +117,6 @@ * @returns {*} */ function getTorrentCustomSubTitle(item) { - console.log(item); if (item.resource_detail_info.custom_subtitle) { return item.resource_detail_info.custom_subtitle; } else if (item.resource_detail_info.subtitle) { diff --git a/modules/torrents/client/templates/torrent-item.client.view.html b/modules/torrents/client/templates/torrent-item.client.view.html index 268cda58..c080ee13 100644 --- a/modules/torrents/client/templates/torrent-item.client.view.html +++ b/modules/torrents/client/templates/torrent-item.client.view.html @@ -76,8 +76,8 @@ VIP - {{'STATUS_TOP_KEY' | translate}} diff --git a/modules/torrents/client/views/admin/admin-list.client.view.html b/modules/torrents/client/views/admin/admin-list.client.view.html index b0c16fb5..3b935acc 100644 --- a/modules/torrents/client/views/admin/admin-list.client.view.html +++ b/modules/torrents/client/views/admin/admin-list.client.view.html @@ -5,7 +5,7 @@
    + ng-if="vm.filterType || vm.releaseYear || vm.torrentRLevel != 'level0' || vm.filterSale || vm.filterHnR || vm.searchTags.length>0 || vm.filterVIP || vm.filterTop">
    {{'TORRENT_TYPE_LABEL.' + vm.filterType.toUpperCase() | translate}} + {{'STATUS_TOP_KEY' | translate}} + + + {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} +
    {{ 'CA_TORRENT_TOP' | translate}}:
    +
    +
    + +
    +
    +
    {{ 'CA_TORRENT_STATUS' | translate}}:
    diff --git a/modules/torrents/client/views/list-torrents.client.view.html b/modules/torrents/client/views/list-torrents.client.view.html index e3d39890..200b45f4 100644 --- a/modules/torrents/client/views/list-torrents.client.view.html +++ b/modules/torrents/client/views/list-torrents.client.view.html @@ -72,7 +72,7 @@
    + ng-if="vm.filterType || vm.releaseYear || vm.torrentRLevel != 'level0' || vm.filterSale || vm.filterHnR || vm.filterTop || vm.searchTags.length>0">
    {{'TORRENT_TYPE_LABEL.' + vm.filterType.toUpperCase() | translate}} + {{'STATUS_TOP_KEY' | translate}} + + + {{ 'RESOURCESTAGS.' + vm.RTS.getTagTitle(t) + '.' + t.toUpperCase() | translate}} +
    {{ 'CA_TORRENT_TOP' | translate}}:
    +
    +
    + +
    +
    +