Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 717660 Details for
Bug 928796
libmusicbrainz5's xml parser is broken.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Here's the code for getting release list for an artist.
musicbrainz_test.c (text/x-csrc), 4.87 KB, created by
abhijangda
on 2013-03-28 13:14:32 UTC
(
hide
)
Description:
Here's the code for getting release list for an artist.
Filename:
MIME Type:
Creator:
abhijangda
Created:
2013-03-28 13:14:32 UTC
Size:
4.87 KB
patch
obsolete
> >#include <stdio.h> >#include <stdlib.h> >#include <string.h> >#include <unistd.h> > >#include <musicbrainz5/mb5_c.h> > >int main(int argc, const char *argv[]) >{ > Mb5Query Query; > argc=argc; > argv=argv; > > Query=mb5_query_new("mydabatabase/0.1 ( abhijangda@hotmail.com )",NULL,0); > if (Query) > { > char **ParamNames; > char **ParamValues; > Mb5Metadata Metadata; > char ErrorMessage[256]; > tQueryResult Result; > int HTTPCode; > > ParamNames=malloc(2*sizeof(char *)); > ParamNames[0]=malloc(256); > ParamNames[1]=malloc(256); > > ParamValues=malloc(2*sizeof(char *)); > ParamValues[0]=malloc(1024); > ParamValues[1]=malloc(256); > > strcpy(ParamNames[0],"query"); > strcpy(ParamValues[0],"artist:Westlife"); > > //strcpy(ParamNames[1],"limit"); > //strcpy(ParamValues[1],"25"); > > Metadata=mb5_query_query(Query,"artist","","",1,ParamNames,ParamValues); > > Result=mb5_query_get_lastresult(Query); > HTTPCode=mb5_query_get_lasthttpcode(Query); > if(Result==eQuery_Success) > printf("Success\n"); > else if(Result==eQuery_ResourceNotFound) > printf("Resource Not Found\n"); > > mb5_query_get_lasterrormessage(Query,ErrorMessage,sizeof(ErrorMessage)); > //printf("Result: %d\nHTTPCode: %d\nErrorMessage: '%s'\n",Result,HTTPCode,ErrorMessage); > > if (Metadata) > { > int ThisArtist; > Mb5ArtistList ArtistList=mb5_metadata_get_artistlist(Metadata); > > printf("Found %d artist(s)\n",mb5_artist_list_size(ArtistList)); > for (ThisArtist=0;ThisArtist<mb5_artist_list_size(ArtistList);ThisArtist++) > { > Mb5Artist Artist=mb5_artist_list_item(ArtistList,ThisArtist); > if (Artist) > { > int count; > char Name[256]; > char Value[1024]; > int NumExtAttrs=mb5_entity_ext_attributes_size(Artist); > int NumExtElements=mb5_entity_ext_elements_size(Artist); > > mb5_artist_get_name(Artist,Name,sizeof(Name)); > printf("Artist is '%s'\n",Name); > mb5_artist_get_id(Artist,Value,sizeof(Value)); > printf("Artist ID is %s\n",Value); > > char *ParamNames2[]={"inc"}; > char *ParamValues2[]={"releases"}; > > sleep(2); > Mb5Metadata Metadata2=mb5_query_query(Query,"artist",Value,"",1,ParamNames2,ParamValues2); > > Result=mb5_query_get_lastresult(Query); > HTTPCode=mb5_query_get_lasthttpcode(Query); > > if(Result==eQuery_Success) > printf("Success\n"); > else if(Result==eQuery_ResourceNotFound) > printf("Resource Not Found\n"); > else if(Result==eQuery_ConnectionError) > printf("ConnectionError\n"); > else if(Result==eQuery_Timeout) > printf("Timeout\n"); > else if(Result==eQuery_AuthenticationError) > printf("AuthenticationError\n"); > else if(Result==eQuery_FetchError) > printf("eQuery_FetchError\n"); > else if(Result==eQuery_RequestError) > printf("RequestError\n"); > > //Mb5ArtistList _ArtistList=mb5_metadata_get_artistlist(Metadata2); > Mb5Artist _artist=mb5_metadata_get_artist(Metadata2); > //Mb5Artist _artist = mb5_artist_list_item(_ArtistList,0); > Mb5ReleaseList ArtistRList; > if(_artist) > { > char Name2[256]; > mb5_artist_get_name(_artist,Name2,sizeof(Name2)); > printf("Artist NAME IS %s\n",Name2); > } > //ArtistRList = mb5_metadata_get_releaselist(Metadata2); > ArtistRList = mb5_artist_get_releaselist(_artist); > printf("Release List Size %d\n",mb5_release_list_size(ArtistRList)); > mb5_metadata_delete(Metadata2); > } > else > { > printf("Couldn't get artist %d\n",ThisArtist); > } > } > mb5_metadata_delete(Metadata); > } > free(ParamValues[1]); > free(ParamValues[0]); > free(ParamValues); > free(ParamNames[1]); > free(ParamNames[0]); > free(ParamNames); > > mb5_query_delete(Query); > } > return 0; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 928796
: 717660