def get(self):
   yt_service = youtubeutils.create_youtube_service(
     self.oauth2_decorator.credentials.access_token)
   (feed, entries) = youtubeutils.fetch_feed_and_entries(
     yt_service.GetYouTubePlaylistFeed, username="******")
   playlists_from_datastore = model.PlaylistMetadata.gql(
     "WHERE owner = :1", users.get_current_user())
   playlist_ids = set(i.playlist_id for i in playlists_from_datastore)
   playlists = []
   for entry in entries:
     id_from_uri = youtubeutils.get_id_from_uri(entry)
     if id_from_uri in playlist_ids:
       playlists.append(dict(id=id_from_uri, title=entry.title.text,
                             num_videos=entry.feed_link[0].count_hint))
   webutils.render_to_response(self, "playlists.html",
                               dict(playlists=playlists))
 def get(self):
     yt_service = youtubeutils.create_youtube_service(
         self.oauth2_decorator.credentials.access_token)
     (feed, entries) = youtubeutils.fetch_feed_and_entries(
         yt_service.GetYouTubePlaylistFeed, username="******")
     playlists_from_datastore = model.PlaylistMetadata.gql(
         "WHERE owner = :1", users.get_current_user())
     playlist_ids = set(i.playlist_id for i in playlists_from_datastore)
     playlists = []
     for entry in entries:
         id_from_uri = youtubeutils.get_id_from_uri(entry)
         if id_from_uri in playlist_ids:
             playlists.append(
                 dict(id=id_from_uri,
                      title=entry.title.text,
                      num_videos=entry.feed_link[0].count_hint))
     webutils.render_to_response(self, "playlists.html",
                                 dict(playlists=playlists))
    def get(self, playlist_id):
        friend_list = friendlistutils.render_friend_list(playlist_id, self.people)
        template_params = {"button_name": "Remove", "class_name": "playlist-item", "friend_list": friend_list}
        yt_service_for_owner = youtubeutils.create_youtube_service(self.owner_oauth_token)
        (playlist, entries) = youtubeutils.fetch_feed_and_entries(
            yt_service_for_owner.GetYouTubePlaylistVideoFeed, playlist_id=playlist_id
        )

        edit_playlist_url = "%s/playlists/edit/%s?%s" % (
            self.request.host_url,
            self.playlist_metadata.playlist_id,
            urllib.urlencode({"uuid": self.playlist_metadata.uuid}),
        )
        welcome_page_url = re.sub(r"/edit/", r"/welcome/", edit_playlist_url, 1)

        template_params["title"] = playlist.title.text
        template_params["description"] = playlist.subtitle.text
        template_params["quoted_playlist_id"] = simplejson.dumps(playlist_id)
        template_params["playlist_id"] = playlist_id
        template_params["video_list"] = youtubeutils.prepare_playlist(entries)
        template_params["quoted_edit_url"] = simplejson.dumps(edit_playlist_url)
        template_params["quoted_uuid"] = simplejson.dumps(self.playlist_metadata.uuid)
        template_params["welcome_page_url"] = welcome_page_url
        webutils.render_to_response(self, "edit_playlist.html", template_params)
  def get(self, playlist_id):
    friend_list = friendlistutils.render_friend_list(playlist_id, self.people)
    template_params = {"button_name": "Remove", "class_name": "playlist-item",
                       "friend_list": friend_list}
    yt_service_for_owner = youtubeutils.create_youtube_service(
      self.owner_oauth_token)
    (playlist, entries) = youtubeutils.fetch_feed_and_entries(
      yt_service_for_owner.GetYouTubePlaylistVideoFeed, playlist_id=playlist_id)

    edit_playlist_url = "%s/playlists/edit/%s?%s" % (
      self.request.host_url, self.playlist_metadata.playlist_id,
      urllib.urlencode({"uuid": self.playlist_metadata.uuid}))
    welcome_page_url = re.sub(r"/edit/", r"/welcome/", edit_playlist_url, 1)
    
    template_params["title"] = playlist.title.text
    template_params["description"] = playlist.subtitle.text
    template_params["quoted_playlist_id"] = simplejson.dumps(playlist_id)
    template_params["playlist_id"] = playlist_id
    template_params["video_list"] = youtubeutils.prepare_playlist(entries)
    template_params["quoted_edit_url"] = simplejson.dumps(edit_playlist_url)
    template_params["quoted_uuid"] = simplejson.dumps(
      self.playlist_metadata.uuid)
    template_params["welcome_page_url"] = welcome_page_url
    webutils.render_to_response(self, "edit_playlist.html", template_params)