<commit_before><?php namespace VacStatus\Http\Controllers\APIv1;

use Illuminate\Http\Request;

use VacStatus\Http\Controllers\Controller;
use VacStatus\Http\Requests;
use VacStatus\Update\MostTracked;
use VacStatus\Update\LatestTracked;
use VacStatus\Update\CustomList;

use VacStatus\Update\LatestVAC;
use VacStatus\Update\LatestGameBan;

use VacStatus\Models\User;
use VacStatus\Models\UserList;
use VacStatus\Models\Subscription;

use VacStatus\Steam\Steam;

use Cache;
use Validator;
use Input;
use Auth;

class ListController extends Controller
{
	public function mySimpleList()
	{
		if(!Auth::check()) return [];

		$myList = UserList::where('user_id', Auth::user()->id)
			->orderBy('id', 'desc')
			->get([
				'id',
				'title',
				'privacy',
			]);

		return $myList;
	}

	public function listList()
	{
		$return = [
			'my_list' => [],
			'friends_list' => []
		];

		if(!Auth::check()) return $return;

		$user = Auth::user();

		$myLists = UserList::where('user_list.user_id', $user->id)
			->leftjoin('user_list_profile as ulp_1', 'ulp_1.user_list_id', '=', 'user_list.id')
			->whereNull('ulp_1.deleted_at')
			->groupBy('user_list.id')
			->orderBy('user_list.id', 'desc')
			->leftJoin('subscription', function($join)
			{
				$join->on('subscription.user_list_id', '=', 'user_list.id')
					->whereNull('subscription.deleted_at');
			})
			->get([
				'user_list.id',
				'user_list.title',
				'user_list.privacy',
				'user_list.created_at',
				
				\DB::raw('count(ulp_1.created_at) as users_in_list'),
				\DB::raw('count(distinct subscription.id) as sub_count'),
			]);

		foreach($myLists as $myList)
		{
			$return['my_list'][] = [<commit_msg>some must've been created multiple times for no reason<commit_after><?php namespace VacStatus\Http\Controllers\APIv1;

use Illuminate\Http\Request;

use VacStatus\Http\Controllers\Controller;
use VacStatus\Http\Requests;
use VacStatus\Update\MostTracked;
use VacStatus\Update\LatestTracked;
use VacStatus\Update\CustomList;

use VacStatus\Update\LatestVAC;
use VacStatus\Update\LatestGameBan;

use VacStatus\Models\User;
use VacStatus\Models\UserList;
use VacStatus\Models\Subscription;

use VacStatus\Steam\Steam;

use Cache;
use Validator;
use Input;
use Auth;

class ListController extends Controller
{
	public function mySimpleList()
	{
		if(!Auth::check()) return [];

		$myList = UserList::where('user_id', Auth::user()->id)
			->orderBy('id', 'desc')
			->get([
				'id',
				'title',
				'privacy',
			]);

		return $myList;
	}

	public function listList()
	{
		$return = [
			'my_list' => [],
			'friends_list' => []
		];

		if(!Auth::check()) return $return;

		$user = Auth::user();

		$myLists = UserList::where('user_list.user_id', $user->id)
			// ->whereNull('user_list_profile.deleted_at')
			// ->leftjoin('user_list_profile', 'user_list_profile.user_list_id', '=', 'user_list.id')
			->groupBy('user_list.id')
			->orderBy('user_list.id', 'desc')
			->leftJoin('user_list_profile', function($join)
			{
				$join->on('user_list_profile.user_list_id', '=', 'user_list.id')
					->whereNull('user_list_profile.deleted_at');
			})
			->leftJoin('subscription', function($join)
			{
				$join->on('subscription.user_list_id', '=', 'user_list.id')
					->whereNull('subscription.deleted_at');
			})
			->get([
				'user_list.id',
				'user_list.title',
				'user_list.privacy',
				'user_list.created_at',
				
				\DB::raw('count(DISTINCT user_list_profile.profile_id) as users_in_list'),
				\DB::raw('count(distinct subscription.id) as sub_count'),
			]);

		foreach($myLists as $myList)
		{
			$return['my_list'][] = [
{'fraction_non_alphanumeric': 0.17443150305047145, 'fraction_numerical': 0.0016638935108153079, 'mean_word_length': 4.367559523809524, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4882884', 'n_tokens_mistral': 1500, 'n_tokens_neox': 1306, 'n_words': 210}