mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-24 03:59:08 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user