Skip to content

Commit

Permalink
take advantage of channel services api version 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
garybuhrmaster committed Jan 17, 2020
1 parent 2026043 commit 95e5201
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
8 changes: 6 additions & 2 deletions MythUtil-Channel-HDHR-visibilityCheck
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,12 @@ if __name__ == '__main__':
mvisible = bool(mythChannel['Visible'] == 'true')
if mvisible != desiredvisible and sourceValid:
print('Channel {} visibility should be: {}'.format(chanNum, desiredvisible))
# Copy existing values
data = mythChannel.copy()
if ChannelServiceVersion >= versionTuple("1.9"):
data = {}
data['ChanId'] = mythChannel['ChanId']
else:
# Copy existing values
data = mythChannel.copy()
# Optional (and what we want to set)
data['Visible'] = desiredvisible
if args.update:
Expand Down
11 changes: 8 additions & 3 deletions MythUtil-Channel-XMLTV-getLineup
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ if __name__ == '__main__':
if not found:
print('Channel {}, callsign: "{}", name: "{}" is not in the XMLTV channel list'.format(mythChannel['ChanNum'], mythChannel['CallSign'], mythChannel['ChannelName']))
if args.delete:
data = mythChannel.copy()
data = {}
data['ChanId'] = mythChannel['ChanId']
if bool(s.Channel('RemoveDBChannel', transformAPIElementNames('Channel', data))['bool']):
print(' Channel deleted')
else:
Expand All @@ -329,8 +330,12 @@ if __name__ == '__main__':
break
if found:
update = False
# Copy existing values
data = mythChannel.copy()
if ChannelServiceVersion >= versionTuple("1.9"):
data = {}
data['ChanId'] = mythChannel['ChanId']
else:
# Copy existing values
data = mythChannel.copy()
if (xmlChannel['icon'] is None) and (mythChannel['IconURL'] == ''):
pass # Nothing to see here
elif (xmlChannel['icon'] is not None) and (mythChannel['IconURL'] == ''):
Expand Down
3 changes: 2 additions & 1 deletion MythUtil-Channel-videosource
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ if __name__ == '__main__':
if sourceId is None:
print('Video source was not found to delete')
sys.exit(1)
data = source.copy()
data = {}
data['Id'] = source['Id']
if bool(s.Channel('RemoveVideoSource', transformAPIElementNames('VideoSource', data))['bool']):
print('Video source deleted')
try:
Expand Down
8 changes: 6 additions & 2 deletions MythUtil-Channel-visibility
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,12 @@ if __name__ == '__main__':
desiredvisible = False
if mvisible != desiredvisible:
print('Channel {} visibility should be: {}'.format(chanNum, desiredvisible))
# Copy existing values
data = mythChannel.copy()
if ChannelServiceVersion >= versionTuple("1.9"):
data = {}
data['ChanId'] = mythChannel['ChanId']
else:
# Copy existing values
data = mythChannel.copy()
# Optional (and what we want to set)
data['Visible'] = desiredvisible
if args.update:
Expand Down

0 comments on commit 95e5201

Please sign in to comment.