From 3e464254111ff2cf175d5df2291d444d64be7d78 Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 11 Jan 2021 07:12:59 -0700 Subject: [PATCH 1/2] =?UTF-8?q?Fix=20bug=20when=20moved=20=5Fcheck=5Ffor?= =?UTF-8?q?=5Fdizque=5Finstance=20to=20decorators.=20Thought=20I=20fixed?= =?UTF-8?q?=20this=20in=201.2.3.0=20before=20release,=20but=20=C2=AF\=5F(?= =?UTF-8?q?=E3=83=84)=5F/=C2=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dizqueTV/channels.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/dizqueTV/channels.py b/dizqueTV/channels.py index c573416..5bd89c1 100644 --- a/dizqueTV/channels.py +++ b/dizqueTV/channels.py @@ -57,7 +57,7 @@ def update(self, if use_global_settings: new_settings = CHANNEL_FFMPEG_SETTINGS_DEFAULT else: - new_settings = decorators._combine_settings(new_settings_dict=kwargs, + new_settings = helpers._combine_settings(new_settings_dict=kwargs, template_dict=self._data) if self._dizque_instance.update_channel(channel_number=self._channel_instance.number, transcoding=new_settings): @@ -196,7 +196,7 @@ def update(self, :return: True if successful, False if unsuccessful (Channel reloads in-place, this Schedule object is destroyed) :rtype: bool """ - new_settings = decorators._combine_settings_add_new(new_settings_dict=kwargs, + new_settings = helpers._combine_settings_add_new(new_settings_dict=kwargs, template_dict=(self._data if self._data else SCHEDULE_SETTINGS_DEFAULT) ) @@ -222,9 +222,9 @@ def add_time_slot(self, else: if time_string: kwargs['time'] = helpers.convert_24_time_to_milliseconds_past_midnight(time_string=time_string) - new_settings_filtered = decorators._filter_dictionary(new_dictionary=kwargs, + new_settings_filtered = helpers._filter_dictionary(new_dictionary=kwargs, template_dict=TIME_SLOT_SETTINGS_TEMPLATE) - if not decorators._settings_are_complete(new_settings_dict=new_settings_filtered, + if not helpers._settings_are_complete(new_settings_dict=new_settings_filtered, template_settings_dict=TIME_SLOT_SETTINGS_TEMPLATE): raise GeneralException("Missing settings required to make a time slot.") @@ -258,7 +258,7 @@ def edit_time_slot(self, time_slot: TimeSlot, time_string: str = None, **kwargs) if slot['time'] != time_slot.time: new_slots.append(slot) else: - new_slot_data = decorators._combine_settings(new_settings_dict=kwargs, template_dict=slot) + new_slot_data = helpers._combine_settings(new_settings_dict=kwargs, template_dict=slot) new_slots.append(new_slot_data) return self.update(slots=new_slots) @@ -503,7 +503,7 @@ def add_program(self, template = EPISODE_PROGRAM_TEMPLATE elif kwargs['type'] == 'redirect': template = REDIRECT_PROGRAM_TEMPLATE - if decorators._settings_are_complete(new_settings_dict=kwargs, + if helpers._settings_are_complete(new_settings_dict=kwargs, template_settings_dict=template, ignore_keys=['_id', 'id']): channel_data = self._data @@ -728,7 +728,7 @@ def add_filler_list(self, 'weight': weight, 'cooldown': cooldown } - if decorators._settings_are_complete(new_settings_dict=new_settings_dict, + if helpers._settings_are_complete(new_settings_dict=new_settings_dict, template_settings_dict=FILLER_LIST_CHANNEL_TEMPLATE, ignore_keys=['_id', 'id']): channel_data = self._data @@ -788,10 +788,10 @@ def add_schedule(self, time_slots: List[TimeSlot], **kwargs) -> bool: """ for slot in time_slots: kwargs['slots'].append(slot._data) - schedule_settings = decorators._combine_settings_enforce_types(new_settings_dict=kwargs, + schedule_settings = helpers._combine_settings_enforce_types(new_settings_dict=kwargs, template_dict=SCHEDULE_SETTINGS_TEMPLATE, default_dict=SCHEDULE_SETTINGS_DEFAULT) - if decorators._settings_are_complete(new_settings_dict=schedule_settings, + if helpers._settings_are_complete(new_settings_dict=schedule_settings, template_settings_dict=SCHEDULE_SETTINGS_TEMPLATE): schedule = Schedule(data=schedule_settings, dizque_instance=None, channel_instance=self) return self._dizque_instance._make_schedule(channel=self, schedule=schedule) @@ -1006,7 +1006,7 @@ def remove_redirects(self) -> bool: """ non_redirects = [] for item in self.programs: - if not decorators._object_has_attribute(obj=item, attribute_name='type') or item.type != 'redirect': + if not helpers._object_has_attribute(obj=item, attribute_name='type') or item.type != 'redirect': non_redirects.append(item) if non_redirects and self.delete_all_programs(): return self.add_programs(programs=non_redirects) @@ -1022,10 +1022,10 @@ def remove_specials(self) -> bool: :rtype: bool """ non_redirects = [item for item in self.programs if - (decorators._object_has_attribute(obj=item, attribute_name='type') + (helpers._object_has_attribute(obj=item, attribute_name='type') and item.type != 'redirect')] non_specials = [item for item in non_redirects if - (decorators._object_has_attribute(obj=item, attribute_name='season') + (helpers._object_has_attribute(obj=item, attribute_name='season') and item.season != 0)] if non_specials and self.delete_all_programs(): return self.add_programs(programs=non_specials) @@ -1077,7 +1077,7 @@ def add_reruns(self, raise GeneralException("You cannot use a start time in the future.") start_time = start_time.strftime("%Y-%m-%dT%H:%M:%S.000Z") self.remove_duplicate_programs() - programs_to_add, running_time = decorators._get_first_x_minutes_of_programs(programs=self.programs, + programs_to_add, running_time = helpers._get_first_x_minutes_of_programs(programs=self.programs, minutes=length_hours * 60) if running_time < (length_hours * 60 * 60 * 1000): time_needed = (length_hours * 60 * 60 * 1000) - running_time @@ -1129,7 +1129,7 @@ def add_channel_at_night(self, programs_left = self.programs while programs_left: # loop until you get done with all the programs programs_to_add, total_running_time, programs_left = \ - decorators._get_first_x_minutes_of_programs_return_unused(programs=programs_left, + helpers._get_first_x_minutes_of_programs_return_unused(programs=programs_left, minutes=int( length_of_regular_block / 1000 / 60) ) @@ -1190,7 +1190,7 @@ def add_channel_at_night_alt(self, ) final_programs_to_add = [] all_programs = self.programs - programs_to_add, total_running_time = decorators._get_first_x_minutes_of_programs( + programs_to_add, total_running_time = helpers._get_first_x_minutes_of_programs( programs=all_programs, minutes=int( time_until_night_block_start / 1000 / 60) @@ -1212,7 +1212,7 @@ def add_channel_at_night_alt(self, else: # need to interlace programs and night channels programs_left = all_programs programs_to_add, total_running_time, programs_left = \ - decorators._get_first_x_minutes_of_programs_return_unused(programs=programs_left, + helpers._get_first_x_minutes_of_programs_return_unused(programs=programs_left, minutes=int( time_until_night_block_start / 1000 / 60) ) @@ -1231,7 +1231,7 @@ def add_channel_at_night_alt(self, final_programs_to_add = programs_to_add while programs_left: # loop until you get done with all the programs programs_to_add, total_running_time, programs_left = \ - decorators._get_first_x_minutes_of_programs_return_unused(programs=programs_left, + helpers._get_first_x_minutes_of_programs_return_unused(programs=programs_left, minutes=int( length_of_regular_block / 1000 / 60) ) From 0a822f24f4d4924e7b1e82ce3117ec804a4bfa8b Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 11 Jan 2021 07:13:29 -0700 Subject: [PATCH 2/2] Bump to 1.2.3.1 --- dizqueTV/_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dizqueTV/_info.py b/dizqueTV/_info.py index aeae613..6f06ed7 100644 --- a/dizqueTV/_info.py +++ b/dizqueTV/_info.py @@ -1,4 +1,4 @@ -__version__ = '1.2.3.0' +__version__ = '1.2.3.1' __title__ = "dizqueTV" __author__ = 'Nate Harris'