fix: case insensitivity duplicate checking in keyword upsert

We were deduping keywords, but we were only checking for exact duplicates. Now we check for case insensitive duplicates, and make sure to update the duplicates on upsert instead of treating the upsert as an insert. Fixes #3412.
This commit is contained in:
Roardom
2024-01-24 04:51:38 +00:00
parent 6575294323
commit 5e6eeadc61
3 changed files with 7 additions and 4 deletions
+2 -2
View File
@@ -221,7 +221,7 @@ class TorrentController extends Controller
}
foreach (collect($keywords)->chunk(65_000 / 2) as $keywords) {
Keyword::upsert($keywords->toArray(), ['torrent_id', 'name'], []);
Keyword::upsert($keywords->toArray(), ['torrent_id', 'name']);
}
$category = $torrent->category;
@@ -420,7 +420,7 @@ class TorrentController extends Controller
}
foreach (collect($keywords)->chunk(intdiv(65_000, 2)) as $keywords) {
Keyword::upsert($keywords->toArray(), ['torrent_id', 'name'], []);
Keyword::upsert($keywords->toArray(), ['torrent_id', 'name']);
}
// Cover Image for No-Meta Torrents