How to use the webserver.ActivePlaylistMethods.ActivePlaylistEntry function in webserver

To help you get started, we’ve selected a few webserver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github klnusbaum / UDJ-Android-Client / webserver / ActivePlaylistMethods.py View on Github external
def default(self, obj):
    if isinstance(obj, PlaylistEntry):
      return {
        ActivePlaylistEntry.SERVER_ID_PARAM : obj.getServerId(),
        ActivePlaylistEntry.PRIORITY_PARAM : obj.getPriority(),
        ActivePlaylistEntry.LIBRARY_ID_PARAM : obj.getLibId(),
        ActivePlaylistEntry.SONG_PARAM : obj.getSong(),
        ActivePlaylistEntry.ARTIST_PARAM : obj.getArtist(),
        ActivePlaylistEntry.ALBUM_PARAM : obj.getAlbum(),
        ActivePlaylistEntry.VOTES_PARAM : obj.getVotes(),
        ActivePlaylistEntry.TIME_ADDED_PARAM : obj.getTimeAdded(),
        ActivePlaylistEntry.IS_DELETED_PARAM : obj.getIsDeleted(),
        ActivePlaylistEntry.CLIENT_ID_PARAM : obj.getClientId()
      }
    else:
      return json.JSONEncoder.default(self, obj)
github klnusbaum / UDJ-Android-Client / webserver / ActivePlaylistMethods.py View on Github external
def default(self, obj):
    if isinstance(obj, PlaylistEntry):
      return {
        ActivePlaylistEntry.SERVER_ID_PARAM : obj.getServerId(),
        ActivePlaylistEntry.PRIORITY_PARAM : obj.getPriority(),
        ActivePlaylistEntry.LIBRARY_ID_PARAM : obj.getLibId(),
        ActivePlaylistEntry.SONG_PARAM : obj.getSong(),
        ActivePlaylistEntry.ARTIST_PARAM : obj.getArtist(),
        ActivePlaylistEntry.ALBUM_PARAM : obj.getAlbum(),
        ActivePlaylistEntry.VOTES_PARAM : obj.getVotes(),
        ActivePlaylistEntry.TIME_ADDED_PARAM : obj.getTimeAdded(),
        ActivePlaylistEntry.IS_DELETED_PARAM : obj.getIsDeleted(),
        ActivePlaylistEntry.CLIENT_ID_PARAM : obj.getClientId()
      }
    else:
      return json.JSONEncoder.default(self, obj)
github klnusbaum / UDJ-Android-Client / webserver / ActivePlaylistMethods.py View on Github external
def default(self, obj):
    if isinstance(obj, PlaylistEntry):
      return {
        ActivePlaylistEntry.SERVER_ID_PARAM : obj.getServerId(),
        ActivePlaylistEntry.PRIORITY_PARAM : obj.getPriority(),
        ActivePlaylistEntry.LIBRARY_ID_PARAM : obj.getLibId(),
        ActivePlaylistEntry.SONG_PARAM : obj.getSong(),
        ActivePlaylistEntry.ARTIST_PARAM : obj.getArtist(),
        ActivePlaylistEntry.ALBUM_PARAM : obj.getAlbum(),
        ActivePlaylistEntry.VOTES_PARAM : obj.getVotes(),
        ActivePlaylistEntry.TIME_ADDED_PARAM : obj.getTimeAdded(),
        ActivePlaylistEntry.IS_DELETED_PARAM : obj.getIsDeleted(),
        ActivePlaylistEntry.CLIENT_ID_PARAM : obj.getClientId()
      }
    else:
      return json.JSONEncoder.default(self, obj)
github klnusbaum / UDJ-Server / webserver / ActivePlaylistMethods.py View on Github external
def getObject(dbrow):
  isDel = False
  if(dbrow.isDeleted):
    isDel = true
  return ActivePlaylistEntry(
    dbrow.plId,
    dbrow.priority,
    dbrow.libraryId,
    dbrow.song,
    dbrow.artist,
    dbrow.album,
    dbrow.voteCount,
    dbrow.timeAdded,
    isDel)
github klnusbaum / UDJ-Server / webserver / ActivePlaylistMethods.py View on Github external
def default(self, obj):
    if isinstance(obj, PlaylistEntry):
      return {
        ActivePlaylistEntry.SERVER_ID_PARAM : obj.getServerId(),
        ActivePlaylistEntry.PRIORITY_PARAM : obj.getPriority(),
        ActivePlaylistEntry.LIBRARY_ID_PARAM : obj.getLibId(),
        ActivePlaylistEntry.SONG_PARAM : obj.getSong(),
        ActivePlaylistEntry.ARTIST_PARAM : obj.getArtist(),
        ActivePlaylistEntry.ALBUM_PARAM : obj.getAlbum(),
        ActivePlaylistEntry.VOTES_PARAM : obj.getVotes(),
        ActivePlaylistEntry.TIME_ADDED_PARAM : obj.getTimeAdded(),
        ActivePlaylistEntry.IS_DELETED_PARAM : obj.getIsDeleted(),
        ActivePlaylistEntry.CLIENT_ID_PARAM : obj.getClientId()
      }
    else:
      return json.JSONEncoder.default(self, obj)
github klnusbaum / UDJ-Android-Client / webserver / ActivePlaylistMethods.py View on Github external
def getObject(dbrow):
  isDel = False
  if(dbrow.isDeleted):
    isDel = true
  return ActivePlaylistEntry(
    dbrow.plId,
    dbrow.priority,
    dbrow.libraryId,
    dbrow.song,
    dbrow.artist,
    dbrow.album,
    dbrow.voteCount,
    dbrow.timeAdded,
    isDel)
github klnusbaum / UDJ-Android-Client / webserver / ActivePlaylistMethods.py View on Github external
def default(self, obj):
    if isinstance(obj, PlaylistEntry):
      return {
        ActivePlaylistEntry.SERVER_ID_PARAM : obj.getServerId(),
        ActivePlaylistEntry.PRIORITY_PARAM : obj.getPriority(),
        ActivePlaylistEntry.LIBRARY_ID_PARAM : obj.getLibId(),
        ActivePlaylistEntry.SONG_PARAM : obj.getSong(),
        ActivePlaylistEntry.ARTIST_PARAM : obj.getArtist(),
        ActivePlaylistEntry.ALBUM_PARAM : obj.getAlbum(),
        ActivePlaylistEntry.VOTES_PARAM : obj.getVotes(),
        ActivePlaylistEntry.TIME_ADDED_PARAM : obj.getTimeAdded(),
        ActivePlaylistEntry.IS_DELETED_PARAM : obj.getIsDeleted(),
        ActivePlaylistEntry.CLIENT_ID_PARAM : obj.getClientId()
      }
    else:
      return json.JSONEncoder.default(self, obj)
github klnusbaum / UDJ-Server / webserver / ActivePlaylistMethods.py View on Github external
def default(self, obj):
    if isinstance(obj, PlaylistEntry):
      return {
        ActivePlaylistEntry.SERVER_ID_PARAM : obj.getServerId(),
        ActivePlaylistEntry.PRIORITY_PARAM : obj.getPriority(),
        ActivePlaylistEntry.LIBRARY_ID_PARAM : obj.getLibId(),
        ActivePlaylistEntry.SONG_PARAM : obj.getSong(),
        ActivePlaylistEntry.ARTIST_PARAM : obj.getArtist(),
        ActivePlaylistEntry.ALBUM_PARAM : obj.getAlbum(),
        ActivePlaylistEntry.VOTES_PARAM : obj.getVotes(),
        ActivePlaylistEntry.TIME_ADDED_PARAM : obj.getTimeAdded(),
        ActivePlaylistEntry.IS_DELETED_PARAM : obj.getIsDeleted(),
        ActivePlaylistEntry.CLIENT_ID_PARAM : obj.getClientId()
      }
    else:
      return json.JSONEncoder.default(self, obj)
github klnusbaum / UDJ-Server / webserver / ActivePlaylistMethods.py View on Github external
def default(self, obj):
    if isinstance(obj, PlaylistEntry):
      return {
        ActivePlaylistEntry.SERVER_ID_PARAM : obj.getServerId(),
        ActivePlaylistEntry.PRIORITY_PARAM : obj.getPriority(),
        ActivePlaylistEntry.LIBRARY_ID_PARAM : obj.getLibId(),
        ActivePlaylistEntry.SONG_PARAM : obj.getSong(),
        ActivePlaylistEntry.ARTIST_PARAM : obj.getArtist(),
        ActivePlaylistEntry.ALBUM_PARAM : obj.getAlbum(),
        ActivePlaylistEntry.VOTES_PARAM : obj.getVotes(),
        ActivePlaylistEntry.TIME_ADDED_PARAM : obj.getTimeAdded(),
        ActivePlaylistEntry.IS_DELETED_PARAM : obj.getIsDeleted(),
        ActivePlaylistEntry.CLIENT_ID_PARAM : obj.getClientId()
      }
    else:
      return json.JSONEncoder.default(self, obj)