geremyk / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

Error when making a previously uploaded you tube video public. #221

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Upload a video and mark it as private.
2. Load the video into a YouTubeEntry object via the EditURI.
(YouTubeEntry)yts.Get(EditUri)

3. Set the Private property to false on the YouTubeEntry.
4. Try to Update the YouTubeEntry.

What is the expected output? What do you see instead?
This should make the video public. Instead it throws the following runtime
error:
   at Google.GData.Extensions.SimpleContainer.SaveInnerXml(XmlWriter writer)
   at Google.GData.Extensions.ExtensionBase.Save(XmlWriter writer)
   at Google.GData.Client.AtomBase.SaveXmlAttributes(XmlWriter writer)
   at Google.GData.Client.AtomBase.SaveToXml(XmlWriter writer)
   at Google.GData.Client.AtomBase.SaveToXml(Stream stream)
   at Google.GData.Client.Service.EntrySend(Uri feedUri, AtomBase
baseEntry, GDataRequestType type, AsyncSendData data)
   at Google.GData.Client.MediaService.EntrySend(Uri feedUri, AtomBase
baseEntry, GDataRequestType type, AsyncSendData data)
   at Google.GData.Client.Service.Update(AtomEntry entry, AsyncSendData data)
   at Google.GData.Client.Service.Update(AtomEntry entry)
   at Google.GData.Client.AtomEntry.Update()
   at Google.GData.YouTube.YouTubeEntry.Update()

The error occurs because of line 462 in youtubeentry.cs.  The line reads as
follows:
this.Media.ReplaceExtension(p.XmlName, p.XmlNameSpace, null);
When in reality it should be:                        
this.Media.DeleteExtensions(p.XmlName, p.XmlNameSpace); 

This fixes the issue. 

Michael W.
www.WyzAnt.com

Original issue reported on code.google.com by weish...@gmail.com on 26 Feb 2009 at 12:34

GoogleCodeExporter commented 8 years ago
This is the code that produces the error.

YouTubeService yts = new YouTubeService("XXXXX", "XXXXX", youTubeDevID);
yts.setUserCredentials("XXXXX", "XXXXX");
YouTubeEntry videoEntry =
(YouTubeEntry)yts.Get("http://gdata.youtube.com/feeds/api/users/wyzant/uploads/X
XXXX?client=XXXXX");
StreamWriter sw2 = new StreamWriter("xxxxx.txt");
videoEntry.Private = false;
videoEntry.SaveToXml(sw2.BaseStream);
sw2.Close();

Original comment by weish...@gmail.com on 26 Feb 2009 at 12:43

GoogleCodeExporter commented 8 years ago
This was accidently fixed when i change the extensionllst code to NOT add null 
objects a few days ago. I am 
going to incorporate that change anway, as it is the cleaner code. 

Checked in today, will be in next release

Original comment by fman...@gmail.com on 26 Feb 2009 at 9:30