Skip to content

Commit

Permalink
Merge pull request #45 from nwithan8/develop
Browse files Browse the repository at this point in the history
1.1.1_hf1
  • Loading branch information
nwithan8 authored Oct 3, 2020
2 parents c13d52d + 0b8e2bd commit 9977ae8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dizqueTV/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '1.1.1'
__version__ = '1.1.1_hf1'
__author__ = 'Nate Harris'
15 changes: 7 additions & 8 deletions dizqueTV/dizquetv.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,30 +339,29 @@ def _fill_in_default_channel_settings(self, settings_dict: dict, handle_errors:
return helpers._combine_settings(new_settings_dict=settings_dict, old_settings_dict=CHANNEL_SETTINGS_DEFAULT)

def add_channel(self,
programs: List[Union[Program, Video, Movie, Episode]],
programs: List[Union[Program, Video, Movie, Episode]] = None,
plex_server: PServer = None,
handle_errors: bool = False,
handle_errors: bool = True,
**kwargs) -> Union[Channel, None]:
"""
Add a channel to dizqueTV
Must include at least one program to create
:param programs: At least one Program or PlexAPI Video, Movie or Episode to add to the new channel
:param programs: Program or PlexAPI Video, Movie or Episode objects to add to the new channel
:param plex_server: plexapi.server.PlexServer (optional, required if adding PlexAPI Video, Movie or Episode)
:param kwargs: keyword arguments of setting names and values
:param handle_errors: Suppress error if they arise
(ex. alter invalid channel number, add redirect if no program is included)
:return: new Channel object or None
"""
kwargs['programs'] = []
for program in programs:
if type(program) == Program:
kwargs['programs'].append(program)
for item in programs:
if type(item) == Program:
kwargs['programs'].append(item._data)
else:
if not plex_server:
raise ItemCreationError("You must include a plex_server if you are adding PlexAPI Video, "
"Movie or Episodes as programs")
kwargs['programs'].append(
convert_plex_item_to_program(plex_item=program, plex_server=plex_server)._data)
convert_plex_item_to_program(plex_item=item, plex_server=plex_server)._data)
if kwargs.get('iconPosition'):
kwargs['iconPosition'] = helpers.convert_icon_position(position_text=kwargs['iconPosition'])
kwargs = self._fill_in_default_channel_settings(settings_dict=kwargs, handle_errors=handle_errors)
Expand Down
1 change: 1 addition & 0 deletions dizqueTV/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def __init__(self, data: json, dizque_instance):
self.normalizeAudioCodec = data.get('normalizeAudioCodec')
self.normalizeResolution = data.get('normalizeResolution')
self.normalizeAudio = data.get('normalizeAudio')
self.maxFPS = data.get('maxFPS')
self._id = data.get('_id')

@helpers._check_for_dizque_instance
Expand Down

0 comments on commit 9977ae8

Please sign in to comment.