'.. http:put:: /channels/discovered/(string: channelid)/playlists/(int: playlistid)/(string: infohash)
Add a torrent with a specified infohash to a specified playlist. The torrent that is added to the playlist,
should be present in the channel.
**Example request**:
.. sourcecode:: none
curl -X PUT http://localhost:8085/channels/discovered/abcd/playlists/3/abcdef
**Example response**:
.. sourcecode:: javascript
"added": True
:statuscode 404: if the specified channel/playlist/torrent does not exist.
:statuscode 409: if the specified torrent is already in the specified playlist.'

def render_PUT(self, request):

    channel_info = self.get_channel_from_db(self.cid)
    if (channel_info is None):
        return ChannelsPlaylistsEndpoint.return_404(request)
    channel_community = self.get_community_for_channel_id(channel_info[0])
    if (channel_community is None):
        return BaseChannelsEndpoint.return_404(request, message='the    community    for    the    specific    channel    cannot    be    found')
    playlist = self.channel_db_handler.getPlaylist(self.playlist_id, ['Playlists.dispersy_id'])
    if (playlist is None):
        return BaseChannelsEndpoint.return_404(request, message='this    playlist    cannot    be    found')
    torrent_in_channel = False
    for torrent in self.channel_db_handler.getTorrentsFromChannelId(channel_info[0], True, ['infohash']):
        if (torrent[0] == self.infohash):
            torrent_in_channel = True
            break
    if (not torrent_in_channel):
        return BaseChannelsEndpoint.return_404(request, message='this    torrent    is    not    available    in    your    channel')
    for torrent in self.channel_db_handler.getTorrentsFromPlaylist(self.playlist_id, ['infohash']):
        if (torrent[0] == self.infohash):
            request.setResponseCode(http.CONFLICT)
            return json.dumps({'error': 'this    torrent    is    already    in    your    playlist'})
    channel_community.create_playlist_torrents(int(self.playlist_id), [self.infohash])
    return json.dumps({'added': True})
