mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2025-01-11 23:48:07 +00:00
add approved only content import options
This commit is contained in:
parent
9f3ed45a7c
commit
4135e70b62
@ -140,9 +140,12 @@ define('API_EXPORT_MAGNET_VIEWS_ENABLED', true); // depends of API_EXPORT_EN
|
|||||||
/// Import
|
/// Import
|
||||||
define('API_IMPORT_ENABLED', true);
|
define('API_IMPORT_ENABLED', true);
|
||||||
|
|
||||||
define('API_IMPORT_USERS_ENABLED', true); // depends of API_IMPORT_ENABLED
|
define('API_IMPORT_USERS_ENABLED', true); // depends of API_IMPORT_ENABLED
|
||||||
define('API_IMPORT_MAGNETS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED
|
define('API_IMPORT_USERS_APPROVED_ONLY', false); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED
|
||||||
define('API_IMPORT_MAGNET_DOWNLOADS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED, API_IMPORT_MAGNETS_ENABLED
|
define('API_IMPORT_MAGNETS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED
|
||||||
define('API_IMPORT_MAGNET_COMMENTS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED, API_IMPORT_MAGNETS_ENABLED
|
define('API_IMPORT_MAGNETS_APPROVED_ONLY', false); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED, API_IMPORT_MAGNETS_ENABLED
|
||||||
define('API_IMPORT_MAGNET_STARS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED, API_IMPORT_MAGNETS_ENABLED
|
define('API_IMPORT_MAGNET_DOWNLOADS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED, API_IMPORT_MAGNETS_ENABLED
|
||||||
define('API_IMPORT_MAGNET_VIEWS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED, API_IMPORT_MAGNETS_ENABLED
|
define('API_IMPORT_MAGNET_COMMENTS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED, API_IMPORT_MAGNETS_ENABLED
|
||||||
|
define('API_IMPORT_MAGNET_COMMENTS_APPROVED_ONLY', false); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED, API_IMPORT_MAGNETS_ENABLED, API_IMPORT_MAGNET_COMMENTS_ENABLED
|
||||||
|
define('API_IMPORT_MAGNET_STARS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED, API_IMPORT_MAGNETS_ENABLED
|
||||||
|
define('API_IMPORT_MAGNET_VIEWS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED, API_IMPORT_MAGNETS_ENABLED
|
@ -69,6 +69,12 @@ try
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip import on user approved required
|
||||||
|
if (API_IMPORT_USERS_APPROVED_ONLY && !$remoteUser->approved)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Yggdrasil connections only
|
// Yggdrasil connections only
|
||||||
else if (!preg_match(YGGDRASIL_HOST_REGEX, $remoteUser->address))
|
else if (!preg_match(YGGDRASIL_HOST_REGEX, $remoteUser->address))
|
||||||
{
|
{
|
||||||
@ -170,6 +176,12 @@ try
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip import on magnet approved required
|
||||||
|
if (API_IMPORT_MAGNETS_APPROVED_ONLY && !$remoteMagnet->approved)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Add new magnet if not exist by timestamp added for this user
|
// Add new magnet if not exist by timestamp added for this user
|
||||||
if (!$localMagnet = $db->findMagnet($aliasUserId[$remoteMagnet->userId], $remoteMagnet->timeAdded))
|
if (!$localMagnet = $db->findMagnet($aliasUserId[$remoteMagnet->userId], $remoteMagnet->timeAdded))
|
||||||
{
|
{
|
||||||
@ -395,6 +407,12 @@ try
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip import on magnet comment approved required
|
||||||
|
if (API_IMPORT_MAGNET_COMMENTS_APPROVED_ONLY && !$remoteMagnetComment->approved)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Add new magnet comment if not exist by timestamp added for this user
|
// Add new magnet comment if not exist by timestamp added for this user
|
||||||
if (!$db->findMagnetComment($aliasMagnetId[$remoteMagnetComment->magnetId],
|
if (!$db->findMagnetComment($aliasMagnetId[$remoteMagnetComment->magnetId],
|
||||||
$aliasUserId[$remoteMagnetComment->userId],
|
$aliasUserId[$remoteMagnetComment->userId],
|
||||||
|
Loading…
Reference in New Issue
Block a user