diff --git a/include/functions.php b/include/functions.php index 05f09184..85b052c1 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,20 +1,29 @@ "是否在种子列表展示审核状态图标,默认: '否'。", 'row_approval_status_none_visible' => '未审核种子是否可见', 'text_approval_status_none_visible_note' => "默认:'是'。若改为'否',审核不为[通过]状态时强制显示审核状态图标。", + 'row_imdb_language' => 'IMDB 语言', + 'text_imdb_language_note' => '抓取 IMDB 数据使用的语言。', ); ?> diff --git a/lang/cht/lang_settings.php b/lang/cht/lang_settings.php index d6eccc36..95587b1f 100644 --- a/lang/cht/lang_settings.php +++ b/lang/cht/lang_settings.php @@ -762,6 +762,8 @@ $lang_settings = array 'text_approval_status_icon_enabled_note' => "是否在種子列表展示審核狀態圖標,默認: '否'。", 'row_approval_status_none_visible' => '未審核種子是否可見', 'text_approval_status_none_visible_note' => "默認:'是'。若改為'否',審核不為[通過]狀態時強製顯示審核狀態圖標。", + 'row_imdb_language' => 'IMDB 語言', + 'text_imdb_language_note' => '抓取 IMDB 數據使用的語言。', ); ?> diff --git a/lang/en/lang_settings.php b/lang/en/lang_settings.php index 6e832e57..4b5cb5da 100644 --- a/lang/en/lang_settings.php +++ b/lang/en/lang_settings.php @@ -762,6 +762,8 @@ $lang_settings = array 'text_approval_status_icon_enabled_note' => "Whether to show the approval status icon in the torrent list, default: 'No'.", 'row_approval_status_none_visible' => 'Visibility of not reviewed torrents', 'text_approval_status_none_visible_note' => "Default: 'Yes'. If change to 'No', force to show approval status icon when audit is not [allow] status.", + 'row_imdb_language' => 'IMDB Language', + 'text_imdb_language_note' => 'Languages used to crawl IMDB data.', ); ?> diff --git a/nexus/Imdb/Imdb.php b/nexus/Imdb/Imdb.php index 0be00d24..5da42934 100644 --- a/nexus/Imdb/Imdb.php +++ b/nexus/Imdb/Imdb.php @@ -28,9 +28,16 @@ class Imdb $config->cachedir = $cacheDir; $config->photodir = $photoDir; $config->photoroot = $photoRoot; + $config->language = get_setting('main.imdb_language', 'en-US'); $this->config = $config; } + public static function listSupportLanguages(): array + { + $data = require_once sprintf('%s/resources/lang/%s/imdb.php', ROOT_PATH, get_langfolder_cookie(true)); + return $data['languages']; + } + public function setDebug($debug) { $this->config->debug = $debug; diff --git a/nexus/Install/settings.default.php b/nexus/Install/settings.default.php index 38a495f2..2d4590b3 100644 --- a/nexus/Install/settings.default.php +++ b/nexus/Install/settings.default.php @@ -90,6 +90,7 @@ return array ( 'enable_technical_info' => 'no', 'site_language_enabled' => \App\Models\Language::DEFAULT_ENABLED, 'show_top_uploader' => 'no', + 'imdb_language' => 'en-US', ), 'smtp' => array ( diff --git a/public/settings.php b/public/settings.php index c5d10dc6..3f117ea6 100644 --- a/public/settings.php +++ b/public/settings.php @@ -43,7 +43,7 @@ if ($action == 'savesettings_main') // save main 'showpolls','showstats','showlastxtorrents', 'showtrackerload','showshoutbox','showfunbox','showoffer','sptime','showhelpbox','enablebitbucket', 'smalldescription','altname','extforum','extforumurl','defaultlang','defstylesheet', 'donation','spsct','browsecat','specialcat','waitsystem', 'maxdlsystem','bitbucket','torrentnameprefix', 'showforumstats','verification','invite_count','invite_timeout', 'seeding_leeching_time_calc_start', - 'startsubid', 'logo', 'showlastxforumposts', 'enable_technical_info', 'site_language_enabled', 'show_top_uploader', + 'startsubid', 'logo', 'showlastxforumposts', 'enable_technical_info', 'site_language_enabled', 'show_top_uploader', 'imdb_language', ); GetVar($validConfig); $MAIN = []; @@ -728,6 +728,14 @@ elseif ($action == 'mainsettings') // main settings yesorno($lang_settings['row_show_classic'],'showclassicmovies', $MAIN['showclassicmovies'], $lang_settings['text_show_classic_note']); yesorno($lang_settings['row_show_top_uploader'],'show_top_uploader', $MAIN['show_top_uploader'], $lang_settings['text_show_top_uploader_note']); yesorno($lang_settings['row_enable_imdb_system'],'showimdbinfo', $MAIN['showimdbinfo'], $lang_settings['text_imdb_system_note']); + + $imdbLanguages = ""; + tr($lang_settings['row_imdb_language'], $imdbLanguages."
".$lang_settings['text_imdb_language_note'], 1); + yesorno($lang_settings['row_enable_pt_gen_system'],'enable_pt_gen_system', $MAIN['enable_pt_gen_system'], $lang_settings['text_enable_pt_gen_system_note']); tr($lang_settings['row_pt_gen_api_point']," ".$lang_settings['text_pt_gen_api_point_note'], 1); yesorno($lang_settings['row_enable_nfo'],'enablenfo', $MAIN['enablenfo'], $lang_settings['text_enable_nfo_note']); diff --git a/public/torrentrss.php b/public/torrentrss.php index ef56be14..cd549b8a 100644 --- a/public/torrentrss.php +++ b/public/torrentrss.php @@ -77,11 +77,10 @@ if($showrows < 1 || $showrows > 50) $showrows = 10; $limit .= $showrows; -$where = ''; //approval status $approvalStatusNoneVisible = get_setting('torrent.approval_status_none_visible'); if ($approvalStatusNoneVisible == 'no' && get_user_class() < $staffmem_class) { - $where = "torrents.approval_status = " . \App\Models\Torrent::APPROVAL_STATUS_ALLOW; + $where .= ($where ? " AND " : "") . "torrents.approval_status = " . \App\Models\Torrent::APPROVAL_STATUS_ALLOW; } function get_where($tablename = "sources", $itemname = "source", $getname = "sou") diff --git a/public/torrents.php b/public/torrents.php index a5d69953..cd20e0ae 100644 --- a/public/torrents.php +++ b/public/torrents.php @@ -1055,10 +1055,10 @@ if ($allsec != 1 || $enablespecial != 'yes'){ //do not print searchbox if showin diff --git a/resources/lang/en/imdb.php b/resources/lang/en/imdb.php new file mode 100644 index 00000000..b9942c0b --- /dev/null +++ b/resources/lang/en/imdb.php @@ -0,0 +1,15 @@ + [ + 'en-US' => 'English (United States)', + 'fr-CA' => 'French (Canada)', + 'fr-FR' => 'French (France)', + 'de-DE' => 'German', + 'hi-IN' => 'Hindi', + 'it-IT' => 'Italian', + 'pt-BR' => 'Portuguese (Brazil)', + 'es-ES' => 'Spanish (Spain)', + 'es-MX' => 'Spanish (Mexico)', + ], +]; diff --git a/resources/lang/zh_CN/imdb.php b/resources/lang/zh_CN/imdb.php new file mode 100644 index 00000000..8fb3c5ab --- /dev/null +++ b/resources/lang/zh_CN/imdb.php @@ -0,0 +1,15 @@ + [ + 'en-US' => '英语(美国)', + 'fr-CA' => '法语(加拿大)', + 'fr-FR' => '法语(法国)', + 'de-DE' => '德语(德国)', + 'hi-IN' => '北印度语(印度)', + 'it-IT' => '意大利语(意大利)', + 'pt-BR' => '葡萄牙语(巴西)', + 'es-ES' => '西班牙语(墨西哥)', + 'es-MX' => '西班牙语(西班牙)', + ], +]; diff --git a/resources/lang/zh_TW/imdb.php b/resources/lang/zh_TW/imdb.php new file mode 100644 index 00000000..2be57440 --- /dev/null +++ b/resources/lang/zh_TW/imdb.php @@ -0,0 +1,15 @@ + [ + 'en-US' => '英語(美國)', + 'fr-CA' => '法語(加拿大)', + 'fr-FR' => '法語(法國)', + 'de-DE' => '德語(德國)', + 'hi-IN' => '北印度語(印度)', + 'it-IT' => '意大利語(意大利)', + 'pt-BR' => '葡萄牙語(巴西)', + 'es-ES' => '西班牙語(墨西哥)', + 'es-MX' => '西班牙語(西班牙)', + ], +];