File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1075,6 +1075,12 @@ private function processXtreamChannelCollections(
10751075
10761076 // Create the source groups
10771077 foreach ($ liveGroups ->chunk (50 ) as $ chunk ) {
1078+ // Deduplicate the channels
1079+ $ chunk = collect ($ chunk )
1080+ ->unique (fn ($ item ) => $ item ['category_name ' ].$ playlistId .'live ' )
1081+ ->toArray ();
1082+
1083+ // Upsert the source groups
10781084 SourceGroup::upsert (
10791085 collect ($ chunk )->map (function ($ group ) use ($ playlistId ) {
10801086 return [
@@ -1089,6 +1095,12 @@ private function processXtreamChannelCollections(
10891095 );
10901096 }
10911097 foreach ($ vodGroups ->chunk (50 ) as $ chunk ) {
1098+ // Deduplicate the channels
1099+ $ chunk = collect ($ chunk )
1100+ ->unique (fn ($ item ) => $ item ['category_name ' ].$ playlistId .'vod ' )
1101+ ->toArray ();
1102+
1103+ // Upsert the source groups
10921104 SourceGroup::upsert (
10931105 collect ($ chunk )->map (function ($ group ) use ($ playlistId ) {
10941106 return [
You can’t perform that action at this time.
0 commit comments