Added mass change index, added delete all movies from admin-panel

This commit is contained in:
zeldaroot 2021-03-22 23:09:55 +02:00
parent 3beec0d287
commit ef9abb6724
8 changed files with 242 additions and 179 deletions

View file

@ -317,6 +317,7 @@ module.exports = {
"index": {
"name": "New series of serials",
"count": 12,
"max": 60,
"order": 2,
"latest": 0,
"custom": []

View file

@ -317,6 +317,7 @@ module.exports = {
"index": {
"name": "Новые серии сериалов",
"count": 12,
"max": 60,
"order": 2,
"latest": 0,
"custom": [

View file

@ -206,6 +206,9 @@ if (Math.ceil(os.freemem()) < 50) {
if (id) {
task.type_id = task.path;
}
} else if (!task.id) {
id = 0;
ids.push(r);
} else {
id = r['kp_id'];
task.type_id = 'kp_id';
@ -227,14 +230,6 @@ if (Math.ceil(os.freemem()) < 50) {
}
);
} else if (
task.page === 'themoviedb' ||
task.page === 'tmdb' ||
task.page === 'themoviedb_all' ||
task.page === 'tmdb_all' ||
task.page === 'themoviedb_adult' ||
task.page === 'tmdb_adult' ||
task.page === 'themoviedb_popularity' ||
task.page === 'tmdb_popularity' ||
task.page === 'themoviedb_movie' ||
task.page === 'tmdb_movie' ||
task.page === 'themoviedb_tv_series' ||
@ -265,32 +260,7 @@ if (Math.ceil(os.freemem()) < 50) {
adult: false,
popularity: 0.6
};
if (task.page === 'themoviedb' || task.page === 'tmdb') {
urls.push(f1 + 'movie' + f2);
urls.push(f1 + 'tv_series' + f2);
} else if (
task.page === 'themoviedb_all' ||
task.page === 'tmdb_all'
) {
urls.push(f1 + 'movie' + f2);
urls.push(f1 + 'tv_series' + f2);
filter.adult = 'all';
filter.popularity = 'all';
} else if (
task.page === 'themoviedb_adult' ||
task.page === 'tmdb_adult'
) {
urls.push(f1 + 'movie' + f2);
urls.push(f1 + 'tv_series' + f2);
filter.adult = 'all';
} else if (
task.page === 'themoviedb_popularity' ||
task.page === 'tmdb_popularity'
) {
urls.push(f1 + 'movie' + f2);
urls.push(f1 + 'tv_series' + f2);
filter.popularity = 'all';
} else if (
if (
task.page === 'themoviedb_movie' ||
task.page === 'tmdb_movie'
) {

View file

@ -217,7 +217,6 @@ function codePlayer(type, movie, options) {
data['data-douban'] = movie.custom.douban_id ? movie.custom.douban_id : '';
data['data-tvmaze'] = movie.custom.tvmaze_id ? movie.custom.tvmaze_id : '';
data['data-wa'] = movie.custom.wa_id ? movie.custom.wa_id : '';
data['data-videospider_tv'] = '' + movie.type === '1' ? '1' : '0';
data['data-season'] = serial.season ? serial.season : '';
data['data-episode'] = serial.episode ? serial.episode : '';
data['data-translate'] = serial.translate ? serial.translate : '';

View file

@ -1123,7 +1123,9 @@ router.post('/change', function(req, res) {
config.domain +
'/log/movies.pid',
function(err) {
return callback();
setTimeout(function() {
return callback();
}, 5000);
}
);
},
@ -1139,10 +1141,18 @@ router.post('/change', function(req, res) {
config.domain +
'/log/movies.pid; fi',
function(err) {
return callback();
setTimeout(function() {
return callback();
}, 5000);
}
);
},
movies_zero_rt: function(callback) {
if (!form.movies_zero_rt) return callback(null, 'Null');
exec('/usr/bin/cinemapress container zero_rt &', function(err) {
return callback();
});
},
protocol: function(callback) {
if (!form.config || typeof form.config.protocol === 'undefined')
return callback(null, 'Null');

View file

@ -55,6 +55,10 @@
if (movies_cron_stop)
movies_cron_stop.addEventListener('click', moviesCronStopData);
var movies_zero_rt = document.querySelector('#movies_zero_rt');
if (movies_zero_rt)
movies_zero_rt.addEventListener('click', moviesZeroRtData);
var database = document.querySelector('#database');
if (database)
database.addEventListener('click', databaseData);
@ -111,7 +115,7 @@
if (err) {
self.innerHTML = '<span class="fa fa-bug"></span>&nbsp;&nbsp;' + err;
} else {
location.reload();
window.location.href += (window.location.href.indexOf('?') + 1 ? '&' : '?') + 'reload';
}
});
@ -160,7 +164,7 @@
setTimeout(function() {
if (stop) return;
location.reload();
window.location.href += (window.location.href.indexOf('?') + 1 ? '&' : '?') + 'reload';
}, 25000);
}
@ -188,7 +192,7 @@
setTimeout(function() {
if (stop) return;
location.reload();
window.location.href += (window.location.href.indexOf('?') + 1 ? '&' : '?') + 'reload';
}, 25000);
}
@ -217,7 +221,7 @@
setTimeout(function() {
if (stop) return;
location.reload();
window.location.href += (window.location.href.indexOf('?') + 1 ? '&' : '?') + 'reload';
}, 25000);
}
@ -249,7 +253,7 @@
setTimeout(function() {
if (stop) return;
location.reload();
window.location.href += (window.location.href.indexOf('?') + 1 ? '&' : '?') + 'reload';
}, 25000);
}
@ -281,11 +285,38 @@
setTimeout(function() {
if (stop) return;
location.reload();
window.location.href += (window.location.href.indexOf('?') + 1 ? '&' : '?') + 'reload';
}, 25000);
}
function moviesZeroRtData() {
var r = prompt('This will delete all movies from your database! Please enter your domain «<%- config.domain.toLowerCase() %>»:');
if (!r || r !== '<%- config.domain.toLowerCase() %>') {
return;
}
var self = this;
self.removeEventListener('click', moviesZeroRtData);
self.innerHTML = '<i class="fa fa-sync-alt fa-spin"></i>';
var data = {
'movies_zero_rt': true
};
saveData();
setTimeout(function() {
sendServer(data, function(err, result) {});
}, 5000);
setTimeout(function() {
self.innerHTML = '<span class="fa fa-check text-success"></span>';
alert('Restart page 2 times.');
}, 10000);
}
function databaseData() {
<% if (config.database.key === 'FREE') { %>
@ -1169,15 +1200,15 @@
data.config.urls &&
data.config.urls.admin &&
data.config.urls.admin !== '<%- config.urls.admin %>') {
location.href = '/' + data.config.urls.admin;
window.location.href = '/' + data.config.urls.admin;
} else if (data.config &&
data.config.subdomain &&
data.config.subdomain !== '<%- config.subdomain %>') {
location.href = '<%- config.protocol %>' + data.config.subdomain + '<%- config.domain + '/' + config.urls.admin %>';
window.location.href = '<%- config.protocol %>' + data.config.subdomain + '<%- config.domain + '/' + config.urls.admin %>';
} else if (data.content && !data.content.id) {
location.href = '<%- '/' + config.urls.admin + '/content' %>';
window.location.href = '<%- '/' + config.urls.admin + '/content' %>';
} else if (data.movie && !data.movie.id) {
location.href = '<%- '/' + config.urls.admin + '/movies' %>';
window.location.href = '<%- '/' + config.urls.admin + '/movies' %>';
} else if (data.config && data.config.theme && data.config.theme !== '<%- config.theme %>') {
self.innerHTML = '<span class="fa fa-save"></span>&nbsp;&nbsp;<%= __('Сохранить изменения') %>';
self.addEventListener('click', saveData);

View file

@ -632,7 +632,7 @@
<% } %>
</select>
</div>
<div class="col-sm-3">
<div class="col-sm-4">
<select name="modules.episode.data.index.count"
class="form-control without">
<% for (var i = 0; i <= 99; i++) { %>
@ -660,7 +660,41 @@
<% } %>
</select>
</div>
<div class="col-sm-7">
<div class="col-sm-2 text-center">
/
</div>
<div class="col-sm-4">
<select name="modules.episode.data.index.max"
class="form-control without">
<% for (var i = 0; i <= 99; i++) { %>
<% if (modules.episode.data.index.max === i) { %>
<% if (i === 0) { %>
<option value="<%= i %>" selected="selected">
<%= __('Не показывать') %>
</option>
<% } else { %>
<option value="<%= i %>" selected="selected">
<%- i %> <%= __('серий') %>
</option>
<% } %>
<% } else { %>
<% if (i === 0) { %>
<option value="<%= i %>">
<%= __('Не показывать') %>
</option>
<% } else { %>
<option value="<%= i %>">
<%- i %> <%= __('серий') %>
</option>
<% } %>
<% } %>
<% } %>
</select>
</div>
<div class="spacer-10"></div>
<div class="col-sm-12">
<input type="text" name="modules.episode.data.index.name"
value="<%= modules.episode.data.index.name %>"
class="form-control">

View file

@ -941,6 +941,134 @@
<div class="spacer-10"></div>
<div class="col-lg-12 col-xs-12">
<div class="faq">
<article class="faq-group">
<header class="text-muted text-left">
<i class="fa fa-plus"></i>
<h3><%= __('Доступные для заполнения информации параметры') %></h3>
</header>
<div class="faq-content clearfix">
<div class="row">
<div class="col-sm-12">
<div class="helper-text-box text-left condition-params">
<div>
<code>kp_id</code> <span>464963</span>
</div>
<div>
<code>title_ru</code>
<span><%= __('Игра престолов') %></span>
</div>
<div>
<code>title_en</code>
<span>Game of Thrones</span>
</div>
<div>
<code>quality</code>
<span>4K</span>
</div>
<div>
<code>translate</code>
<span>English</span>
</div>
<div>
<code>year</code>
<span><%= __('2020') %></span>
</div>
<div>
<code>country</code>
<span><%= __('США') %></span>
</div>
<div>
<code>director</code>
<span><%= __('Тим Бертон') %></span>
</div>
<div>
<code>genre</code>
<span><%= __('комедия') %></span>
</div>
<div>
<code>actor</code>
<span><%= __('Том Круз') %></span>
</div>
<div>
<code>rating</code>
<span>92</span>
</div>
<div>
<code>vote</code>
<span>1871227</span>
</div>
<div>
<code>kp_rating</code>
<span>90</span>
</div>
<div>
<code>kp_vote</code>
<span>278374</span>
</div>
<div>
<code>imdb_rating</code>
<span>94</span>
</div>
<div>
<code>imdb_vote</code>
<span>1592853</span>
</div>
<div>
<code>type</code>
<span>0</span>
</div>
<div>
<code>premiere</code>
<span>2011-04-17</span>
</div>
<div>
<code>poster</code>
<span>1</span>
</div>
<div>
<code>pictures</code>
<span>/suopoADq0k8YZr4dQXcU6pToj6s.jpg</span>
</div>
<div>
<code>custom.imdb_id</code>
<span>tt0944947</span>
</div>
<div>
<code>custom.tmdb_id</code>
<span>1399</span>
</div>
<div>
<code>custom.douban_id</code>
<span>26584183</span>
</div>
<div>
<code>custom.tvmaze_id</code>
<span>82</span>
</div>
<div>
<code>custom.wa_id</code>
<span>36896</span>
</div>
<div>
<code>custom.movie_id</code>
<span>[number]</span>
</div>
<div>
<code>custom.other_key</code>
<span>[string]</span>
</div>
</div>
</div>
</div>
</div>
</article>
</div>
</div>
<div class="spacer-10"></div>
<div class="col-lg-12 col-xs-12">
<div class="faq">
<article class="faq-group">
@ -1007,14 +1135,21 @@
<div class="spacer-10"></div>
<div class="col-lg-6 col-xs-6 text-center" style="margin-bottom: 10px">
<div class="col-lg-5 col-xs-5 text-center" style="margin-bottom: 10px">
<span class="btn btn-primary btn-sm btn-block movies_cron" id="movies_cron">
<i class="fas fa-receipt"></i>&nbsp;&nbsp;<%= __('Запустить получение информации') %>
<span class="visible-xs"><i class="fas fa-receipt"></i></span>
<span class="hidden-xs"><i class="fas fa-receipt"></i>&nbsp;&nbsp;<%= __('Запустить получение информации') %></span>
</span>
</div>
<div class="col-lg-6 col-xs-6 text-center" style="margin-bottom: 10px">
<div class="col-lg-5 col-xs-5 text-center" style="margin-bottom: 10px">
<span class="btn btn-primary btn-sm btn-block movies_cron_stop" id="movies_cron_stop">
<i class="fas fa-hand-paper"></i>&nbsp;&nbsp;<%= __('Остановить получение информации') %>
<span class="visible-xs"><i class="fas fa-hand-paper"></i></span>
<span class="hidden-xs"><i class="fas fa-hand-paper"></i>&nbsp;&nbsp;<%= __('Остановить получение информации') %></span>
</span>
</div>
<div class="col-lg-2 col-xs-2 text-center" style="margin-bottom: 10px">
<span class="btn btn-primary btn-sm btn-block movies_zero_rt" id="movies_zero_rt">
<i class="fas fa-trash"></i>
</span>
</div>
<style>
@ -1034,6 +1169,14 @@
background: #22172a;
border: 1px solid #2f374b !important;
}
.movies_zero_rt {
background: #351a18;
border: 1px solid #2f374b !important;
}
.movies_zero_rt:hover {
background: #2a1315;
border: 1px solid #2f374b !important;
}
</style>
<div class="col-sm-12">
@ -1181,132 +1324,6 @@
</div>
</article>
</div>
<div class="spacer-10"></div>
<div class="faq">
<article class="faq-group">
<header class="text-muted text-left">
<i class="fa fa-plus"></i>
<h3><%= __('Доступные для заполнения информации параметры') %></h3>
</header>
<div class="faq-content clearfix">
<div class="row">
<div class="col-sm-12">
<div class="helper-text-box text-left condition-params">
<div>
<code>kp_id</code> <span>464963</span>
</div>
<div>
<code>title_ru</code>
<span><%= __('Игра престолов') %></span>
</div>
<div>
<code>title_en</code>
<span>Game of Thrones</span>
</div>
<div>
<code>quality</code>
<span>4K</span>
</div>
<div>
<code>translate</code>
<span>English</span>
</div>
<div>
<code>year</code>
<span><%= __('2020') %></span>
</div>
<div>
<code>country</code>
<span><%= __('США') %></span>
</div>
<div>
<code>director</code>
<span><%= __('Тим Бертон') %></span>
</div>
<div>
<code>genre</code>
<span><%= __('комедия') %></span>
</div>
<div>
<code>actor</code>
<span><%= __('Том Круз') %></span>
</div>
<div>
<code>rating</code>
<span>92</span>
</div>
<div>
<code>vote</code>
<span>1871227</span>
</div>
<div>
<code>kp_rating</code>
<span>90</span>
</div>
<div>
<code>kp_vote</code>
<span>278374</span>
</div>
<div>
<code>imdb_rating</code>
<span>94</span>
</div>
<div>
<code>imdb_vote</code>
<span>1592853</span>
</div>
<div>
<code>type</code>
<span>0</span>
</div>
<div>
<code>premiere</code>
<span>2011-04-17</span>
</div>
<div>
<code>poster</code>
<span>1</span>
</div>
<div>
<code>pictures</code>
<span>/suopoADq0k8YZr4dQXcU6pToj6s.jpg</span>
</div>
<div>
<code>custom.imdb_id</code>
<span>tt0944947</span>
</div>
<div>
<code>custom.tmdb_id</code>
<span>1399</span>
</div>
<div>
<code>custom.douban_id</code>
<span>26584183</span>
</div>
<div>
<code>custom.tvmaze_id</code>
<span>82</span>
</div>
<div>
<code>custom.wa_id</code>
<span>36896</span>
</div>
<div>
<code>custom.movie_id</code>
<span>[number]</span>
</div>
<div>
<code>custom.other_key</code>
<span>[string]</span>
</div>
</div>
</div>
</div>
</div>
</article>
</div>
</div>
</div>
</div>