@@ -157,9 +123,9 @@
-
- {{item.torrent_release}}
+ {{item.resource_detail_info.release_date}}
IMDB {{item.torrent_imdb_votes}}
+ class="pull-right torrent-votes">IMDB {{item.resource_detail_info.vote_average}}
@@ -167,7 +133,7 @@
-
- {{item.torrent_title}}
+ {{item.resource_detail_info.title}}
@@ -187,7 +153,7 @@
ng-class="[$index > 0 ? 'hide-big' : 'show-big', $index >= 12 ? 'hide-more' : '']">
-
@@ -211,13 +177,13 @@
- {{$index + 1}}. {{nt.torrent_title}}
+ {{$index + 1}}. {{nt.resource_detail_info.title}}
- {{$index + 1}}. {{nt.torrent_title}}
+ {{$index + 1}}. {{nt.resource_detail_info.title}}
|
diff --git a/modules/core/server/controllers/errors.server.controller.js b/modules/core/server/controllers/errors.server.controller.js
index 027f8b9f..817f99de 100644
--- a/modules/core/server/controllers/errors.server.controller.js
+++ b/modules/core/server/controllers/errors.server.controller.js
@@ -39,6 +39,8 @@ 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/torrents/client/controllers/admin/admin-list.client.controller.js b/modules/torrents/client/controllers/admin/admin-list.client.controller.js
index 74d88d4d..2bcec81a 100644
--- a/modules/torrents/client/controllers/admin/admin-list.client.controller.js
+++ b/modules/torrents/client/controllers/admin/admin-list.client.controller.js
@@ -343,7 +343,8 @@
ModalConfirmService.showModal({}, modalOptions)
.then(function (result) {
- item.$remove(function (response) {
+ var dt = new TorrentsService(item);
+ dt.$remove(function (response) {
successCallback(response);
}, function (errorResponse) {
errorCallback(errorResponse);
diff --git a/modules/torrents/client/controllers/torrent-info.client.controller.js b/modules/torrents/client/controllers/torrent-info.client.controller.js
index f2585c2d..4d03444e 100644
--- a/modules/torrents/client/controllers/torrent-info.client.controller.js
+++ b/modules/torrents/client/controllers/torrent-info.client.controller.js
@@ -118,9 +118,10 @@
vm.torrentLocalInfo = TorrentsService.get({
torrentId: $stateParams.torrentId
}, function (res) {
- if (res.torrent_backdrop_img) {
- $('.backdrop').css('backgroundImage', 'url(' + vm.tmdbConfig.backdrop_img_base_url + res.torrent_backdrop_img + ')');
+ if (res.resource_detail_info.backdrop_path) {
+ $('.backdrop').css('backgroundImage', 'url(' + vm.tmdbConfig.backdrop_img_base_url + res.resource_detail_info.backdrop_path + ')');
}
+
vm.commentBuildPager();
vm.torrentTabs.push(
@@ -189,6 +190,7 @@
tmdbid: tmdb_id,
language: getStorageLangService.getLang()
}, function (res) {
+ res.release_date = $filter('date')(res.release_date, 'yyyy');
vm.doUpdateTorrentInfo(res);
}, function (err) {
Notification.error({
@@ -246,6 +248,23 @@
return tmp;
};
+ /**
+ * getDirector
+ * @returns {string}
+ */
+ vm.getDirector = function () {
+ var n = '-';
+
+ if (vm.torrentLocalInfo.resource_detail_info) {
+ angular.forEach(vm.torrentLocalInfo.resource_detail_info.credits.crew, function (item) {
+ if (item.job === 'Director') {
+ n = item.name;
+ }
+ });
+ }
+ return n;
+ };
+
/**
* getVideoNfoHtml
* @returns {*}
@@ -558,7 +577,7 @@
vm.sFile = undefined;
// Show error message
Notification.error({
- message: res.data,
+ message: res.data.message,
title: '
' + $translate.instant('SUBTITLE_UPLOAD_FAILED')
});
}
@@ -703,7 +722,7 @@
ModalConfirmService.showModal({}, modalOptions)
.then(function (result) {
- vm.getMovieInfo(vm.torrentLocalInfo.torrent_tmdb_id);
+ vm.getMovieInfo(vm.torrentLocalInfo.resource_detail_info.id);
});
};
@@ -712,62 +731,7 @@
* @param minfo
*/
vm.doUpdateTorrentInfo = function (movieinfo) {
- var d = new Date(movieinfo.release_date);
-
- var g = [];
- angular.forEach(movieinfo.genres, function (item) {
- g.push(item.name);
- });
-
- var com = [];
- angular.forEach(movieinfo.production_companies, function (item) {
- com.push(item.name);
- });
-
- var country = [];
- angular.forEach(movieinfo.production_countries, function (item) {
- country.push(item.iso_3166_1);
- });
-
- var casts = [];
- var i = 0;
- angular.forEach(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(movieinfo.credits.crew, function (item) {
- if (item.job === 'Director') {
- dir = item.name;
- }
- });
-
- vm.torrentLocalInfo.torrent_title = movieinfo.title;
- vm.torrentLocalInfo.torrent_original_title = movieinfo.original_title;
- vm.torrentLocalInfo.torrent_original_language = movieinfo.original_language;
- vm.torrentLocalInfo.torrent_tagline = movieinfo.tagline;
- vm.torrentLocalInfo.torrent_overview = movieinfo.overview;
- vm.torrentLocalInfo.torrent_genres = g;
- vm.torrentLocalInfo.torrent_companies = com;
- vm.torrentLocalInfo.torrent_countries = country;
- vm.torrentLocalInfo.torrent_cast = casts;
- vm.torrentLocalInfo.torrent_director = dir;
- vm.torrentLocalInfo.torrent_imdb_votes = movieinfo.vote_average;
- vm.torrentLocalInfo.torrent_imdb_votes_users = movieinfo.vote_count;
- vm.torrentLocalInfo.torrent_runtime = movieinfo.runtime;
- vm.torrentLocalInfo.torrent_budget = movieinfo.budget;
- vm.torrentLocalInfo.torrent_revenue = movieinfo.revenue;
- vm.torrentLocalInfo.torrent_img = movieinfo.poster_path;
- vm.torrentLocalInfo.torrent_backdrop_img = movieinfo.backdrop_path;
- vm.torrentLocalInfo.torrent_release = d.getFullYear();
+ vm.torrentLocalInfo.resource_detail_info = movieinfo;
vm.torrentLocalInfo.$update(function (response) {
successCallback(response);
diff --git a/modules/torrents/client/controllers/uploads.client.controller.js b/modules/torrents/client/controllers/uploads.client.controller.js
index c8f385a9..633a2913 100644
--- a/modules/torrents/client/controllers/uploads.client.controller.js
+++ b/modules/torrents/client/controllers/uploads.client.controller.js
@@ -6,10 +6,10 @@
.controller('TorrentsUploadController', TorrentsUploadController);
TorrentsUploadController.$inject = ['$scope', '$state', '$translate', '$timeout', 'Authentication', 'MeanTorrentConfig', 'Upload', 'Notification',
- 'TorrentsService', 'getStorageLangService'];
+ 'TorrentsService', 'getStorageLangService', '$filter'];
function TorrentsUploadController($scope, $state, $translate, $timeout, Authentication, MeanTorrentConfig, Upload, Notification,
- TorrentsService, getStorageLangService) {
+ TorrentsService, getStorageLangService, $filter) {
var vm = this;
vm.announce = MeanTorrentConfig.meanTorrentConfig.announce;
vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;
@@ -140,6 +140,8 @@
console.log(res);
vm.movieinfo = res;
+
+ vm.movieinfo.release_date = $filter('date')(vm.movieinfo.release_date, 'yyyy');
}, function (err) {
vm.tmdb_info_ok = false;
vm.tmdb_isloading = false;
@@ -154,13 +156,15 @@
* create
*/
vm.create = function () {
- var d = new Date(vm.movieinfo.release_date);
+ //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;
@@ -181,71 +185,53 @@
});
});
- 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;
- }
- });
+ //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;
+ // }
+ //});
var torrent = new TorrentsService({
info_hash: vm.torrentInfo.info_hash,
torrent_filename: vm.torrentInfo.filename,
- torrent_tmdb_id: vm.tmdb_id,
- torrent_imdb_id: vm.movieinfo.imdb_id,
- torrent_title: vm.movieinfo.title,
- torrent_original_title: vm.movieinfo.original_title,
- torrent_original_language: vm.movieinfo.original_language,
- torrent_tagline: vm.movieinfo.tagline,
- torrent_overview: vm.movieinfo.overview,
torrent_type: 'movie',
- torrent_genres: g,
- torrent_companies: com,
- torrent_countries: country,
- torrent_cast: casts,
- torrent_director: dir,
torrent_tags: t,
torrent_nfo: vm.videoNfo,
torrent_announce: vm.torrentInfo.announce,
- torrent_imdb_votes: vm.movieinfo.vote_average,
- torrent_imdb_votes_users: vm.movieinfo.vote_count,
- torrent_runtime: vm.movieinfo.runtime,
- torrent_budget: vm.movieinfo.budget,
- torrent_revenue: vm.movieinfo.revenue,
torrent_size: l,
- torrent_img: vm.movieinfo.poster_path,
- torrent_backdrop_img: vm.movieinfo.backdrop_path,
- torrent_release: d.getFullYear()
+
+ resource_detail_info: vm.movieinfo
});
torrent.$save(function (response) {
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 6ce8d039..f48eae70 100644
--- a/modules/torrents/client/views/admin/admin-list.client.view.html
+++ b/modules/torrents/client/views/admin/admin-list.client.view.html
@@ -124,11 +124,12 @@
|