RIP Legacy Mode
This commit is contained in:
parent
bdba336d3c
commit
e12d26562d
8 changed files with 14 additions and 33 deletions
|
|
@ -25,10 +25,7 @@ class SettingsController {
|
|||
self::redirect();
|
||||
}
|
||||
static public function api() {
|
||||
if (isset($_POST['api-legacy'])) {
|
||||
$legacy = $_POST['api-legacy'];
|
||||
}
|
||||
Cookies::set('api-legacy', $legacy);
|
||||
// TODO, ADD COUNT
|
||||
self::redirect();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,13 +10,8 @@ use App\Models\RSSTemplate;
|
|||
class TrendingController {
|
||||
static public function get() {
|
||||
$api = Wrappers::api();
|
||||
$cursor = Misc::getTtwid();
|
||||
|
||||
// Ttwid if standard, cursor if legacy
|
||||
if ($api->isLegacy()) {
|
||||
$cursor = Misc::getCursor();
|
||||
} else {
|
||||
$cursor = Misc::getTtwid();
|
||||
}
|
||||
$trending = $api->trending();
|
||||
$trending->feed($cursor);
|
||||
|
||||
|
|
|
|||
|
|
@ -81,8 +81,6 @@ class Wrappers {
|
|||
}
|
||||
}
|
||||
|
||||
// Legacy mode
|
||||
$legacy = Misc::env('API_FORCE_LEGACY', false) || isset($_COOKIE['api-legacy']) && $_COOKIE['api-legacy'] === 'on';
|
||||
return new \TikScraper\Api($options, $legacy, $cacheEngine);
|
||||
return new \TikScraper\Api($options, $cacheEngine);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue