trungtoanit / gdata-objectivec-client

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

Youtube service returns GDataEntryBase elements instead of GDataEntryYouTubeVideo #56

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

GDataServiceGoogleYouTube *service = [[GDataServiceGoogleYouTube alloc] init];
[service setShouldCacheDatedData:YES];
[service setIsServiceRetryEnabled:YES];
[service setUserCredentialsWithUsername:nil password:nil];

NSURL *feedURL = [GDataServiceGoogleYouTube youTubeURLForFeedID:nil];
GDataQueryYouTube *query = [GDataQueryYouTube youTubeQueryWithFeedURL:feedURL];
[query setMaxResults:20];
[query setOrderBy:kGDataYouTubeOrderByRelevance];
[query setVideoQuery:@"query string"];

GDataServiceTicket *ticket = [service fetchFeedWithQuery:query
                                           feedClass:[GDataFeedYouTubeVideo class]
                                        delegate:self
                                   didFinishSelector:@selector(ticket:finishedWithFeed:error:)];

What is the expected output? What do you see instead?

GDataFeedYouTubeVideo with GDataEntryYouTubeVideo elements. Actually, I 
expected not to provide "feedClass" to the service, as it's youtube service, 
therefor it should know which kind of feed to return. The result was a feed 
with GDataEntryBase elements, which are quite useless. 

What version of the product are you using? On what operating system?
trunk@r537

Please provide any additional information below.
I used the following workaround:

Index: Source/Clients/YouTube/GDataFeedYouTubeVideo.m
===================================================================
--- Source/Clients/YouTube/GDataFeedYouTubeVideo.m  (revision 538)
+++ Source/Clients/YouTube/GDataFeedYouTubeVideo.m  (working copy)
@@ -21,6 +21,7 @@

 #import "GDataFeedYouTubeVideo.h"
 #import "GDataYouTubeConstants.h"
+#import "GDataEntryYouTubeVideo.h"

 @implementation GDataFeedYouTubeVideo

@@ -42,7 +43,7 @@
 }

 - (Class)classForEntries {
-  return kUseRegisteredEntryClass;
+  return [GDataEntryYouTubeVideo class];
 }

Original issue reported on code.google.com by roman.sh...@gmail.com on 18 Jun 2010 at 9:40

GoogleCodeExporter commented 9 years ago
The YouTube code is not being compiled into the app.

Discussion at 
http://groups.google.com/group/gdata-objectivec-client/browse_thread/thread/afba
c09f38160be0

Original comment by gregrobbins on 18 Jun 2010 at 4:18