diff --git a/config/env/torrents.js b/config/env/torrents.js index 6d2098a0..01c21140 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -18,7 +18,7 @@ module.exports = { name: 'TYPE', value: [ {name: 'MOVIE', value: 'movie'}, - {name: 'MTV', value: 'MTV'}, + {name: 'TVSERIES', value: 'tvseries'}, {name: 'MUSIC', value: 'music'}, {name: 'OTHER', value: 'other'} ] @@ -90,7 +90,9 @@ module.exports = { } }, tmdbConfig: { - tmdb_link_url: 'https://www.themoviedb.org/movie/', + tmdb_home: 'https://www.themoviedb.org', + tmdb_movie_link_url: 'https://www.themoviedb.org/movie/', + tmdb_tv_link_url: 'https://www.themoviedb.org/tv/', //please change it to your api key from themoviedb.org key: '7888f0042a366f63289ff571b68b7ce0', backdrop_img_base_url: 'http://image.tmdb.org/t/p/w1280', @@ -176,7 +178,76 @@ module.exports = { ] } ] - } + }, + tv: { + radio: [ + { + name: 'TYPE', + value: [ + {name: 'BLU_RAY', icon: ''}, + {name: 'REMUX', icon: ''}, + {name: 'ENCODE', icon: ''} + ] + }, + { + name: 'RESOLUTION', + value: [ + {name: 'S4K', icon: ''}, + {name: 'S1080P', icon: ''}, + {name: 'S720P', icon: ''} + ] + }, + { + name: 'VIDEO', + value: [ + {name: 'AVC', icon: ''}, + {name: 'X265', icon: ''}, + {name: 'X264', icon: ''} + ] + }, + { + name: 'AUDIO', + value: [ + {name: 'AAC', icon: ''}, + {name: 'DTS', icon: ''}, + {name: 'DTS_HD', icon: ''}, + {name: 'ATMOS_TRUEHD', icon: ''} + ] + }, + { + name: 'REGION', + value: [ + {name: 'USA', icon: ''}, + {name: 'CHINA', icon: ''}, + {name: 'JAPAN', icon: ''}, + {name: 'KOREA', icon: ''}, + {name: 'INDIA', icon: ''}, + {name: 'ARAB', icon: ''} + ] + } + ], + checkbox: [ + { + name: 'RANKING', + value: [ + {name: 'IMDB_TOP100', icon: ''}, + {name: 'IMDB_TOP250', icon: ''}, + {name: 'DOUBAN_TOP100', icon: ''}, + {name: 'DOUBAN_TOP250', icon: ''} + ] + }, + { + name: 'MODIFY', + value: [ + {name: 'DIY', icon: ''}, + {name: 'GUOPEI', icon: ''}, + {name: 'ZHONGZI', icon: ''} + ] + } + ] + }, + music: {}, + other: {} } } }; diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index b76ae2b0..e19e382e 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -29,10 +29,10 @@ //sub menu of torrents MENU_TORRENTS_SUB: { - SUB_MOVIE: 'Movie', - SUB_MTV: 'MTV', - SUB_MUSIC: 'Music', - SUB_OTHER: 'Other' + MOVIE: 'Movie', + TVSERIES: 'TVSeries', + MUSIC: 'Music', + OTHER: 'Other' }, //client menu @@ -47,15 +47,6 @@ //Upload rules UPLOAD_RULES: 'Upload Rules:', - UPLOAD_RULES_COUNT: '6', - UPLOAD_RULES_CONTENT: [ - 'The torrent file`s Tracker URL must be: {{url}}.', - 'The torrent file`s TMDB_ID must be TheMovieDB resources ID, you can find the ID from here.', - 'The resources detail info can be autoload, if it`s fine, then you can submit it.', - 'Select one or more tags that match the resources, which will play a significant role in your search results.', - 'After the submission of documents, may be approved by the management, the rules do not meet the seeds will be deleted directly.', - 'For additional assistance, please contact our administrator: {{admin}}.' - ], //HomeController & home views LOADING_TOP: 'Loading recommended info, please waiting...', @@ -127,6 +118,7 @@ TAGS_SEARCH: 'Tags Search', CA_KEYWORD: 'Keyword', CA_TORRENT_STATUS: 'Torrent status', + CA_RESOURCE_TYPE: 'Resource type', PH_KEYWORD: 'Search keyword', CLEAR_ALL_CONDITION: 'Clear All Condition', MORE_TAGS: 'More Tags', @@ -163,7 +155,6 @@ 0: 'This torrent file is uploaded by yourself, you have actions bellow.', 1: 'For additional assistance, please contact our administrator: {{admin}}' }, - ENTER_VIDEO_NFO: 'Please enter video NFO', TORRENT_SEED_USERS: 'Seed Users', TORRENT_LEECHER_USERS: 'Leecher Users', TORRENT_FINISHED_USERS: 'Finished Users', @@ -238,19 +229,21 @@ TORRENTS_UPLOAD_FAILED: 'Failed to upload file', TORRENTS_NO_FILE_SELECTED: 'No file selected', - SELECT_TORRENT_FILE: 'Please select the torrent file', + SELECT_RESOURCE_TYPE: '1. Please select the resource type', + SELECT_TORRENT_FILE: '2. Please select the torrent file', SELECT_FILE: 'Select file', DO_UPLOAD: 'Upload', - ENTER_TMDB_ID: 'Please enter theMovieDB id  [find id on themofiedb.org]', + ENTER_TMDB_ID: '3. Please enter theMovieDB id', LOAD_TMDB_INFO: 'Load info', TMDB_ID: 'TMDB ID', TMDB_ID_OK: 'TMDB ID is ok! Get info successfully', TMDB_ID_ERROR: 'TMDB ID is error! Get info failed', TMDB_ID_REQUIRED: 'Please enter TMDB ID', - TMDB_MOVIE_INFO: 'The movie info from TMDB', + TMDB_RESOURCE_INFO: '4. The resource info from TMDB', TMDB_IS_LOADING: 'Loading the movie info, please wait...', - SELECT_TAGS: 'Please select any tags for the resources', - TORRENTS_SUBMIT_UPLOAD: 'Agree the rules and submit your resources', + SELECT_TAGS: '5. Please select any tags for the resources', + ENTER_VIDEO_NFO: '6. Please enter video NFO', + TORRENTS_SUBMIT_UPLOAD: '7. Agree the rules and submit your resources', SUBMIT_BUTTON: 'OK, SUBMIT NOW', CANCEL_BUTTON: 'NO, CANCEL IT', AGREE_RULES: 'I agree and already read all the rules, read here', @@ -363,7 +356,12 @@ BACKDROP_PATH: 'backdrop_path', POSTER_PATH: 'poster_path', CAST: 'cast:', - DIRECTOR: 'Director' + DIRECTOR: 'Director', + + ORIGINAL_NAME: 'original_name', + NAME: 'name', + FIRST_AIR_DATE: 'first air date', + LAST_AIR_DATE: 'last air date' }, /////////////////////////resources tag fields/////////////////////////////////// @@ -415,6 +413,7 @@ REGION: { SELF: 'Region', CHINA: 'China', + USA: 'USA', JAPAN: 'Japan', KOREA: 'Korea', INDIA: 'India', diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index 3c6917f5..e0833516 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -29,10 +29,10 @@ //sub menu of torrents MENU_TORRENTS_SUB: { - SUB_MOVIE: '电影', - SUB_MTV: 'MTV', - SUB_MUSIC: '音乐', - SUB_OTHER: '其它' + MOVIE: '电影', + TVSERIES: '电视剧', + MUSIC: '音乐', + OTHER: '其它' }, //client account menu @@ -47,15 +47,6 @@ //发种规则 UPLOAD_RULES: '上传规则:', - UPLOAD_RULES_COUNT: '6', - UPLOAD_RULES_CONTENT: [ - '种子文件的Tracker地址必须为:{{url}}.', - '种子文件的 TMDB_ID 必须是 The Movie DB 相对应的资源ID号,您可以从这里找到ID号.', - '资源的详细信息,系统会自动载入,如无误可直接提交.', - '请为资源选择匹配的一个或多个标签,它会在您的搜索结果中发挥重大作用.', - '种子文件提交后,可能会由后台管理人员进行审批,不符合规则的种子会被直接删除.', - '如需其它帮助,请与我们的管理员联系:{{admin}}.' - ], //HomeController & home views LOADING_TOP: '正在推荐资源,请稍候...', @@ -127,6 +118,7 @@ TAGS_SEARCH: '标签检索', CA_KEYWORD: '关键字', CA_TORRENT_STATUS: '种子状态', + CA_RESOURCE_TYPE: '资源类型', PH_KEYWORD: '搜索关键字', CLEAR_ALL_CONDITION: '清空所有条件', MORE_TAGS: '显示更多标签', @@ -163,7 +155,6 @@ 0: '这个种子文件是由你自己上传的,你可以对其做如下操作.', 1: '如需其它帮助,请与我们的管理员联系:{{admin}}.' }, - ENTER_VIDEO_NFO: '请输入视频NFO信息', TORRENT_SEED_USERS: '做种用户列表', TORRENT_LEECHER_USERS: '下载用户列表', TORRENT_FINISHED_USERS: '完成用户列表', @@ -238,19 +229,21 @@ TORRENTS_UPLOAD_FAILED: '文件上传失败', TORRENTS_NO_FILE_SELECTED: '请选择种子文件后再做尝试', - SELECT_TORRENT_FILE: '请选择种子文件', + SELECT_RESOURCE_TYPE: '1. 请选择上传资源类型', + SELECT_TORRENT_FILE: '2. 请选择种子文件', SELECT_FILE: '选择文件', DO_UPLOAD: '上传', - ENTER_TMDB_ID: '请输入TMDB_ID  [在 themofiedb.org 上查找]', + ENTER_TMDB_ID: '3. 请输入TMDB_ID', LOAD_TMDB_INFO: '检索信息', TMDB_ID: 'TMDB ID', TMDB_ID_OK: 'MDB ID 正确,检索信息成功!', TMDB_ID_ERROR: 'MDB ID 错误,检索信息失败!', TMDB_ID_REQUIRED: '请输入 TMDB ID', - TMDB_MOVIE_INFO: 'TMDB 视频信息', + TMDB_RESOURCE_INFO: '4. TMDB 资源信息', TMDB_IS_LOADING: '正在检索视频信息,请稍候...', - SELECT_TAGS: '请为资源选择合适的标签', - TORRENTS_SUBMIT_UPLOAD: '同意上传协议,并提交', + SELECT_TAGS: '5. 请为资源选择合适的标签', + ENTER_VIDEO_NFO: '6. 请输入视频NFO信息', + TORRENTS_SUBMIT_UPLOAD: '7. 同意上传协议,并提交', SUBMIT_BUTTON: '已备妥,现在提交', CANCEL_BUTTON: '算了,以后再说', AGREE_RULES: '我已阅读并同意站内所有协议条款,协议条款', @@ -363,7 +356,12 @@ BACKDROP_PATH: '背景海报', POSTER_PATH: '海报', CAST: '主演:', - DIRECTOR: '导演' + DIRECTOR: '导演', + + ORIGINAL_NAME: '原剧名', + NAME: '剧名', + FIRST_AIR_DATE: '首次上演时间', + LAST_AIR_DATE: '最近上演时间' }, /////////////////////////resources tag fields/////////////////////////////////// @@ -415,6 +413,7 @@ REGION: { SELF: '地区', CHINA: '中国', + USA: '美国', JAPAN: '日本', KOREA: '韩国', INDIA: '印度', diff --git a/modules/core/client/controllers/home.client.controller.js b/modules/core/client/controllers/home.client.controller.js index dcb811f5..6f574bf3 100644 --- a/modules/core/client/controllers/home.client.controller.js +++ b/modules/core/client/controllers/home.client.controller.js @@ -16,7 +16,10 @@ vm.movieTopOne = undefined; vm.movieTopList = undefined; vm.movieNewList = undefined; - vm.movieTopInfo = undefined; + + vm.TVTopOne = undefined; + vm.TVTopList = undefined; + vm.TVNewList = undefined; /** * If user is not signed in then redirect back signin @@ -28,9 +31,18 @@ /** * initTopOneInfo */ - vm.initTopOneInfo = function () { + vm.initTopOneMovieInfo = function () { if (vm.movieTopOne.resource_detail_info.backdrop_path) { - $('.backdrop').css('backgroundImage', 'url(' + vm.tmdbConfig.backdrop_img_base_url + vm.movieTopOne.resource_detail_info.backdrop_path + ')'); + $('.movie-backdrop').css('backgroundImage', 'url(' + vm.tmdbConfig.backdrop_img_base_url + vm.movieTopOne.resource_detail_info.backdrop_path + ')'); + } + }; + + /** + * initTopOneTVInfo + */ + vm.initTopOneTVInfo = function () { + if (vm.TVTopOne.resource_detail_info.backdrop_path) { + $('.tv-backdrop').css('backgroundImage', 'url(' + vm.tmdbConfig.backdrop_img_base_url + vm.TVTopOne.resource_detail_info.backdrop_path + ')'); } }; @@ -39,6 +51,7 @@ */ vm.getTopInfo = function () { vm.getMovieTopInfo(); + vm.getTVTopInfo(); }; /** @@ -55,7 +68,7 @@ items.rows.splice(0, 1); vm.movieTopList = items.rows; - vm.initTopOneInfo(); + vm.initTopOneMovieInfo(); } }, function (err) { Notification.error({ @@ -79,6 +92,36 @@ }); }; + /** + * getTVTopInfo + */ + vm.getTVTopInfo = function () { + vm.tvsInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'tvseries', + limit: 9 + }, function (items) { + if (items.rows.length > 0) { + vm.TVTopOne = items.rows[0]; + items.rows.splice(0, 1); + vm.TVTopList = items.rows; + + vm.initTopOneTVInfo(); + } + }); + + vm.moviesInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'tvseries', + newest: true, + limit: 14 + }, function (items) { + if (items.rows.length > 0) { + vm.TVNewList = items.rows; + } + }); + }; + /** * openTorrentInfo * @param id @@ -95,7 +138,7 @@ vm.getDirector = function () { var n = '-'; - if (vm.movieTopOne.resource_detail_info) { + if (vm.movieTopOne && vm.movieTopOne.resource_detail_info) { angular.forEach(vm.movieTopOne.resource_detail_info.credits.crew, function (item) { if (item.job === 'Director') { n = item.name; diff --git a/modules/core/client/less/margin.less b/modules/core/client/less/margin.less index 031e0683..a052adb8 100644 --- a/modules/core/client/less/margin.less +++ b/modules/core/client/less/margin.less @@ -22,6 +22,10 @@ margin-top: 50px; } +.margin-bottom-5 { + margin-bottom: 5px; +} + .margin-bottom-10 { margin-bottom: 10px; } diff --git a/modules/core/client/views/home.client.view.html b/modules/core/client/views/home.client.view.html index 5d67ea96..c25c125c 100644 --- a/modules/core/client/views/home.client.view.html +++ b/modules/core/client/views/home.client.view.html @@ -1,5 +1,5 @@
-
+
@@ -195,4 +195,192 @@
+ +
+
+
+
+
+ + +
+ +
+
+
+
+
{{ 'TMDB_FIELDS.ORIGINAL_NAME' | translate}}:
+
{{vm.TVTopOne.resource_detail_info.original_name}}
+ +
{{ 'TMDB_FIELDS.NAME' | translate}}:
+
{{vm.TVTopOne.resource_detail_info.name}}
+ +
{{ 'TMDB_FIELDS.ORIGINAL_LANGUAGE' | translate}}:
+
{{vm.TVTopOne.resource_detail_info.original_language}}
+ +
{{ 'TMDB_FIELDS.GENRES' | translate}}:
+
+ {{item.name}} +
+ +
{{ 'TMDB_FIELDS.PRODUCTION_COMPANIES' | translate}}:
+
+ {{item.name}} + - +
+ +
{{ 'TMDB_FIELDS.PRODUCTION_COUNTRIES' | translate}}:
+
+ {{item}} + - +
+ +
{{ 'TMDB_FIELDS.FIRST_AIR_DATE' | translate}}:
+
{{vm.TVTopOne.resource_detail_info.first_air_date}}
+ +
{{ 'TMDB_FIELDS.LAST_AIR_DATE' | translate}}:
+
{{vm.TVTopOne.resource_detail_info.last_air_date}}
+ +
{{ 'TMDB_FIELDS.VOTE_AVERAGE' | translate}}:
+
+ + + IMDB + {{vm.TVTopOne.resource_detail_info.vote_average}} / {{vm.TVTopOne.resource_detail_info.vote_count}} {{ 'TMDB_FIELDS.VOTE_UNIT' | translate}} + +
+ +
{{ 'TMDB_FIELDS.OVERVIEW' | translate}}:
+
{{vm.TVTopOne.resource_detail_info.overview | limitTo:300}} + ...... +
+
+ +
+
+ + {{cast.name}} + +

{{cast.character}}

+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+ +
+ +
+
+
+
+
{{'NEWEST_MOVIE_LIST' | translate}}
+ + + + +
+
+ + + + +
+
+ {{$index + 1}}. {{nt.resource_detail_info.name}} +
+
+
+ +
+ {{$index + 1}}. {{nt.resource_detail_info.name}} +
+
+
+
+
+
+
+
+
diff --git a/modules/core/server/controllers/errors.server.controller.js b/modules/core/server/controllers/errors.server.controller.js index 817f99de..027f8b9f 100644 --- a/modules/core/server/controllers/errors.server.controller.js +++ b/modules/core/server/controllers/errors.server.controller.js @@ -39,8 +39,6 @@ var getUniqueErrorMessage = function (err) { exports.getErrorMessage = function (err) { var message = ''; - console.log(err); - if (err.code) { switch (err.code) { case 11000: diff --git a/modules/rules/client/views/rules.client.view.html b/modules/rules/client/views/rules.client.view.html index 02dc6fa6..9d7a9e00 100644 --- a/modules/rules/client/views/rules.client.view.html +++ b/modules/rules/client/views/rules.client.view.html @@ -1,7 +1,7 @@
-
+
diff --git a/modules/torrents/client/config/torrents.client.menus.js b/modules/torrents/client/config/torrents.client.menus.js index e7b02da7..6b421b40 100644 --- a/modules/torrents/client/config/torrents.client.menus.js +++ b/modules/torrents/client/config/torrents.client.menus.js @@ -18,22 +18,22 @@ // Add the dropdown list item menuService.addSubMenuItem('topbar', 'torrents', { - title: 'MENU_TORRENTS_SUB.SUB_MOVIE', + title: 'MENU_TORRENTS_SUB.MOVIE', state: 'torrents.movie', roles: ['*'] }); menuService.addSubMenuItem('topbar', 'torrents', { - title: 'MENU_TORRENTS_SUB.SUB_MTV', - state: 'torrents.mtv', + title: 'MENU_TORRENTS_SUB.TVSERIES', + state: 'torrents.tvseries', roles: ['*'] }); menuService.addSubMenuItem('topbar', 'torrents', { - title: 'MENU_TORRENTS_SUB.SUB_MUSIC', + title: 'MENU_TORRENTS_SUB.MUSIC', state: 'torrents.music', roles: ['*'] }); menuService.addSubMenuItem('topbar', 'torrents', { - title: 'MENU_TORRENTS_SUB.SUB_OTHER', + title: 'MENU_TORRENTS_SUB.OTHER', state: 'torrents.other', roles: ['*'] }); 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 2bcec81a..59dc11c5 100644 --- a/modules/torrents/client/controllers/admin/admin-list.client.controller.js +++ b/modules/torrents/client/controllers/admin/admin-list.client.controller.js @@ -18,7 +18,9 @@ vm.resourcesTags = MeanTorrentConfig.meanTorrentConfig.resourcesTags; vm.torrentSalesType = MeanTorrentConfig.meanTorrentConfig.torrentSalesType; vm.torrentRLevels = MeanTorrentConfig.meanTorrentConfig.torrentRecommendLevel; + vm.torrentType = MeanTorrentConfig.meanTorrentConfig.torrentType; + vm.selectedType = 'movie'; vm.searchTags = []; vm.searchKey = ''; vm.releaseYear = undefined; @@ -43,12 +45,20 @@ vm.torrentFigureOutItemsToDisplay(); }; + /** + * onTorrentTypeChanged + */ + vm.onTorrentTypeChanged = function () { + vm.searchTags = []; + vm.torrentBuildPager(); + }; + /** * commentFigureOutItemsToDisplay * @param callback */ vm.torrentFigureOutItemsToDisplay = function (callback) { - vm.getMoviePageInfo(vm.torrentCurrentPage, function (items) { + vm.getTorrentPageInfo(vm.torrentCurrentPage, function (items) { vm.torrentFilterLength = items.total; vm.torrentPagedItems = items.rows; @@ -163,17 +173,17 @@ }; /** - * getMoviePageInfo + * getTorrentPageInfo * @param p: page number */ - vm.getMoviePageInfo = function (p, callback) { + vm.getTorrentPageInfo = function (p, callback) { TorrentsService.get({ skip: (p - 1) * vm.torrentItemsPerPage, limit: vm.torrentItemsPerPage, keys: vm.searchKey.trim(), torrent_status: vm.torrentStatus, torrent_rlevel: vm.torrentRLevel, - torrent_type: 'movie', + torrent_type: vm.selectedType, torrent_release: vm.releaseYear, torrent_tags: vm.searchTags }, function (items) { @@ -200,7 +210,24 @@ vm.getTagTitle = function (tag) { var tmp = tag; var find = false; - angular.forEach(vm.resourcesTags.movie.radio, function (item) { + var r = undefined; + + switch (vm.selectedType) { + case 'tvseries': + r = vm.resourcesTags.tv; + break; + case 'music': + r = vm.resourcesTags.music; + break; + case 'other': + r = vm.resourcesTags.other; + break; + default: + r = vm.resourcesTags.movie; + } + + + angular.forEach(r.radio, function (item) { angular.forEach(item.value, function (sitem) { if (sitem.name === tag) { tmp = item.name; @@ -210,7 +237,7 @@ }); if (!find) { - angular.forEach(vm.resourcesTags.movie.checkbox, function (item) { + angular.forEach(r.checkbox, function (item) { angular.forEach(item.value, function (sitem) { if (sitem.name === tag) { tmp = item.name; diff --git a/modules/torrents/client/controllers/uploads.client.controller.js b/modules/torrents/client/controllers/uploads.client.controller.js index 633a2913..5221154d 100644 --- a/modules/torrents/client/controllers/uploads.client.controller.js +++ b/modules/torrents/client/controllers/uploads.client.controller.js @@ -15,19 +15,17 @@ vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig; vm.imdbConfig = MeanTorrentConfig.meanTorrentConfig.imdbConfig; vm.resourcesTags = MeanTorrentConfig.meanTorrentConfig.resourcesTags; - vm.rule_items = []; + vm.torrentType = MeanTorrentConfig.meanTorrentConfig.torrentType; + vm.lang = getStorageLangService.getLang(); vm.user = Authentication.user; vm.progress = 0; + vm.selectedType = 'movie'; vm.successfully = undefined; vm.tmdb_info_ok = undefined; vm.torrentInfo = null; vm.tags = []; vm.videoNfo = ''; - for (var i = 0; i < $translate.instant('UPLOAD_RULES_COUNT'); i++) { - vm.rule_items[i] = i; - } - // If user is not signed in then redirect back home if (!Authentication.user) { $state.go('authentication.signin'); @@ -113,12 +111,57 @@ $event.target.select(); }; + /** + * getIncludeInfoTemplate + * @returns {*} + */ + vm.getIncludeInfoTemplate = function () { + switch (vm.selectedType) { + case 'tvseries': + return 'tvinfo.html'; + case 'music': + return 'musicinfo.html'; + case 'other': + return 'otherinfo.html'; + default: + return 'movieinfo.html'; + } + }; + + /** + * onTorrentTypeChanged + */ + vm.onTorrentTypeChanged = function () { + vm.tmdb_info_ok = undefined; + vm.tmdb_isloading = false; + vm.movieinfo = undefined; + vm.tvinfo = undefined; + vm.tmdb_id = undefined; + }; + /** * getInfo * @param tmdbid */ vm.getInfo = function (tmdbid) { - console.log(tmdbid); + switch (vm.selectedType) { + case 'tvseries': + vm.getTVInfo(tmdbid); + break; + case 'music': + break; + case 'other': + break; + default: + vm.getMovieInfo(tmdbid); + } + }; + + /** + * getMovieInfo + * @param tmdbid + */ + vm.getMovieInfo = function (tmdbid) { if (tmdbid === null || tmdbid === undefined) { Notification.info({ message: ' ' + $translate.instant('TMDB_ID_REQUIRED') @@ -128,7 +171,7 @@ } vm.tmdb_isloading = true; - TorrentsService.getTMDBInfo({ + TorrentsService.getTMDBMovieInfo({ tmdbid: tmdbid, language: getStorageLangService.getLang() }, function (res) { @@ -152,75 +195,69 @@ }); }; + /** + * getTVInfo + * @param tmdbid + */ + vm.getTVInfo = function (tmdbid) { + if (tmdbid === null || tmdbid === undefined) { + Notification.info({ + message: ' ' + $translate.instant('TMDB_ID_REQUIRED') + }); + angular.element('#tmdbid').focus(); + return; + } + + vm.tmdb_isloading = true; + TorrentsService.getTMDBTVInfo({ + tmdbid: tmdbid, + language: getStorageLangService.getLang() + }, function (res) { + vm.tmdb_info_ok = true; + vm.tmdb_isloading = false; + Notification.success({ + message: ' ' + $translate.instant('TMDB_ID_OK') + }); + + console.log(res); + vm.tvinfo = res; + }, function (err) { + vm.tmdb_info_ok = false; + vm.tmdb_isloading = false; + Notification.error({ + message: ' ' + $translate.instant('TMDB_ID_ERROR') + }); + angular.element('#tmdbid').focus(); + }); + }; + /** * create */ vm.create = function () { - //var d = new Date(vm.movieinfo.release_date); - var l = 0; - //console.log(vm.torrentInfo); - if (vm.torrentInfo.length !== undefined) { - l = vm.torrentInfo.length; - } else if (vm.torrentInfo.info.length !== undefined) { - l = vm.torrentInfo.info.length; - } else { - angular.forEach(vm.torrentInfo.info.files, function (item) { - l = l + item.length; - }); + switch (vm.selectedType) { + case 'tvseries': + vm.createTVTorrent(); + break; + case 'music': + vm.createMusicTorrent(); + break; + case 'other': + vm.createOtherTorrent(); + break; + default: + vm.createMovieTorrent(); } + }; - var t = []; - angular.forEach(vm.resourcesTags.movie.radio, function (item) { - if (vm.tags['tag_' + item.name]) { - t.push(vm.tags['tag_' + item.name]); - } - }); - angular.forEach(vm.resourcesTags.movie.checkbox, function (item) { - angular.forEach(item.value, function (sitem) { - if (vm.tags['tag_' + item.name + '_' + sitem.name]) { - t.push(sitem.name); - } - }); - }); - - //var g = []; - //angular.forEach(vm.movieinfo.genres, function (item) { - // g.push(item.name); - //}); - // - //var com = []; - //angular.forEach(vm.movieinfo.production_companies, function (item) { - // com.push(item.name); - //}); - // - //var country = []; - //angular.forEach(vm.movieinfo.production_countries, function (item) { - // country.push(item.iso_3166_1); - //}); - // - //var casts = []; - //var i = 0; - //angular.forEach(vm.movieinfo.credits.cast, function (item) { - // if (i < 6) { - // var c = { - // name: item.name, - // character: item.character, - // profile_path: item.profile_path - // }; - // casts.push(c); - // i++; - // } - //}); - // - //var dir = undefined; - //angular.forEach(vm.movieinfo.credits.crew, function (item) { - // if (item.job === 'Director') { - // dir = item.name; - // } - //}); - + /** + * createMovieTorrent + */ + vm.createMovieTorrent = function () { + var l = vm.getTorrentSize(); + var t = vm.getResourceTag(); var torrent = new TorrentsService({ info_hash: vm.torrentInfo.info_hash, @@ -252,6 +289,101 @@ } }; + /** + * createTvTorrent + */ + vm.createTVTorrent = function () { + var l = vm.getTorrentSize(); + var t = vm.getResourceTag(); + + var torrent = new TorrentsService({ + info_hash: vm.torrentInfo.info_hash, + torrent_filename: vm.torrentInfo.filename, + torrent_type: 'tvseries', + torrent_tags: t, + torrent_nfo: vm.videoNfo, + torrent_announce: vm.torrentInfo.announce, + torrent_size: l, + + resource_detail_info: vm.tvinfo + }); + + torrent.$save(function (response) { + successCallback(response); + }, function (errorResponse) { + errorCallback(errorResponse); + }); + + function successCallback(res) { + $state.reload('torrents.uploads'); + document.body.scrollTop = document.documentElement.scrollTop = 0; + Notification.success({message: ' Torrent created successfully!'}); + } + + function errorCallback(res) { + vm.error_msg = res.data.message; + Notification.error({message: res.data.message, title: ' Torrent created error!'}); + } + }; + + /** + * getTorrentSize + * @returns {number} + */ + vm.getTorrentSize = function () { + var l = 0; + + if (vm.torrentInfo.length !== undefined) { + l = vm.torrentInfo.length; + } else if (vm.torrentInfo.info.length !== undefined) { + l = vm.torrentInfo.info.length; + } else { + angular.forEach(vm.torrentInfo.info.files, function (item) { + l = l + item.length; + }); + } + + return l; + }; + + /** + * getResourceTag + * @returns {Array} + */ + vm.getResourceTag = function () { + var t = []; + var r = undefined; + + switch (vm.selectedType) { + case 'tvseries': + r = vm.resourcesTags.tv; + break; + case 'music': + r = vm.resourcesTags.music; + break; + case 'other': + r = vm.resourcesTags.other; + break; + default: + r = vm.resourcesTags.movie; + } + + angular.forEach(r.radio, function (item) { + if (vm.tags['tag_' + item.name]) { + t.push(vm.tags['tag_' + item.name]); + } + }); + angular.forEach(r.checkbox, function (item) { + angular.forEach(item.value, function (sitem) { + if (vm.tags['tag_' + item.name + '_' + sitem.name]) { + t.push(sitem.name); + } + }); + }); + + return t; + }; + /** * cancel */ diff --git a/modules/torrents/client/services/torrents.client.service.js b/modules/torrents/client/services/torrents.client.service.js index 2e52e169..0d6916f1 100644 --- a/modules/torrents/client/services/torrents.client.service.js +++ b/modules/torrents/client/services/torrents.client.service.js @@ -15,7 +15,7 @@ update: { method: 'PUT' }, - getTMDBInfo: { + getTMDBMovieInfo: { method: 'GET', url: '/api/movieinfo/:tmdbid/:language', params: { @@ -23,6 +23,14 @@ language: '@language' } }, + getTMDBTVInfo: { + method: 'GET', + url: '/api/tvinfo/:tmdbid/:language', + params: { + tmdbid: '@tmdbid', + language: '@language' + } + }, setSaleType: { method: 'PUT', url: '/api/torrents/:torrentId/set/saletype/:saleType', diff --git a/modules/torrents/client/templates/upload-rules-en.md b/modules/torrents/client/templates/upload-rules-en.md new file mode 100644 index 00000000..43de80b8 --- /dev/null +++ b/modules/torrents/client/templates/upload-rules-en.md @@ -0,0 +1,6 @@ +1. The torrent file tracker URL must be: __{{vm.announce.url}}__. +1. If you selected resource type with `Movie` or `TVSeries`, the torrent TMDB_ID must be `TheMovieDB` resources ID, you can [find the ID + from here]({{vm.tmdbConfig.tmdb_home}}), then the resources detail info can be autoload, if everything looks good, hit submit. +1. Select one or more tags that match the resources, which will play a significant role in your search results. +1. After the submission of documents, may be approved by the management, the rules do not meet the seeds will be deleted directly. +1. For additional assistance, please contact our administrator: [{{vm.announce.admin}}](mailto:{{vm.announce.admin}}). \ No newline at end of file diff --git a/modules/torrents/client/templates/upload-rules-zh.md b/modules/torrents/client/templates/upload-rules-zh.md new file mode 100644 index 00000000..379f4d85 --- /dev/null +++ b/modules/torrents/client/templates/upload-rules-zh.md @@ -0,0 +1,6 @@ +1. 种子文件的Tracker地址必须为:__{{vm.announce.url}}__. +1. 如果你选择的资源类型为`电影`或`电视剧`,种子文件的 TMDB_ID 必须是 `TheMovieDB` 相对应的资源ID号, +您可以[从这里找到ID号]({{vm.tmdbConfig.tmdb_home}}). 资源的详细信息,系统会自动载入,如无误可直接提交. +1. 请为资源选择匹配的一个或多个标签,它会在您的搜索结果中发挥重大作用. +1. 种子文件提交后,可能会由后台管理人员进行审批,不符合规则的种子会被直接删除. +1. 如需其它帮助,请与我们的管理员联系:[{{vm.announce.admin}}](mailto:{{vm.announce.admin}}). \ No newline at end of file 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 f48eae70..0adea0a5 100644 --- a/modules/torrents/client/views/admin/admin-list.client.view.html +++ b/modules/torrents/client/views/admin/admin-list.client.view.html @@ -6,9 +6,21 @@
+
{{'CA_RESOURCE_TYPE' | translate}}
+
+
+
+ +
+
+
+
{{ 'CA_KEYWORD' | translate}}:
-
+
{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}:
-
-
- -
-
+
+
+
{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}:
+
+
+ +
+
+
+ +
+
{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}:
+
+
+ +
+
+
-
-
{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}:
-
-
- -
-
+
+
+
{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}:
+
+
+ +
+
+
+ +
+
{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}:
+
+
+ +
+
+
@@ -146,7 +189,7 @@
- {{ item.resource_detail_info.release_date}} diff --git a/modules/torrents/client/views/uploads-torrents.client.view.html b/modules/torrents/client/views/uploads-torrents.client.view.html index d4cf663d..78e2a397 100644 --- a/modules/torrents/client/views/uploads-torrents.client.view.html +++ b/modules/torrents/client/views/uploads-torrents.client.view.html @@ -3,23 +3,37 @@

-
    -
  1. -
+ + + + +
+
-
-
+
+
+ +
+ +
+
+
+ +
+
-
+
-
+
@@ -73,159 +88,18 @@
-
-
- -
- -
-
-
-
{{ 'TMDB_FIELDS.ORIGINAL_TITLE' | translate}}:
-
{{vm.movieinfo.original_title}}
+
-
{{ 'TMDB_FIELDS.TITLE' | translate}}:
-
{{vm.movieinfo.title}}
- -
{{ 'TMDB_FIELDS.ORIGINAL_LANGUAGE' | translate}}:
-
{{vm.movieinfo.original_language}}
- -
{{ 'TMDB_FIELDS.GENRES' | translate}}:
-
- {{item.name}} -
- -
{{ 'TMDB_FIELDS.PRODUCTION_COUNTRIES' | translate}}:
-
- {{item.iso_3166_1}} -
- -
{{ 'TMDB_FIELDS.RELEASE_DATE' | translate}}:
-
{{vm.movieinfo.release_date}}
- -
{{ 'TMDB_FIELDS.RUNTIME' | translate}}:
-
{{vm.movieinfo.runtime | runtime}}
- -
{{ 'TMDB_FIELDS.BUDGET' | translate}}:
-
{{vm.movieinfo.budget | dollar:2}}
- -
{{ 'TMDB_FIELDS.REVENUE' | translate}}:
-
{{vm.movieinfo.revenue | dollar:2}}
- -
{{ 'TMDB_FIELDS.VOTE_AVERAGE' | translate}}:
-
{{vm.movieinfo.vote_average}} / {{vm.movieinfo.vote_count}} {{ 'TMDB_FIELDS.VOTE_UNIT' | translate}}
- -
{{ 'TMDB_FIELDS.IMDB_LINK' | translate}}:
-
{{vm.imdbConfig.imdb_link_url}}{{vm.movieinfo.imdb_id}}
- -
{{ 'TMDB_FIELDS.TMDB_LINK' | translate}}:
-
{{vm.tmdbConfig.tmdb_link_url}}{{vm.movieinfo.id}}
- -
{{ 'TMDB_FIELDS.OVERVIEW' | translate}}:
-
{{vm.movieinfo.overview}}
-
- -
-
- - {{vm.movieinfo.credits.cast[0].name}} - -

{{vm.movieinfo.credits.cast[0].character}}

-
-
- - {{vm.movieinfo.credits.cast[1].name}} - -

{{vm.movieinfo.credits.cast[1].character}}

-
-
- - {{vm.movieinfo.credits.cast[2].name}} - -

{{vm.movieinfo.credits.cast[2].character}}

-
-
-
- - {{vm.movieinfo.credits.cast[3].name}} - -

{{vm.movieinfo.credits.cast[3].character}}

-
-
- - {{vm.movieinfo.credits.cast[4].name}} - -

{{vm.movieinfo.credits.cast[4].character}}

-
-
- - {{vm.movieinfo.credits.cast[5].name}} - -

{{vm.movieinfo.credits.cast[5].character}}

-
-
-
-
-
- -
-
- -
-
-
{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}:
-
- -
-
- -
- -
-
{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}:
-
- -
-
-
-
-
{{ 'CLEAR_ALL_CONDITION' | translate}}
-
-
-
-
- -
+
- +
+ +
-
+
@@ -246,4 +120,235 @@
+ + + + +
\ No newline at end of file diff --git a/modules/torrents/client/views/view-torrent.client.view.html b/modules/torrents/client/views/view-torrent.client.view.html index abd0bc5f..54319865 100644 --- a/modules/torrents/client/views/view-torrent.client.view.html +++ b/modules/torrents/client/views/view-torrent.client.view.html @@ -79,8 +79,8 @@
{{ 'TMDB_FIELDS.TMDB_LINK' | translate}}:
-
{{vm.tmdbConfig.tmdb_link_url}}{{vm.torrentLocalInfo.resource_detail_info.id}} +
{{vm.tmdbConfig.tmdb_movie_link_url}}{{vm.torrentLocalInfo.resource_detail_info.id}}
{{ 'TMDB_FIELDS.OVERVIEW' | translate}}:
diff --git a/modules/torrents/server/controllers/torrents.server.controller.js b/modules/torrents/server/controllers/torrents.server.controller.js index 9ae98fbc..9cf9175e 100644 --- a/modules/torrents/server/controllers/torrents.server.controller.js +++ b/modules/torrents/server/controllers/torrents.server.controller.js @@ -39,6 +39,27 @@ exports.movieinfo = function (req, res) { }); }; +/** + * get tv info from tmdb + */ +exports.tvinfo = function (req, res) { + console.log('------- API: tvinfo --------------------'); + console.log(req.params); + + tmdb.tvInfo({ + id: req.params.tmdbid, + language: req.params.language, + append_to_response: 'credits,images,alternative_titles', + include_image_language: req.params.language + ',null' + }, function (err, info) { + if (err) { + res.status(900).send(err); + } else { + res.json(info); + } + }); +}; + /** * upload torrent file * @param req diff --git a/modules/torrents/server/policies/torrents.server.policy.js b/modules/torrents/server/policies/torrents.server.policy.js index 92ddbb5d..feb3904b 100644 --- a/modules/torrents/server/policies/torrents.server.policy.js +++ b/modules/torrents/server/policies/torrents.server.policy.js @@ -18,6 +18,7 @@ exports.invokeRolesPolicies = function () { roles: ['admin', 'oper'], allows: [ {resources: '/api/movieinfo/:tmdbid/:language', permissions: '*'}, + {resources: '/api/tvinfo/:tmdbid/:language', permissions: '*'}, {resources: '/api/torrents/upload', permissions: '*'}, {resources: '/api/torrents/download/:torrentId', permissions: '*'}, {resources: '/api/torrents', permissions: '*'}, @@ -38,6 +39,7 @@ exports.invokeRolesPolicies = function () { roles: ['user'], allows: [ {resources: '/api/movieinfo/:tmdbid/:language', permissions: ['get']}, + {resources: '/api/tvinfo/:tmdbid/:language', permissions: ['get']}, {resources: '/api/torrents/upload', permissions: ['post']}, {resources: '/api/torrents/download/:torrentId', permissions: ['get']}, {resources: '/api/torrents', permissions: ['get', 'post']}, @@ -55,6 +57,7 @@ exports.invokeRolesPolicies = function () { roles: ['guest'], allows: [ {resources: '/api/movieinfo/:tmdbid/:language', permissions: ['get']}, + {resources: '/api/tvinfo/:tmdbid/:language', permissions: ['get']}, {resources: '/api/torrents', permissions: ['get']}, {resources: '/api/torrents/:torrentId', permissions: ['get']} ] diff --git a/modules/torrents/server/routes/torrents.server.routes.js b/modules/torrents/server/routes/torrents.server.routes.js index 65636663..c2e6b1c8 100644 --- a/modules/torrents/server/routes/torrents.server.routes.js +++ b/modules/torrents/server/routes/torrents.server.routes.js @@ -12,6 +12,9 @@ module.exports = function (app) { app.route('/api/movieinfo/:tmdbid/:language').all(torrentsPolicy.isAllowed) .get(torrents.movieinfo); + app.route('/api/tvinfo/:tmdbid/:language').all(torrentsPolicy.isAllowed) + .get(torrents.tvinfo); + app.route('/api/torrents/upload').all(torrentsPolicy.isAllowed) .post(torrents.upload); diff --git a/modules/vip/client/views/vip.client.view.html b/modules/vip/client/views/vip.client.view.html index 5971d859..9898c597 100644 --- a/modules/vip/client/views/vip.client.view.html +++ b/modules/vip/client/views/vip.client.view.html @@ -4,7 +4,7 @@
-
+
diff --git a/package.json b/package.json index a33a51a8..46aad50b 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "mocha": "~3.1.0", "mongoose": "^4.9.5", "morgan": "~1.7.0", - "moviedb": "^0.2.7", + "moviedb": "^0.2.8", "multer": "~1.2.0", "nodemailer": "~2.6.4", "nt": "^0.5.3",