feat(TVseries): load TVSeries data

upload tvseries, create tvseries torrent item, load tvseries data to home view, admin manage tvseries data etc.
This commit is contained in:
OldHawk
2017-05-23 18:55:59 +08:00
parent ab48ea97a6
commit c9d6dbe5e7
22 changed files with 972 additions and 316 deletions

View File

@@ -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: {}
}
}
};

View File

@@ -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: <mark><strong>{{url}}</strong></mark>.',
'The torrent file`s TMDB_ID must be TheMovieDB resources ID, <strong><a href="https://www.themoviedb.org/" target="_blank">you can find the ID from here</a></strong>.',
'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: <strong><a href="mailto:#">{{admin}}</a></strong>.'
],
//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: <strong><a href="mailto:#">{{admin}}</a></strong>'
},
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  <span style="font-size: 10pt;">[<a href="https://www.themoviedb.org/" target="_blank">find id on themofiedb.org</a>]</span>',
ENTER_TMDB_ID: '3. Please enter theMovieDB id</span>',
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, <a href="#">read here</a>',
@@ -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',

View File

@@ -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地址必须为<mark><strong>{{url}}</strong></mark>.',
'种子文件的 TMDB_ID 必须是 The Movie DB 相对应的资源ID号<strong><a href="https://www.themoviedb.org/" target="_blank">您可以从这里找到ID号</a></strong>.',
'资源的详细信息,系统会自动载入,如无误可直接提交.',
'请为资源选择匹配的一个或多个标签,它会在您的搜索结果中发挥重大作用.',
'种子文件提交后,可能会由后台管理人员进行审批,不符合规则的种子会被直接删除.',
'如需其它帮助,请与我们的管理员联系:<strong><a href="mailto:#">{{admin}}</a></strong>.'
],
//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: '如需其它帮助,请与我们的管理员联系:<strong><a href="mailto:#">{{admin}}</a></strong>.'
},
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  <span style="font-size: 10pt;">[<a href="https://www.themoviedb.org/" target="_blank">在 themofiedb.org 上查找</a>]</span>',
ENTER_TMDB_ID: '3. 请输入TMDB_ID</span>',
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: '我已阅读并同意站内所有协议条款,<a href="#">协议条款</a>',
@@ -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: '印度',

View File

@@ -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;

View File

@@ -22,6 +22,10 @@
margin-top: 50px;
}
.margin-bottom-5 {
margin-bottom: 5px;
}
.margin-bottom-10 {
margin-bottom: 10px;
}

View File

@@ -1,5 +1,5 @@
<section ng-controller="HomeController as vm" ng-init="vm.getTopInfo();">
<div class="backdrop" ng-show="vm.movieTopOne">
<div class="backdrop movie-backdrop" ng-show="vm.movieTopOne">
<div class="filter">
<div class="container">
<div class="topone">
@@ -195,4 +195,192 @@
</div>
</div>
</div>
<div class="backdrop tv-backdrop" ng-show="vm.TVTopOne">
<div class="filter">
<div class="container">
<div class="topone">
<div class="col-md-4">
<img ng-src="{{vm.tmdbConfig.poster_img_base_url}}{{vm.TVTopOne.resource_detail_info.poster_path}}"
class="img-thumbnail center-block"
onload="this.style.opacity='1';" ng-click="vm.openTorrentInfo(vm.TVTopOne._id);">
<div class="down-torrent">
<button class="btn btn-success btn-block" ng-click="vm.downloadTorrent(vm.TVTopOne._id)"
translate="DOWNLOAD_TORRENT"></button>
</div>
</div>
<div class="col-md-8">
<dl class="dl-horizontal">
<dt class="h-line">{{ 'TMDB_FIELDS.ORIGINAL_NAME' | translate}}</dt>
<dd class="h-line">{{vm.TVTopOne.resource_detail_info.original_name}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.NAME' | translate}}</dt>
<dd class="h-line">{{vm.TVTopOne.resource_detail_info.name}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.ORIGINAL_LANGUAGE' | translate}}</dt>
<dd class="h-line">{{vm.TVTopOne.resource_detail_info.original_language}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.GENRES' | translate}}</dt>
<dd class="h-line list-all-genres">
<span class="genres-item" ng-repeat="item in vm.TVTopOne.resource_detail_info.genres">{{item.name}}</span>
</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.PRODUCTION_COMPANIES' | translate}}</dt>
<dd class="h-line list-all-countries">
<span class="country-item"
ng-repeat="item in vm.TVTopOne.resource_detail_info.production_companies">{{item.name}}</span>
<span ng-show="vm.TVTopOne.resource_detail_info.production_companies.length ==0">-</span>
</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.PRODUCTION_COUNTRIES' | translate}}</dt>
<dd class="h-line list-all-countries">
<span class="country-item" ng-repeat="item in vm.TVTopOne.resource_detail_info.origin_country">{{item}}</span>
<span ng-show="vm.TVTopOne.resource_detail_info.origin_country.length ==0">-</span>
</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.FIRST_AIR_DATE' | translate}}</dt>
<dd class="h-line">{{vm.TVTopOne.resource_detail_info.first_air_date}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.LAST_AIR_DATE' | translate}}</dt>
<dd class="h-line">{{vm.TVTopOne.resource_detail_info.last_air_date}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.VOTE_AVERAGE' | translate}}</dt>
<dd class="h-line">
<span ng-show="vm.TVTopOne">
<span class="torrent-votes">
<kbd>IMDB</kbd>
</span> {{vm.TVTopOne.resource_detail_info.vote_average}} / {{vm.TVTopOne.resource_detail_info.vote_count}} {{ 'TMDB_FIELDS.VOTE_UNIT' | translate}}
</span>
</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.OVERVIEW' | translate}}</dt>
<dd class="h-line">{{vm.TVTopOne.resource_detail_info.overview | limitTo:300}}
<span ng-show="vm.TVTopOne.resource_detail_info.overview.length > 300">......</span>
</dd>
</dl>
<legend class="xsmall-legend strong-legend" translate="TMDB_FIELDS.CAST"></legend>
<div class="row cast-list">
<div class="col-xs-4 col-md-2 text-center"
ng-repeat="cast in vm.TVTopOne.resource_detail_info.credits.cast | limitTo: 6">
<img ng-src="{{vm.tmdbConfig.cast_img_base_url}}{{cast.profile_path}}"
on-error-src="/./modules/core/client/img/default_face.jpg"
class="img-circle img-thumbnail img-responsive center-block" onload="this.style.opacity='1';">
<span class="cast-xs-info"><strong>{{cast.name}}</strong></span>
<p class="cast-xs-info character">{{cast.character}}</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row" style="padding: 0 10px;">
<div class="row-md-height">
<div class="col-md-9 col-md-height col-no-padding">
<div ng-repeat="item in vm.TVTopList">
<div data-ng-if="$index != 0 && $index % 2 == 0" class="clearfix visible-xs-block"></div>
<div data-ng-if="$index != 0 && $index % 4 == 0" class="clearfix visible-md-block visible-lg-block"></div>
<div class="col-xs-6 col-sm-3 col-md-3 col-small-padding">
<div class="thumbnail torrent-post-info" ng-click="vm.openTorrentInfo(item._id);">
<img ng-src="{{vm.tmdbConfig.poster_img_base_url}}{{item.resource_detail_info.poster_path}}" alt="{{item.resource_detail_info.name}}"
class="img-responsive">
<div class="torrent-user-info">
<table>
<tr>
<td class="text-left">
<span class="glyphicon glyphicon-arrow-up torrent-up"></span>
<span>{{item.torrent_seeds}}</span>
</td>
<td class="text-center">
<span class="glyphicon glyphicon-arrow-down torrent-down"></span>
<span>{{item.torrent_leechers}}</span>
</td>
<td class="text-right">
<span class="glyphicon glyphicon-ok torrent-finished"></span>
<span>{{item.torrent_finished}}</span>
</td>
</tr>
</table>
</div>
<div class="torrent-tmdb-info">
<ul class="list-unstyled">
<li>
<!--<span class="release-date">{{item.resource_detail_info.release_date}}</span>-->
<span title="{{ 'TITLE_ALT.IMDB_VOTES' | translate}}"
class="pull-right torrent-votes"><kbd>IMDB</kbd> {{item.resource_detail_info.vote_average}}</span>
</li>
</ul>
</div>
<div class="caption">
<ul class="list-unstyled">
<li class="text-long">
<strong>{{item.resource_detail_info.name}}</strong>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3 col-md-height col-small-padding" style="padding-left: 15px;">
<div class="fill-height-table">
<div class="fill-height-row" style="overflow-y: auto;">
<div class="panel panel-default panel-newest-list" ng-show="vm.TVNewList">
<div class="panel-heading"><h5>{{'NEWEST_MOVIE_LIST' | translate}}</h5></div>
<table class="table">
<tr ng-repeat="nt in vm.TVNewList" mouse-enter-toggle-class="show-big" base-class="hide-big"
ng-class="[$index > 0 ? 'hide-big' : 'show-big', $index >= 12 ? 'hide-more' : '']">
<td>
<div class="newest-item-big" ng-click="vm.openTorrentInfo(nt._id);">
<img ng-src="{{vm.tmdbConfig.backdrop_img_base_url_300}}{{nt.resource_detail_info.backdrop_path}}"
on-error-src="/./modules/torrents/client/img/default_backdrop_300.jpg">
<div class="newest-user-info">
<table>
<tr>
<td class="text-left">
<span class="glyphicon glyphicon-arrow-up torrent-up"></span>
<span>{{nt.torrent_seeds}}</span>
</td>
<td class="text-center">
<span class="glyphicon glyphicon-arrow-down torrent-down"></span>
<span>{{nt.torrent_leechers}}</span>
</td>
<td class="text-right">
<span class="glyphicon glyphicon-ok torrent-finished"></span>
<span>{{nt.torrent_finished}}</span>
</td>
</tr>
</table>
</div>
<div class="newest-info">
<div class="text-long">
{{$index + 1}}. {{nt.resource_detail_info.name}}
</div>
</div>
</div>
<div class="newest-item-small text-long">
{{$index + 1}}. {{nt.resource_detail_info.name}}
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>

View File

@@ -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:

View File

@@ -1,7 +1,7 @@
<section class="container padding-top-10" ng-controller="RulesController as vm" ng-init="vm.init();">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div marked src="'/modules/rules/client/templates/rules-'+vm.lang+'.md'">
<div marked src="'/modules/rules/client/templates/rules-'+vm.lang+'.md'" compile="true">
</div>
</div>
</div>

View File

@@ -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: ['*']
});

View File

@@ -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;

View File

@@ -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: '<i class="glyphicon glyphicon-info-sign"></i> ' + $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: '<i class="glyphicon glyphicon-info-sign"></i> ' + $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: '<i class="glyphicon glyphicon-ok"></i> ' + $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: '<i class="glyphicon glyphicon-remove"></i> ' + $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: '<i class="glyphicon glyphicon-ok"></i> Torrent created successfully!'});
}
function errorCallback(res) {
vm.error_msg = res.data.message;
Notification.error({message: res.data.message, title: '<i class="glyphicon glyphicon-remove"></i> 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
*/

View File

@@ -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',

View File

@@ -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}}).

View File

@@ -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}}).

View File

@@ -6,9 +6,21 @@
<div class="panel-body">
<div class="col-md-10 col-md-offset-1">
<dl class="dl-horizontal">
<dt class="h-line">{{'CA_RESOURCE_TYPE' | translate}}</dt>
<dd class="h-line">
<div class="row margin-bottom-5">
<div class="col-sm-6 col-md-4">
<select class="form-control" ng-model="vm.selectedType" ng-change="vm.onTorrentTypeChanged();">
<option ng-repeat="t in vm.torrentType.value" value="{{t.value}}">{{'MENU_TORRENTS_SUB.'+t.name | translate}}
</option>
</select>
</div>
</div>
</dd>
<dt class="h-line">{{ 'CA_KEYWORD' | translate}}:</dt>
<dd class="h-line">
<div class="row" style="">
<div class="row">
<div class="col-sm-7">
<input type="text" class="form-control" ng-model="vm.searchKey"
ng-keydown="vm.onKeysKeyDown($event);"
@@ -67,31 +79,62 @@
</dd>
<div class="more-tags panel-collapsed" style="display: none;">
<div ng-repeat="item in vm.resourcesTags.movie.radio">
<dt class="h-line">{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}</dt>
<dd class="h-line">
<div class="btn-group btn-group-xs" role="group">
<button ng-repeat="sitem in item.value" id="tag_{{sitem.name}}"
class="btn btn-xs btn-default btn-tag" value="{{sitem.name}}"
ng-click="vm.onRadioTagClicked($event, sitem.name)">
{{ 'RESOURCESTAGS.' + item.name + '.' + sitem.name | translate}}
</button>
</div>
</dd>
<div ng-if="vm.selectedType=='movie'">
<div ng-repeat="item in vm.resourcesTags.movie.radio">
<dt class="h-line">{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}</dt>
<dd class="h-line">
<div class="btn-group btn-group-xs" role="group">
<button ng-repeat="sitem in item.value" id="tag_{{sitem.name}}"
class="btn btn-xs btn-default btn-tag" value="{{sitem.name}}"
ng-click="vm.onRadioTagClicked($event, sitem.name)">
{{ 'RESOURCESTAGS.' + item.name + '.' + sitem.name | translate}}
</button>
</div>
</dd>
</div>
<div ng-repeat="item in vm.resourcesTags.movie.checkbox">
<dt class="h-line">{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}</dt>
<dd class="h-line">
<div class="btn-group btn-group-xs" role="group">
<button ng-repeat="sitem in item.value" id="tag_{{sitem.name}}"
class="btn btn-xs btn-default btn-tag" value="{{sitem.name}}"
ng-click="vm.onCheckboxTagClicked($event, sitem.name)"
toggle-class="btn-success" base-class="btn-default" onclick="this.blur();">
{{ 'RESOURCESTAGS.' + item.name + '.' + sitem.name | translate}}
</button>
</div>
</dd>
</div>
</div>
<div ng-repeat="item in vm.resourcesTags.movie.checkbox">
<dt class="h-line">{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}</dt>
<dd class="h-line">
<div class="btn-group btn-group-xs" role="group">
<button ng-repeat="sitem in item.value" id="tag_{{sitem.name}}"
class="btn btn-xs btn-default btn-tag" value="{{sitem.name}}"
ng-click="vm.onCheckboxTagClicked($event, sitem.name)"
toggle-class="btn-success" base-class="btn-default" onclick="this.blur();">
{{ 'RESOURCESTAGS.' + item.name + '.' + sitem.name | translate}}
</button>
</div>
</dd>
<div ng-if="vm.selectedType=='tvseries'">
<div ng-repeat="item in vm.resourcesTags.tv.radio">
<dt class="h-line">{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}</dt>
<dd class="h-line">
<div class="btn-group btn-group-xs" role="group">
<button ng-repeat="sitem in item.value" id="tag_{{sitem.name}}"
class="btn btn-xs btn-default btn-tag" value="{{sitem.name}}"
ng-click="vm.onRadioTagClicked($event, sitem.name)">
{{ 'RESOURCESTAGS.' + item.name + '.' + sitem.name | translate}}
</button>
</div>
</dd>
</div>
<div ng-repeat="item in vm.resourcesTags.tv.checkbox">
<dt class="h-line">{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}</dt>
<dd class="h-line">
<div class="btn-group btn-group-xs" role="group">
<button ng-repeat="sitem in item.value" id="tag_{{sitem.name}}"
class="btn btn-xs btn-default btn-tag" value="{{sitem.name}}"
ng-click="vm.onCheckboxTagClicked($event, sitem.name)"
toggle-class="btn-success" base-class="btn-default" onclick="this.blur();">
{{ 'RESOURCESTAGS.' + item.name + '.' + sitem.name | translate}}
</button>
</div>
</dd>
</div>
</div>
</div>
</dl>
@@ -146,7 +189,7 @@
<div class="list-all-tags">
<!--<span class="label label-success text-uppercase">{{ item.torrent_type}}</span>-->
<span class="label label-release label-warning"
<span class="label label-release label-warning" ng-show="item.resource_detail_info.release_date"
ng-click="vm.onReleaseClicked(item.resource_detail_info.release_date); $event.stopPropagation();">
{{ item.resource_detail_info.release_date}}
</span>

View File

@@ -3,23 +3,37 @@
<div class="row">
<div class="col-md-11 col-md-offset-1 col-sm-11 col-sm-offset-1 col-xs-12">
<h4 translate="UPLOAD_RULES"></h4>
<ol>
<li ng-repeat="r in vm.rule_items" translate="UPLOAD_RULES_CONTENT.{{r}}"
translate-values='{ url: vm.announce.url, admin: vm.announce.admin}' style="line-height: 1.6;"></li>
</ol>
<!--<ol>-->
<!--<li ng-repeat="r in vm.rule_items" translate="UPLOAD_RULES_CONTENT.{{r}}"-->
<!--translate-values='{ url: vm.announce.url, admin: vm.announce.admin}' style="line-height: 1.6;"></li>-->
<!--</ol>-->
<div marked src="'/modules/torrents/client/templates/upload-rules-'+vm.lang+'.md'" compile="true" style="line-height: 1.6;">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="row margin-bottom-40">
<div class="col-xs-12">
<legend class="small-legend" translate="SELECT_RESOURCE_TYPE"></legend>
<div class="col-xs-12 col-sm-6 col-md-4">
<select class="form-control" ng-model="vm.selectedType" ng-change="vm.onTorrentTypeChanged();">
<option ng-repeat="t in vm.torrentType.value" value="{{t.value}}">{{'MENU_TORRENTS_SUB.'+t.name | translate}}</option>
</select>
</div>
</div>
</div>
<div class="row margin-bottom-40">
<div class="col-xs-12">
<legend class="small-legend" translate="SELECT_TORRENT_FILE"></legend>
<div class="col-sm-7">
<div class="input-group">
<input type="text" class="form-control" ng-model="vm.tFile.name" disabled>
<div class="input-group-btn">
<button class="btn btn-primary btn-file" ngf-select="vm.fileSelected = true; vm.successfully = undefined; vm.progress = 0;"
<button class="btn btn-primary btn-file"
ngf-select="vm.fileSelected = true; vm.successfully = undefined; vm.progress = 0;"
ng-model="vm.tFile"
accept="application/x-bittorrent"
ngf-resize="{width: 400}"
@@ -39,9 +53,10 @@
<label class="text-danger control-label" translate="TORRENTS_UPLOAD_FAILED"></label>
</div>
</div>
</div>
<div ng-show="vm.successfully == true" class="row" style="margin-top: 40px;">
<div ng-show="vm.successfully == true" class="row margin-bottom-40">
<div class="col-md-12 col-sm-12 col-xs-12">
<legend class="small-legend" translate="ENTER_TMDB_ID"></legend>
<div class="col-lg-3 col-md-4 col-sm-5 col-xs-6">
@@ -73,159 +88,18 @@
</div>
</div>
<div class="row" ng-show="vm.tmdb_info_ok == true" style="margin-top: 40px;">
<div class="col-md-12 col-sm-12 col-xs-12">
<legend class="small-legend" translate="TMDB_MOVIE_INFO"></legend>
<div class="col-md-4 col-sm-4 col-xs-12">
<img ng-src="{{vm.tmdbConfig.poster_img_base_url}}{{vm.movieinfo.poster_path}}" class="img-thumbnail">
</div>
<div class="col-md-8 col-sm-8 col-xs-12">
<dl class="dl-horizontal">
<dt class="h-line">{{ 'TMDB_FIELDS.ORIGINAL_TITLE' | translate}}</dt>
<dd class="h-line">{{vm.movieinfo.original_title}}</dd>
<div ng-if="vm.tmdb_info_ok == true" ng-include="vm.getIncludeInfoTemplate();"></div>
<dt class="h-line">{{ 'TMDB_FIELDS.TITLE' | translate}}</dt>
<dd class="h-line">{{vm.movieinfo.title}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.ORIGINAL_LANGUAGE' | translate}}</dt>
<dd class="h-line">{{vm.movieinfo.original_language}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.GENRES' | translate}}</dt>
<dd class="h-line list-all-genres">
<span class="genres-item" ng-repeat="item in vm.movieinfo.genres">{{item.name}}</span>
</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.PRODUCTION_COUNTRIES' | translate}}</dt>
<dd class="h-line list-all-countries">
<span class="country-item" ng-repeat="item in vm.movieinfo.production_countries">{{item.iso_3166_1}}</span>
</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.RELEASE_DATE' | translate}}</dt>
<dd class="h-line">{{vm.movieinfo.release_date}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.RUNTIME' | translate}}</dt>
<dd class="h-line">{{vm.movieinfo.runtime | runtime}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.BUDGET' | translate}}</dt>
<dd class="h-line">{{vm.movieinfo.budget | dollar:2}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.REVENUE' | translate}}</dt>
<dd class="h-line">{{vm.movieinfo.revenue | dollar:2}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.VOTE_AVERAGE' | translate}}</dt>
<dd class="h-line">{{vm.movieinfo.vote_average}} / {{vm.movieinfo.vote_count}} {{ 'TMDB_FIELDS.VOTE_UNIT' | translate}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.IMDB_LINK' | translate}}</dt>
<dd class="h-line"><a href="{{vm.imdbConfig.imdb_link_url}}{{vm.movieinfo.imdb_id}}"
target="_blank">{{vm.imdbConfig.imdb_link_url}}{{vm.movieinfo.imdb_id}}</a></dd>
<dt class="h-line">{{ 'TMDB_FIELDS.TMDB_LINK' | translate}}</dt>
<dd class="h-line"><a href="{{vm.tmdbConfig.tmdb_link_url}}{{vm.movieinfo.id}}"
target="_blank">{{vm.tmdbConfig.tmdb_link_url}}{{vm.movieinfo.id}}</a></dd>
<dt class="h-line">{{ 'TMDB_FIELDS.OVERVIEW' | translate}}</dt>
<dd class="h-line">{{vm.movieinfo.overview}}</dd>
</dl>
<legend class="xsmall-legend strong-legend" translate="TMDB_FIELDS.CAST"></legend>
<div class="row cast-list">
<div class="col-xs-4 col-md-2 text-center">
<img ng-src="{{vm.tmdbConfig.cast_img_base_url}}{{vm.movieinfo.credits.cast[0].profile_path}}"
on-error-src="/./modules/core/client/img/default_face.jpg"
class="img-circle img-thumbnail img-responsive center-block">
<span class="cast-xs-info"><strong>{{vm.movieinfo.credits.cast[0].name}}</strong></span>
<p class="cast-xs-info">{{vm.movieinfo.credits.cast[0].character}}</p>
</div>
<div class="col-xs-4 col-md-2 text-center">
<img ng-src="{{vm.tmdbConfig.cast_img_base_url}}{{vm.movieinfo.credits.cast[1].profile_path}}"
on-error-src="/./modules/core/client/img/default_face.jpg"
class="img-circle img-thumbnail img-responsive center-block">
<span class="cast-xs-info"><strong>{{vm.movieinfo.credits.cast[1].name}}</strong></span>
<p class="cast-xs-info">{{vm.movieinfo.credits.cast[1].character}}</p>
</div>
<div class="col-xs-4 col-md-2 text-center">
<img ng-src="{{vm.tmdbConfig.cast_img_base_url}}{{vm.movieinfo.credits.cast[2].profile_path}}"
on-error-src="/./modules/core/client/img/default_face.jpg"
class="img-circle img-thumbnail img-responsive center-block">
<span class="cast-xs-info"><strong>{{vm.movieinfo.credits.cast[2].name}}</strong></span>
<p class="cast-xs-info">{{vm.movieinfo.credits.cast[2].character}}</p>
</div>
<div class="clearfix visible-xs-block visible-sm-block"></div>
<div class="col-xs-4 col-md-2 text-center">
<img ng-src="{{vm.tmdbConfig.cast_img_base_url}}{{vm.movieinfo.credits.cast[3].profile_path}}"
on-error-src="/./modules/core/client/img/default_face.jpg"
class="img-circle img-thumbnail img-responsive center-block">
<span class="cast-xs-info"><strong>{{vm.movieinfo.credits.cast[3].name}}</strong></span>
<p class="cast-xs-info">{{vm.movieinfo.credits.cast[3].character}}</p>
</div>
<div class="col-xs-4 col-md-2 text-center">
<img ng-src="{{vm.tmdbConfig.cast_img_base_url}}{{vm.movieinfo.credits.cast[4].profile_path}}"
on-error-src="/./modules/core/client/img/default_face.jpg"
class="img-circle img-thumbnail img-responsive center-block">
<span class="cast-xs-info"><strong>{{vm.movieinfo.credits.cast[4].name}}</strong></span>
<p class="cast-xs-info">{{vm.movieinfo.credits.cast[4].character}}</p>
</div>
<div class="col-xs-4 col-md-2 text-center">
<img ng-src="{{vm.tmdbConfig.cast_img_base_url}}{{vm.movieinfo.credits.cast[5].profile_path}}"
on-error-src="/./modules/core/client/img/default_face.jpg"
class="img-circle img-thumbnail img-responsive center-block">
<span class="cast-xs-info"><strong>{{vm.movieinfo.credits.cast[5].name}}</strong></span>
<p class="cast-xs-info">{{vm.movieinfo.credits.cast[5].character}}</p>
</div>
</div>
</div>
</div>
</div>
<div class="row" ng-show="vm.tmdb_info_ok == true" style="margin-top: 40px;">
<div class="col-md-12 col-sm-12 col-xs-12">
<legend class="small-legend" translate="SELECT_TAGS"></legend>
<dl class="dl-horizontal">
<div ng-repeat="item in vm.resourcesTags.movie.radio">
<dt class="h-line">{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}</dt>
<dd class="h-line">
<label class="radio-inline" ng-repeat="sitem in item.value">
<input type="radio" class="tradio" name="tag_{{item.name}}" ng-model="vm.tags['tag_'+item.name]"
id="radio_{{item.name}}{{$index}}"
value="{{sitem.name}}"> {{ 'RESOURCESTAGS.' + item.name + '.' + sitem.name | translate}}
</label>
</dd>
</div>
<div style="margin-top: 30px;"></div>
<div ng-repeat="item in vm.resourcesTags.movie.checkbox">
<dt class="h-line">{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}</dt>
<dd class="h-line">
<label class="checkbox-inline" ng-repeat="sitem in item.value">
<input type="checkbox" class="tcheckbox" ng-model="vm.tags['tag_'+item.name+'_'+sitem.name]"
id="checkbox_{{item.name}}_{{sitem.name}}"
value="{{sitem.name}}"> {{ 'RESOURCESTAGS.' + item.name + '.' + sitem.name | translate}}
</label>
</dd>
</div>
<div class="margin-top-10">
<dt class="h-line"></dt>
<dd class="h-line"><span class="label label-tag text-uppercase"
ng-click="vm.clearAllCondition();">{{ 'CLEAR_ALL_CONDITION' | translate}}</span></dd>
</div>
</dl>
</div>
</div>
<div class="row" ng-show="vm.tmdb_info_ok == true" style="margin-top: 40px;">
<div class="row margin-bottom-40" ng-show="vm.tmdb_info_ok == true">
<div class="col-md-12 col-sm-12 col-xs-12">
<legend class="small-legend" translate="ENTER_VIDEO_NFO"></legend>
<textarea class="form-control" rows="10" ng-model="vm.videoNfo"></textarea>
<div class="col-xs-12">
<textarea class="form-control" rows="10" ng-model="vm.videoNfo"></textarea>
</div>
</div>
</div>
<div class="row margin-bottom-30" ng-show="vm.tmdb_info_ok == true" style="margin-top: 60px;">
<div class="row margin-bottom-40" ng-show="vm.tmdb_info_ok == true" style="margin-top: 60px;">
<div class="col-md-12 col-sm-12 col-xs-12">
<legend class="small-legend" translate="TORRENTS_SUBMIT_UPLOAD"></legend>
<div class="col-sm-6 col-sm-offset-3 text-center">
@@ -246,4 +120,235 @@
</div>
</div>
</div>
<!--
**********************************************************************
ng-template movieinfo.html
**********************************************************************
-->
<script type="text/ng-template" id="movieinfo.html">
<div>
<div class="row margin-bottom-40">
<div class="col-md-12 col-sm-12 col-xs-12">
<legend class="small-legend" translate="TMDB_RESOURCE_INFO"></legend>
<div class="col-md-4 col-sm-4 col-xs-12">
<img ng-src="{{vm.tmdbConfig.poster_img_base_url}}{{vm.movieinfo.poster_path}}" class="img-thumbnail">
</div>
<div class="col-md-8 col-sm-8 col-xs-12">
<dl class="dl-horizontal">
<dt class="h-line">{{ 'TMDB_FIELDS.ORIGINAL_TITLE' | translate}}</dt>
<dd class="h-line">{{vm.movieinfo.original_title}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.TITLE' | translate}}</dt>
<dd class="h-line">{{vm.movieinfo.title}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.ORIGINAL_LANGUAGE' | translate}}</dt>
<dd class="h-line">{{vm.movieinfo.original_language}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.GENRES' | translate}}</dt>
<dd class="h-line list-all-genres">
<span class="genres-item" ng-repeat="item in vm.movieinfo.genres">{{item.name}}</span>
</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.PRODUCTION_COMPANIES' | translate}}</dt>
<dd class="h-line list-all-companies">
<span class="company-item"
ng-repeat="item in vm.movieinfo.production_companies">{{item.name}}</span>
<span ng-show="vm.movieinfo.production_companies.length ==0">-</span>
</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.PRODUCTION_COUNTRIES' | translate}}</dt>
<dd class="h-line list-all-countries">
<span class="country-item" ng-repeat="item in vm.movieinfo.production_countries">{{item.iso_3166_1}}</span>
<span ng-show="vm.movieinfo.production_countries.length ==0">-</span>
</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.RELEASE_DATE' | translate}}</dt>
<dd class="h-line">{{vm.movieinfo.release_date}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.RUNTIME' | translate}}</dt>
<dd class="h-line">{{vm.movieinfo.runtime | runtime}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.BUDGET' | translate}}</dt>
<dd class="h-line">{{vm.movieinfo.budget | dollar:2}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.REVENUE' | translate}}</dt>
<dd class="h-line">{{vm.movieinfo.revenue | dollar:2}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.VOTE_AVERAGE' | translate}}</dt>
<dd class="h-line">{{vm.movieinfo.vote_average}} / {{vm.movieinfo.vote_count}} {{ 'TMDB_FIELDS.VOTE_UNIT' | translate}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.IMDB_LINK' | translate}}</dt>
<dd class="h-line"><a href="{{vm.imdbConfig.imdb_link_url}}{{vm.movieinfo.imdb_id}}"
target="_blank">{{vm.imdbConfig.imdb_link_url}}{{vm.movieinfo.imdb_id}}</a></dd>
<dt class="h-line">{{ 'TMDB_FIELDS.TMDB_LINK' | translate}}</dt>
<dd class="h-line"><a href="{{vm.tmdbConfig.tmdb_movie_link_url}}{{vm.movieinfo.id}}"
target="_blank">{{vm.tmdbConfig.tmdb_movie_link_url}}{{vm.movieinfo.id}}</a></dd>
<dt class="h-line">{{ 'TMDB_FIELDS.OVERVIEW' | translate}}</dt>
<dd class="h-line">{{vm.movieinfo.overview}}</dd>
</dl>
<legend class="xsmall-legend strong-legend" translate="TMDB_FIELDS.CAST"></legend>
<div class="row cast-list">
<div class="col-xs-4 col-md-2 text-center" ng-repeat="cast in vm.movieinfo.credits.cast | limitTo: 6">
<img ng-src="{{vm.tmdbConfig.cast_img_base_url}}{{cast.profile_path}}"
on-error-src="/./modules/core/client/img/default_face.jpg"
class="img-circle img-thumbnail img-responsive center-block">
<span class="cast-xs-info"><strong>{{cast.name}}</strong></span>
<p class="cast-xs-info">{{cast.character}}</p>
</div>
</div>
</div>
</div>
</div>
<div class="row margin-bottom-40">
<div class="col-md-12 col-sm-12 col-xs-12">
<legend class="small-legend" translate="SELECT_TAGS"></legend>
<dl class="dl-horizontal">
<div ng-repeat="item in vm.resourcesTags.movie.radio">
<dt class="h-line">{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}</dt>
<dd class="h-line">
<label class="radio-inline" ng-repeat="sitem in item.value">
<input type="radio" class="tradio" name="tag_{{item.name}}" ng-model="vm.tags['tag_'+item.name]"
id="radio_{{item.name}}{{$index}}"
value="{{sitem.name}}"> {{ 'RESOURCESTAGS.' + item.name + '.' + sitem.name | translate}}
</label>
</dd>
</div>
<div style="margin-top: 30px;"></div>
<div ng-repeat="item in vm.resourcesTags.movie.checkbox">
<dt class="h-line">{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}</dt>
<dd class="h-line">
<label class="checkbox-inline" ng-repeat="sitem in item.value">
<input type="checkbox" class="tcheckbox" ng-model="vm.tags['tag_'+item.name+'_'+sitem.name]"
id="checkbox_{{item.name}}_{{sitem.name}}"
value="{{sitem.name}}"> {{ 'RESOURCESTAGS.' + item.name + '.' + sitem.name | translate}}
</label>
</dd>
</div>
<div class="margin-top-10">
<dt class="h-line"></dt>
<dd class="h-line"><span class="label label-tag text-uppercase"
ng-click="vm.clearAllCondition();">{{ 'CLEAR_ALL_CONDITION' | translate}}</span></dd>
</div>
</dl>
</div>
</div>
</div>
</script>
<!--
**********************************************************************
ng-template tvinfo.html
**********************************************************************
-->
<script type="text/ng-template" id="tvinfo.html">
<div>
<div class="row margin-bottom-40">
<div class="col-md-12 col-sm-12 col-xs-12">
<legend class="small-legend" translate="TMDB_RESOURCE_INFO"></legend>
<div class="col-md-4 col-sm-4 col-xs-12">
<img ng-src="{{vm.tmdbConfig.poster_img_base_url}}{{vm.tvinfo.poster_path}}" class="img-thumbnail">
</div>
<div class="col-md-8 col-sm-8 col-xs-12">
<dl class="dl-horizontal">
<dt class="h-line">{{ 'TMDB_FIELDS.ORIGINAL_NAME' | translate}}</dt>
<dd class="h-line">{{vm.tvinfo.original_name}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.NAME' | translate}}</dt>
<dd class="h-line">{{vm.tvinfo.name}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.ORIGINAL_LANGUAGE' | translate}}</dt>
<dd class="h-line">{{vm.tvinfo.original_language}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.GENRES' | translate}}</dt>
<dd class="h-line list-all-genres">
<span class="genres-item" ng-repeat="item in vm.tvinfo.genres">{{item.name}}</span>
</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.PRODUCTION_COMPANIES' | translate}}</dt>
<dd class="h-line list-all-companies">
<span class="company-item"
ng-repeat="item in vm.tvinfo.production_companies">{{item.name}}</span>
<span ng-show="vm.tvinfo.production_companies.length ==0">-</span>
</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.PRODUCTION_COUNTRIES' | translate}}</dt>
<dd class="h-line list-all-countries">
<span class="country-item" ng-repeat="item in vm.tvinfo.origin_country">{{item}}</span>
<span ng-show="vm.tvinfo.origin_country.length ==0">-</span>
</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.FIRST_AIR_DATE' | translate}}</dt>
<dd class="h-line">{{vm.tvinfo.first_air_date}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.LAST_AIR_DATE' | translate}}</dt>
<dd class="h-line">{{vm.tvinfo.last_air_date}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.VOTE_AVERAGE' | translate}}</dt>
<dd class="h-line">{{vm.tvinfo.vote_average}} / {{vm.tvinfo.vote_count}} {{ 'TMDB_FIELDS.VOTE_UNIT' | translate}}</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.TMDB_LINK' | translate}}</dt>
<dd class="h-line"><a href="{{vm.tmdbConfig.tmdb_tv_link_url}}{{vm.tvinfo.id}}"
target="_blank">{{vm.tmdbConfig.tmdb_tv_link_url}}{{vm.tvinfo.id}}</a></dd>
<dt class="h-line">{{ 'TMDB_FIELDS.OVERVIEW' | translate}}</dt>
<dd class="h-line">{{vm.tvinfo.overview}}</dd>
</dl>
<legend class="xsmall-legend strong-legend" translate="TMDB_FIELDS.CAST"></legend>
<div class="row cast-list">
<div class="col-xs-4 col-md-2 text-center" ng-repeat="cast in vm.tvinfo.credits.cast | limitTo: 6">
<img ng-src="{{vm.tmdbConfig.cast_img_base_url}}{{cast.profile_path}}"
on-error-src="/./modules/core/client/img/default_face.jpg"
class="img-circle img-thumbnail img-responsive center-block">
<span class="cast-xs-info"><strong>{{cast.name}}</strong></span>
<p class="cast-xs-info">{{cast.character}}</p>
</div>
</div>
</div>
</div>
</div>
<div class="row margin-bottom-40">
<div class="col-md-12 col-sm-12 col-xs-12">
<legend class="small-legend" translate="SELECT_TAGS"></legend>
<dl class="dl-horizontal">
<div ng-repeat="item in vm.resourcesTags.tv.radio">
<dt class="h-line">{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}</dt>
<dd class="h-line">
<label class="radio-inline" ng-repeat="sitem in item.value">
<input type="radio" class="tradio" name="tag_{{item.name}}" ng-model="vm.tags['tag_'+item.name]"
id="radio_{{item.name}}{{$index}}"
value="{{sitem.name}}"> {{ 'RESOURCESTAGS.' + item.name + '.' + sitem.name | translate}}
</label>
</dd>
</div>
<div style="margin-top: 30px;"></div>
<div ng-repeat="item in vm.resourcesTags.tv.checkbox">
<dt class="h-line">{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}</dt>
<dd class="h-line">
<label class="checkbox-inline" ng-repeat="sitem in item.value">
<input type="checkbox" class="tcheckbox" ng-model="vm.tags['tag_'+item.name+'_'+sitem.name]"
id="checkbox_{{item.name}}_{{sitem.name}}"
value="{{sitem.name}}"> {{ 'RESOURCESTAGS.' + item.name + '.' + sitem.name | translate}}
</label>
</dd>
</div>
<div class="margin-top-10">
<dt class="h-line"></dt>
<dd class="h-line"><span class="label label-tag text-uppercase"
ng-click="vm.clearAllCondition();">{{ 'CLEAR_ALL_CONDITION' | translate}}</span></dd>
</div>
</dl>
</div>
</div>
</div>
</script>
</section>

View File

@@ -79,8 +79,8 @@
</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.TMDB_LINK' | translate}}</dt>
<dd class="h-line"><a href="{{vm.tmdbConfig.tmdb_link_url}}{{vm.torrentLocalInfo.resource_detail_info.id}}"
target="_blank">{{vm.tmdbConfig.tmdb_link_url}}{{vm.torrentLocalInfo.resource_detail_info.id}}</a>
<dd class="h-line"><a href="{{vm.tmdbConfig.tmdb_movie_link_url}}{{vm.torrentLocalInfo.resource_detail_info.id}}"
target="_blank">{{vm.tmdbConfig.tmdb_movie_link_url}}{{vm.torrentLocalInfo.resource_detail_info.id}}</a>
</dd>
<dt class="h-line">{{ 'TMDB_FIELDS.OVERVIEW' | translate}}</dt>

View File

@@ -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

View File

@@ -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']}
]

View File

@@ -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);

View File

@@ -4,7 +4,7 @@
<button class="btn btn-mt btn-donate center-block">{{'BUTTON_DNATE' | translate}}</button>
</div>
<div class="col-sm-10 col-md-9 col-md-offset-1">
<div marked src="'/modules/vip/client/templates/vip-'+vm.lang+'.md'">
<div marked src="'/modules/vip/client/templates/vip-'+vm.lang+'.md'" compile="true">
</div>
</div>
<div class="col-sm-2 col-md-2 btn-donate-show">

View File

@@ -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",