Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_type(self):
if isinstance(self, Channel):
return 'channel'
elif isinstance(self, Playlist):
return 'playlist'
elif isinstance(self, Folder):
return 'folder'
else:
return 'video'
return 0
else:
if obj1.name.lower() < obj2.name.lower():
return -1
elif obj1.name.lower() > obj2.name.lower():
return 1
else:
return 0
else:
if isinstance(obj1, Folder):
return -1
elif isinstance(obj2, Folder):
return 1
elif isinstance(obj1, Channel) or isinstance(obj1, Playlist):
return -1
elif isinstance(obj2, Channel) or isinstance(obj2, Playlist):
return 1
else:
return 0