<commit_before><?php

class Screen_model extends Model {

	function __construct() {
		parent::Model();
		$this->load->model('Dimension_model', 'dimension');
		$this->load->model('Schedule_model', 'schedule');
	}



	function get_list($id = NULL, $screen_md5 = NULL) {

		$this->db->select('screens.id, screens.name, screens.schedule_id, schedules.name AS schedule, screens.width, screens.height, screens.screen_md5, screens.content_md5, TIMESTAMPDIFF(SECOND,screens.last_seen,NOW())+1 last_seen');
		$this->db->from('screens');
		$this->db->join('schedules', 'schedules.id = screens.schedule_id', 'left');
		if($screen_md5) $this->db->where('screens.screen_md5', $screen_md5);
		if($id) $this->db->where('screens.customer_id', $this->sess->customer_id);
		if($id) $this->db->where('schedules.customer_id', $this->sess->customer_id);
		if($id) $this->db->where('screens.id', $id);
		$this->db->order_by('name'); 
		$query = $this->db->get();
		
		if($query->num_rows() > 0) {
			foreach($query->result_array() as $row) {
				$data[$row['id']] = $row;
				$data[$row['id']]['last_seen_inwords'] = $this->_secondsToWords($data[$row['id']]['last_seen']);
				if($id) $data[$row['id']]['media'] = $this->screen_media($row['id']);
				if($id) $data[$row['id']]['bundles'] = $this->screen_bundles($row['id']);
				if($id) $data[$row['id']]['layouts'] = $this->screen_layouts($row['id']);
				if($id) $data[$row['id']]['collections'] = $this->screen_collections($row['id']);
				if($id) $data[$row['id']]['players'] = $this->screen_players($row['id']);
				if($id) $data[$row['id']]['synchronized'] = ($data[$row['id']]['content_md5'] == $this->md5($row['id'])) ? TRUE : FALSE; 

				unset( $data[$row['id']]['content_md5'] );
            
			}
		} else {
			$data = array();
		}
		
		return $data;<commit_msg>Ekraanide nitamisel ei arvestatud customeriga<commit_after><?php

class Screen_model extends Model {

	function __construct() {
		parent::Model();
		$this->load->model('Dimension_model', 'dimension');
		$this->load->model('Schedule_model', 'schedule');
	}



	function get_list($id = NULL, $screen_md5 = NULL) {

		$this->db->select('screens.id, screens.name, screens.schedule_id, schedules.name AS schedule, screens.width, screens.height, screens.screen_md5, screens.content_md5, TIMESTAMPDIFF(SECOND,screens.last_seen,NOW())+1 last_seen');
		$this->db->from('screens');
		$this->db->join('schedules', 'schedules.id = screens.schedule_id', 'left');
		if($screen_md5) $this->db->where('screens.screen_md5', $screen_md5);
		$this->db->where('screens.customer_id', $this->sess->customer_id);
		$this->db->where('schedules.customer_id', $this->sess->customer_id);
		if($id) $this->db->where('screens.id', $id);
		$this->db->order_by('name'); 
		$query = $this->db->get();
		
		if($query->num_rows() > 0) {
			foreach($query->result_array() as $row) {
				$data[$row['id']] = $row;
				$data[$row['id']]['last_seen_inwords'] = $this->_secondsToWords($data[$row['id']]['last_seen']);
				if($id) $data[$row['id']]['media'] = $this->screen_media($row['id']);
				if($id) $data[$row['id']]['bundles'] = $this->screen_bundles($row['id']);
				if($id) $data[$row['id']]['layouts'] = $this->screen_layouts($row['id']);
				if($id) $data[$row['id']]['collections'] = $this->screen_collections($row['id']);
				if($id) $data[$row['id']]['players'] = $this->screen_players($row['id']);
				if($id) $data[$row['id']]['synchronized'] = ($data[$row['id']]['content_md5'] == $this->md5($row['id'])) ? TRUE : FALSE; 

				unset( $data[$row['id']]['content_md5'] );
            
			}
		} else {
			$data = array();
		}
		
		return $data;
{'fraction_non_alphanumeric': 0.2580110497237569, 'fraction_numerical': 0.0060773480662983425, 'mean_word_length': 5.6440366972477065, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 75, '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': '7544359', 'n_tokens_mistral': 1459, 'n_tokens_neox': 1327, 'n_words': 173}