mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-10-19 18:03:31 -04:00
Modules updates
This commit is contained in:
@@ -37,6 +37,23 @@ class ProcessVideosController extends Controller
|
||||
|
||||
dd('Successfully Process New Video Types');
|
||||
}
|
||||
|
||||
public function cleanUpTracks()
|
||||
{
|
||||
|
||||
$duplicates = \Modules\StudioPlus\Entities\StudioPlusVideoStatusTrack::select(\DB::raw('COUNT(*) as `count`'),'id','studio_plus_video_id','name','created_at')
|
||||
->where('name','Published')
|
||||
->groupBy('studio_plus_video_id', 'name')
|
||||
->orderBy('created_at','desc')
|
||||
->havingRaw('COUNT(*) > 1')
|
||||
->limit(1000)->get();
|
||||
|
||||
foreach ($duplicates as $key => $duplicate) {
|
||||
\Modules\StudioPlus\Entities\StudioPlusVideoStatusTrack::where('studio_plus_video_id', $duplicate->studio_plus_video_id)->where('name', $duplicate->name)->where('id', '!=', $duplicate->id)->delete();
|
||||
}
|
||||
|
||||
dd('Successfully Cleanup Tracks '.count($duplicates));
|
||||
}
|
||||
|
||||
public function ott()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user