def deleteMedia(media_id): if request.method == 'DELETE': return MediaHandler().deleteMedia(media_id)
def createMedia(media_type, location): if request.method == 'POST': return MediaHandler().createMedia(media_type, location)
def updateMedia(media_id, media_type, location): if request.method == 'PUT': return MediaHandler().updateMedia(media_id, media_type, location)
def getMediaType(media_id): if request.method == 'GET': return MediaHandler().getMediaType(media_id)
def getMediaLocation(media_id): if request.method == 'GET': return MediaHandler().getMediaLocation(media_id)
def getMediaByType(metype): return MediaHandler().getMediaByType(metype)
def getAllMedia(): if request.method == 'GET': return MediaHandler().getAllMedia()
def getMediaByAddress(meaddress): return MediaHandler().getMediaByAddress(meaddress)
def getMediaByName(mename): return MediaHandler().getMediaByName(mename)
def getAllMediaById(meid): return MediaHandler().getAllMediaById(meid)
def getAllMedia(): if request.args: return MediaHandler.getAllMedia(request.args) else: handler = MediaHandler() return handler.getAllMedia()
def getMediaByMessageId(mid): return MediaHandler().getByMessageId(mid)