add download btn on every list item

change meanTorrent config
This commit is contained in:
OldHawk
2017-04-07 15:34:51 +08:00
parent 1a148f2eda
commit cdcacc6b85
17 changed files with 213 additions and 188 deletions

210
config/env/torrents.js vendored
View File

@@ -1,95 +1,129 @@
'use strict';
module.exports = {
//announce config
announce: {
url: 'http://127.0.0.1:3000/announce',
announce_prefix: '[CHD.im].',
admin: 'admin@imean.io',
open_tracker: true
},
tmdbConfig: {
//please change it to your api key from themoviedb.org
key: '7888f0042a366f63289ff571b68b7ce0',
backdrop_img_base_url: 'http://image.tmdb.org/t/p/w1280',
poster_img_base_url: 'http://image.tmdb.org/t/p/w500',
poster_list_base_url: 'http://image.tmdb.org/t/p/w92',
cast_img_base_url: 'http://image.tmdb.org/t/p/w132_and_h132_bestv2'
},
resourcesTags: {
movie: {
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: 'THREED',
value: [
{name: 'T3D', icon: ''},
{name: 'T2D', icon: ''},
{name: 'T2D_3D', icon: ''}
]
},
{
name: 'REGION',
value: [
{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: ''}
]
}
meanTorrentConfig: {
announce: {
url: 'http://127.0.0.1:3000/announce',
announce_prefix: '[CHD.im].',
admin: 'admin@imean.io',
open_tracker: true
},
torrentType: {
name: 'TYPE',
value: [
{name: 'MOVIE', value: 'movie'},
{name: 'MTV', value: 'MTV'},
{name: 'MUSIC', value: 'music'},
{name: 'OTHER', value: 'other'}
]
},
torrentStatus: {
name: 'STATUS',
value: [
{name: 'NEW', value: 'new'},
{name: 'REVIEWED', value: 'reviewed'},
{name: 'DELETED', value: 'deleted'}
]
},
torrentSalesType: {
name: 'SALESTYPE',
value: [
{name: 'U1/FREE'},
{name: 'U1/D.3'},
{name: 'U1/D.5'},
{name: 'U1/D1'},
{name: 'U2/FREE'},
{name: 'U2/D.3'},
{name: 'U2/D.5'},
{name: 'U2/D1'},
{name: 'U3/FREE'},
{name: 'U3/D.5'},
{name: 'U3/D1'}
]
},
tmdbConfig: {
//please change it to your api key from themoviedb.org
key: '7888f0042a366f63289ff571b68b7ce0',
backdrop_img_base_url: 'http://image.tmdb.org/t/p/w1280',
poster_img_base_url: 'http://image.tmdb.org/t/p/w500',
poster_list_base_url: 'http://image.tmdb.org/t/p/w92',
cast_img_base_url: 'http://image.tmdb.org/t/p/w132_and_h132_bestv2'
},
resourcesTags: {
movie: {
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: 'THREED',
value: [
{name: 'T3D', icon: ''},
{name: 'T2D', icon: ''},
{name: 'T2D_3D', icon: ''}
]
},
{
name: 'REGION',
value: [
{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: ''}
]
}
]
}
}
}
};

View File

@@ -66,7 +66,8 @@
FINISHED: '完成下载数',
IMDB_VOTES: 'IMDB 评分',
MORE_TAGS: '显示更多检索标签',
RESET_TAGS: '重置检索条件与标签'
RESET_TAGS: '重置检索条件与标签',
DOWNLOAD_TORRENT: 'Doanload the torrent'
},
//table fields
@@ -88,6 +89,7 @@
CLEAR_ALL_CONDITION: '清空所有条件',
MORE_TAGS: '显示更多标签',
CA_RESET: '重置条件',
CA_DOWNLOAD: '下载种子',
//TorrentsUploadsController
TORRENTS_UPLOAD_SUCCESSFULLY: '文件上传成功',

View File

@@ -66,7 +66,8 @@
FINISHED: 'Finished users',
IMDB_VOTES: 'IMDB Votes',
MORE_TAGS: 'Show More Search Tags',
RESET_TAGS: 'Reset All Search Tags'
RESET_TAGS: 'Reset All Search Tags',
DOWNLOAD_TORRENT: 'Doanload the torrent'
},
//table fields
@@ -88,6 +89,7 @@
CLEAR_ALL_CONDITION: 'Clear All Condition',
MORE_TAGS: 'More Tags',
CA_RESET: 'Reset',
CA_DOWNLOAD: 'Download',
//TorrentsUploadsController & views
TORRENTS_UPLOAD_SUCCESSFULLY: 'Successfully uploads file',

View File

@@ -5,11 +5,11 @@
.module('core')
.controller('HomeController', HomeController);
HomeController.$inject = ['$scope', '$translate', 'TorrentsService', 'Notification', 'TMDBConfig'];
HomeController.$inject = ['$scope', '$translate', 'TorrentsService', 'Notification', 'MeanTorrentConfig'];
function HomeController($scope, $translate, TorrentsService, Notification, TMDBConfig) {
function HomeController($scope, $translate, TorrentsService, Notification, MeanTorrentConfig) {
var vm = this;
vm.tmdbConfig = TMDBConfig.tmdbConfig;
vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;
vm.movieTopList = undefined;
vm.info_is_ready = false;

View File

@@ -1,5 +1,15 @@
@import (reference) "../../../../public/lib/bootstrap/less/variables.less";
.brand-title {
font-size: 25px;
font-weight: bold;
line-height: 18px;
color: #FF6600;
&:hover {
color: #fff;
}
}
.bodysize {
background-color: #fff;
min-height: 600px;
@@ -177,11 +187,18 @@
.tb-v-middle {
> tbody {
> tr {
.label-download {
display: none;
}
cursor: pointer;
&:hover {
.media-object {
opacity: 1;
}
.label-download {
padding: 2px 4px;
display: inline;
}
}
> .td-v-middle {
vertical-align: middle;
@@ -246,6 +263,18 @@
}
}
.label-download {
color: #fff;
font-size: 12px;
background-color: #FF6600;
//border-bottom:2px solid darken(#f1f8ff, 10%);
//border-color: darken(#f1f8ff, 10%);;
&:hover {
cursor: pointer;
background-color: darken(#FF6600, 10%);
}
}
.incline-block-valign {
display: inline-block;
vertical-align: middle;

View File

@@ -6,7 +6,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a ui-sref="home" class="navbar-brand"><span style="font-size: 25px; font-weight: bold; line-height: 18px;">CHD.im</span></a>
<a ui-sref="home" class="navbar-brand"><span class="brand-title">CHD.im</span></a>
</div>
<nav class="navbar-collapse" uib-collapse="!vm.isCollapsed" role="navigation">
<ul class="nav navbar-nav" ng-if="vm.menu.shouldRender(vm.authentication.user);">

View File

@@ -27,9 +27,7 @@ exports.renderIndex = function (req, res) {
res.render('modules/core/server/views/index', {
user: JSON.stringify(safeUserObject),
sharedConfig: JSON.stringify(config.shared),
announce: JSON.stringify(config.announce),
tmdbConfig: JSON.stringify(config.tmdbConfig),
resourcesTags: JSON.stringify(config.resourcesTags)
meanTorrentConfig: JSON.stringify(config.meanTorrentConfig)
});
};

View File

@@ -59,9 +59,7 @@
<script type="text/javascript">
var user = {{{ user }}};
var env = "{{ env }}";
var announce = {{{ announce }}};
var tmdbConfig = {{{ tmdbConfig }}};
var resourcesTags = {{{ resourcesTags }}};
var meanTorrentConfig = {{{ meanTorrentConfig }}};
</script>
<!--Load The Socket.io File-->

View File

@@ -5,14 +5,14 @@
.module('torrents')
.controller('TorrentsController', TorrentsController);
TorrentsController.$inject = ['$scope', '$state', '$translate', '$timeout', 'Authentication', 'Notification', 'TorrentsService', 'TMDBConfig',
'ResourcesTagsConfig'];
TorrentsController.$inject = ['$scope', '$state', '$translate', '$timeout', 'Authentication', 'Notification', 'TorrentsService',
'MeanTorrentConfig'];
function TorrentsController($scope, $state, $translate, $timeout, Authentication, Notification, TorrentsService, TMDBConfig, ResourcesTagsConfig) {
function TorrentsController($scope, $state, $translate, $timeout, Authentication, Notification, TorrentsService, MeanTorrentConfig) {
var vm = this;
vm.user = Authentication.user;
vm.tmdbConfig = TMDBConfig.tmdbConfig;
vm.resourcesTags = ResourcesTagsConfig.resourcesTags;
vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;
vm.resourcesTags = MeanTorrentConfig.meanTorrentConfig.resourcesTags;
vm.searchTags = [];
vm.searchKey = '';
@@ -193,6 +193,6 @@
e.removeClass('panel-collapsed');
i.removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up');
}
}
};
}
}());

View File

@@ -5,15 +5,15 @@
.module('torrents')
.controller('TorrentsUploadsController', TorrentsUploadsController);
TorrentsUploadsController.$inject = ['$scope', '$state', '$translate', '$timeout', 'Authentication', 'AnnounceConfig', 'Upload', 'Notification',
'TorrentsService', 'ResourcesTagsConfig', 'TMDBConfig'];
TorrentsUploadsController.$inject = ['$scope', '$state', '$translate', '$timeout', 'Authentication', 'MeanTorrentConfig', 'Upload', 'Notification',
'TorrentsService'];
function TorrentsUploadsController($scope, $state, $translate, $timeout, Authentication, AnnounceConfig, Upload, Notification,
TorrentsService, ResourcesTagsConfig, TMDBConfig) {
function TorrentsUploadsController($scope, $state, $translate, $timeout, Authentication, MeanTorrentConfig, Upload, Notification,
TorrentsService) {
var vm = this;
vm.announce = AnnounceConfig.announce;
vm.tmdbConfig = TMDBConfig.tmdbConfig;
vm.resourcesTags = ResourcesTagsConfig.resourcesTags;
vm.announce = MeanTorrentConfig.meanTorrentConfig.announce;
vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;
vm.resourcesTags = MeanTorrentConfig.meanTorrentConfig.resourcesTags;
vm.rule_items = [];
vm.user = Authentication.user;
vm.progress = 0;

View File

@@ -1,19 +0,0 @@
(function () {
'use strict';
// Authentication service for user variables
angular
.module('torrents.services')
.factory('AnnounceConfig', AnnounceConfig);
AnnounceConfig.$inject = ['$window'];
function AnnounceConfig($window) {
var config = {
announce: $window.announce
};
return config;
}
}());

View File

@@ -0,0 +1,19 @@
(function () {
'use strict';
// Authentication service for user variables
angular
.module('torrents.services')
.factory('MeanTorrentConfig', MeanTorrentConfig);
MeanTorrentConfig.$inject = ['$window'];
function MeanTorrentConfig($window) {
var config = {
meanTorrentConfig: $window.meanTorrentConfig
};
return config;
}
}());

View File

@@ -1,19 +0,0 @@
(function () {
'use strict';
// Authentication service for user variables
angular
.module('torrents.services')
.factory('ResourcesTagsConfig', ResourcesTagsConfig);
ResourcesTagsConfig.$inject = ['$window'];
function ResourcesTagsConfig($window) {
var config = {
resourcesTags: $window.resourcesTags
};
return config;
}
}());

View File

@@ -1,19 +0,0 @@
(function () {
'use strict';
// Authentication service for user variables
angular
.module('torrents.services')
.factory('TMDBConfig', TMDBConfig);
TMDBConfig.$inject = ['$window'];
function TMDBConfig($window) {
var config = {
tmdbConfig: $window.tmdbConfig
};
return config;
}
}());

View File

@@ -117,8 +117,14 @@
<img class="media-object" ng-src="{{vm.tmdbConfig.poster_list_base_url}}{{item.torrent_img}}" alt="...">
</div>
<div class="media-body">
<h5 class="media-heading">{{item.torrent_original_title}}<span
ng-show="item.torrent_original_title!=item.torrent_title"> / {{item.torrent_title}}</span></h5>
<h5 class="media-heading">{{item.torrent_original_title}}
<span ng-show="item.torrent_original_title!=item.torrent_title"> / {{item.torrent_title}}</span>
<span class="label label-download text-uppercase"
title="{{ 'TITLE_ALT.DOWNLOAD_TORRENT' | translate}}"
ng-click="vm.downloadTorrent();">
<i class="glyphicon glyphicon-arrow-right"></i> {{ 'CA_DOWNLOAD' | translate}}
</span>
</h5>
<div class="list-all-genres">
<span class="genres-item" ng-repeat="t in item.torrent_genres">{{t}}</span>

View File

@@ -13,7 +13,7 @@ var path = require('path'),
fs = require('fs'),
nt = require('nt'),
validator = require('validator'),
tmdb = require('moviedb')(config.tmdbConfig.key);
tmdb = require('moviedb')(config.meanTorrentConfig.tmdbConfig.key);
/**
* Create an article

View File

@@ -49,11 +49,9 @@ var TorrentSchema = new Schema({
trim: true
},
torrent_type: {
type: [{
type: String,
enum: ['movie', 'MTV', 'music', 'other']
}],
default: ['movie']
type: String,
default: 'movie',
trim: true
},
torrent_genres: {
type: [String],
@@ -101,18 +99,14 @@ var TorrentSchema = new Schema({
trim: true
},
torrent_status: {
type: [{
type: String,
enum: ['new', 'reviewed', 'deleted']
}],
default: ['new']
type: String,
default: 'new',
trim: true
},
torrent_sale_status: {
type: [{
type: String,
enum: ['FREE', '1/30%', '1/50%', '1/100%', '2/30%', '2/50%', '2/100%', '3/50%', '3/100%']
}],
default: ['1/100%']
type: String,
default: 'U1/D1',
trim: true
},
torrent_recommended: {
type: Number,