mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
Merge pull request #279 from jikan-me/fix/anime-sweeper
Fixes merging of IDs from mal-id-cache in indexers
This commit is contained in:
commit
02107d9ebe
@ -19,7 +19,7 @@ class AnimeIndexer extends Command
|
||||
*`
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'indexer:anime
|
||||
protected $signature = 'indexer:anime
|
||||
{--failed : Run only entries that failed to index last time}
|
||||
{--resume : Resume from the last position}
|
||||
{--reverse : Start from the end of the array}
|
||||
@ -150,7 +150,7 @@ class AnimeIndexer extends Command
|
||||
true
|
||||
);
|
||||
|
||||
$this->ids = $ids['sfw'] + $ids['nsfw']; // merge
|
||||
$ids = array_merge($ids['sfw'], $ids['nsfw']);
|
||||
Storage::put('indexer/anime_mal_id.json', json_encode($this->ids));
|
||||
|
||||
return json_decode(Storage::get('indexer/anime_mal_id.json'));
|
||||
|
@ -61,10 +61,13 @@ class AnimeSweepIndexer extends Command
|
||||
|
||||
foreach ($results as $result) {
|
||||
if (!array_key_exists($result['mal_id'], $malIds)) {
|
||||
echo "Removing https://myanimelist.net/anime/".$result['mal_id']."\n";
|
||||
$remove[] = $result['_id'];
|
||||
}
|
||||
}
|
||||
|
||||
echo "\n\n".count($remove);
|
||||
|
||||
echo "Delete removed MAL IDs\n";
|
||||
DB::table('anime')->whereIn('_id', $remove)->delete();
|
||||
}
|
||||
@ -82,7 +85,7 @@ class AnimeSweepIndexer extends Command
|
||||
true
|
||||
);
|
||||
|
||||
$ids = $ids['sfw'] + $ids['nsfw']; // merge
|
||||
$ids = array_merge($ids['sfw'], $ids['nsfw']);
|
||||
Storage::put('indexer/anime_mal_id_sweep.json', json_encode($ids));
|
||||
|
||||
return json_decode(Storage::get('indexer/anime_mal_id_sweep.json'));
|
||||
|
@ -19,7 +19,7 @@ class MangaIndexer extends Command
|
||||
*`
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'indexer:manga
|
||||
protected $signature = 'indexer:manga
|
||||
{--failed : Run only entries that failed to index last time}
|
||||
{--resume : Resume from the last position}
|
||||
{--reverse : Start from the end of the array}
|
||||
@ -150,7 +150,7 @@ class MangaIndexer extends Command
|
||||
true
|
||||
);
|
||||
|
||||
$this->ids = $ids['sfw'] + $ids['nsfw']; // merge
|
||||
$ids = array_merge($ids['sfw'], $ids['nsfw']);
|
||||
Storage::put('indexer/manga_mal_id.json', json_encode($this->ids));
|
||||
|
||||
return json_decode(Storage::get('indexer/manga_mal_id.json'));
|
||||
|
@ -82,7 +82,7 @@ class MangaSweepIndexer extends Command
|
||||
true
|
||||
);
|
||||
|
||||
$ids = $ids['sfw'] + $ids['nsfw']; // merge
|
||||
$ids = array_merge($ids['sfw'], $ids['nsfw']);
|
||||
Storage::put('indexer/manga_mal_id_sweep.json', json_encode($ids));
|
||||
|
||||
return json_decode(Storage::get('indexer/manga_mal_id_sweep.json'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user