Hey, hopefully someone will be able to give me a little insight on this problem, but I'm kinda thinking it's something to do with the API itself which probably won't be addressed. Anyways Im running a search to get all the volumes of a specific name: http://api.comicvine.com/search/?api_key=xxxxxx&resources=volume&query=batman&limit=20&offset=0&field_list=id,name,count_of_issues&format=json
When the query return, the top 3 results are: [0] => stdClass Object ( [id] => 4720 [count_of_issues] => 179 [resource_type] => volume [name] => Batman: Legends of the Dark Knight ) [1] => stdClass Object ( [id] => 4724 [count_of_issues] => 96 [resource_type] => volume [name] => Batman: Shadow Of The Bat ) [2] => stdClass Object ( [id] => 3109 [count_of_issues] => 27 [resource_type] => volume [name] => Batman Annual )
Is there a better way to get volumes by name? So that if in my case I search against batman, the first result would be batman.
Just this morning alone I wrote a 245 line class which runs a few queries, which isn't a lot I suppose. However what's upsetting is around 100 of those lines are going towards an ugly for loop which queries volumes, gets their ID's then goes and queries ALL the volumeIDs to get issue numbers. further more, I'm then having to sort the array afterwords so I can get the issue numbering in the correct order. Brute force works... but it really sucks and leads to some very messy code which leads to bugs and who knows what other headaches down the road.
Log in to comment