Hoist repeated code outside conditional statement

This commit is contained in:
Brian Pepple 2020-09-27 11:20:32 -04:00 committed by Odd Stråbø
parent 5b1e4c7eab
commit dd77969a79

View file

@ -832,17 +832,14 @@ class Views(object):
window_prop = "Jellyfin.wnodes.%s" % index window_prop = "Jellyfin.wnodes.%s" % index
window('%s.index' % window_prop, path.replace('all.xml', "")) # dir window('%s.index' % window_prop, path.replace('all.xml', "")) # dir
window('%s.title' % window_prop, view['Name']) window('%s.title' % window_prop, view['Name'])
window('%s.content' % window_prop, path)
elif node == 'browse': elif node == 'browse':
window_prop = "Jellyfin.wnodes.%s" % index window_prop = "Jellyfin.wnodes.%s" % index
window('%s.title' % window_prop, view['Name']) window('%s.title' % window_prop, view['Name'])
window('%s.content' % window_prop, path)
else: else:
window_prop = "Jellyfin.wnodes.%s.%s" % (index, node) window_prop = "Jellyfin.wnodes.%s.%s" % (index, node)
window('%s.title' % window_prop, node_label) window('%s.title' % window_prop, node_label)
window('%s.content' % window_prop, path) window('%s.content' % window_prop, path)
window('%s.id' % window_prop, view['Id']) window('%s.id' % window_prop, view['Id'])
window('%s.path' % window_prop, window_path) window('%s.path' % window_prop, window_path)