{"id":15680603,"url":"https://github.com/simonbs/charlestvdb","last_synced_at":"2025-07-26T13:15:09.818Z","repository":{"id":9835857,"uuid":"11825048","full_name":"simonbs/CharlesTVDB","owner":"simonbs","description":"A collection of classes for OS X and iOS which provides a block based interface for TheTVDB which is extremely easy to use.","archived":false,"fork":false,"pushed_at":"2015-04-05T12:03:55.000Z","size":365,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-07T11:15:57.453Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonbs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-01T18:55:48.000Z","updated_at":"2025-04-22T21:17:41.000Z","dependencies_parsed_at":"2022-08-30T23:40:16.126Z","dependency_job_id":null,"html_url":"https://github.com/simonbs/CharlesTVDB","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonbs%2FCharlesTVDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonbs%2FCharlesTVDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonbs%2FCharlesTVDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonbs%2FCharlesTVDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonbs","download_url":"https://codeload.github.com/simonbs/CharlesTVDB/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252865588,"owners_count":21816309,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T16:43:22.762Z","updated_at":"2025-05-07T11:16:36.272Z","avatar_url":"https://github.com/simonbs.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CharlesTVDB\n\nCharlesTVDB is a collection of classes for OS X and iOS which provides a block based interface for [TheTVDB.com](http://thetvdb.com) which is extremely easy to use.\n\n## Requirements\n\n- iOS 7 is required.\n- CharlesTVDB and some of its dependencies requires ARC to be enabled. If you are not already using ARC, now is a good time.\n\n## Installation\n\nIf  you are using CocoaPods (which you should!) you can just add the following to your podfile and run `pod install`.\n\n\tpod 'CharlesTVDB', :git =\u003e 'https://github.com/simonbs/CharlesTVDB.git'\n\tpod 'AFKissXMLRequestOperation', :git =\u003e 'https://github.com/marcelofabri/AFKissXMLRequestOperation.git'\n\nIf you are not not using CocoaPods, you should clone this repository and copy CharlesTVDB/ directory into your project. You should also install [AFKissXMLRequestOperation](https://github.com/marcelofabri/AFKissXMLRequestOperation) which CharlesTVDB depends on.\n**NOTE**: CharlesTVDB uses [Marcelo Fabris](https://github.com/marcelofabri) fork of AFKissXMLRequestOperation which supports AFNetworking 2.0.\nYou have to install the fork of AFKissXMLRequestOperation manually (e.g. using CocoaPods as shown above) as it is not possible to specify a fork as a dependency in a podspec.\n\nAFKissXMLRequestOperation then again depends on  [AFNetworking](https://github.com/AFNetworking/AFNetworking) and [KissXML](https://github.com/robbiehanson/KissXML) so you will also have to install those.\n\nWhen you have installed CharlesTVDB either using CocoaPods or not, you just need to import the header.  I recommend doing this in the prefix header.\n\n\t#import \"CharlesTVDB\"\n\nYou're ready to use CharlesTVDB!\n\n## Usage\n\nFirst, you will have to grab an API key from [TheTVDB.com](http://thetvdb.com). If you have an account and you are logged in, you can [register your application here](http://thetvdb.com/?tab=apiregister) to get an API key.\n\nNow that you have your API key, you can configure `CharlesClient` with it. `CharlesClient` is a singleton which holds some necessary information.\nYou can do this wherever you want but it is only necessary to do it once. I recommend doing it in `-applicationDidFinishLaunching:`.\n\n\tCharlesClient *charles = [CharlesClient sharedClient];\n\tcharles.apiKey = @\"YourAPIKey\";\n\t\n#### Setting the Language\n\nOptionally, you can set the language on the client. This can be changed at any time but any data already loaded will have to be reloaded to be updated with texts in the new language.\n\nCharlesTVDB is entirely block based which makes it insanly easy to use. If you want a list of the languages that TheTVDB provdes, you can load them like this:\n\n\t[CharlesLanguage loadAllLanguages:^(NSArray *languages) {\n        // Languages are loaded, when setting the langauge on the CharesClient you are interested in the abbreviation\n        for (CharlesLanguage *language in languages) {\n            NSLog(@\"%@\", language.abbreviation);\n        }\n    } failure:^(NSError *error) {\n        // Handle the error\n    }];\n    \nThe above just loads a list of all the available languages and logs them to the console. If you want to set language on CharlesClient, you should use the `abbreviation` that an instance of CharlesLanguage provides.\n\n#### Searching for TV series\n\nYou can search for a TV series by its name. Below we search for \"The Mentalist\" and print the name of all the results we found.\n\n\t[CharlesTVSeries searchTVSeriesByName:@\"The Mentalist\" completion:^(NSArray *results) {\n        for (CharlesTVSeries *tvSeries in results) {\n            NSLog(@\"%@\", tvSeries.name);\n        }\n    } failure:^(NSError *error) {\n        // Handle the error\n    }];\n\n#### Loading a TV series from an ID\n\nYou might have saved an ID for a TV series and want to look it up on TheTVDB. This ID can either be a TheTVDBs own ID (that's the `identifier` property on an instance of CharlesTVSeries) or it can be an IMDb ID or a Zap2it ID. The last two are also accessible on instances of  CharlesTVSeries.\n\nDepending on the ID you have, you want to use one of the three static methods on the CharlesTVSeries.\n\n\t+ (void)loadTVSeriesWithId:(NSUInteger)seriesId completion:(void (^)(CharlesTVSeries *tvSeries))completion failure:(void (^)(NSError *error))failure;\n\t+ (void)loadTVSeriesWithImdbId:(NSString *)imdbId completion:(void (^)(CharlesTVSeries *tvSeries))completion failure:(void (^)(NSError *error))failure;\n\t+ (void)loadTVSeriesWithZap2itId:(NSString *)zap2itId completion:(void (^)(CharlesTVSeries *tvSeries))completion failure:(void (^)(NSError *error))failure;\n\nFor example, if you have the IMDb ID *tt0773262* (that's the ID for [Dexter](http://www.imdb.com/title/tt0773262) you can retrive the TV series like this:\n\n\t[CharlesTVSeries loadTVSeriesWithImdbId:@\"tt0773262\" completion:^(CharlesTVSeries *tvSeries) {\n        if (tvSeries)\n        {\n            NSLog(@\"%@\", tvSeries.name);\n        }\n    } failure:^(NSError *error) {\n        // Handle the error\n    }];\t\n    \nNotice that we check if the `tvSeries` from the completion block is nil. This is because, that it is not considered an error if the TV series does not exist. Instead you won't get any TV series. Please handle this in your application.\n\n#### Loading the details of a TV series\n\nDue to the way the API provided by TheTVDB works, you won't always get all the information. When searching for a TV series seasons, episodes, some artwork and more is not loaded but if you load a TV series with the ID provided by TheTVDB, you will get all information, including all seasons and episodes. However, if you load the TV series with an IMDb or Zap2it ID, you will not get all the information.\n\nDetails can be loaded by calling `-loadDetails:` on a CharlesTVSeries object. If the details are already loaded, the completion block will be called immediately so that no unnecessary requests are made.\n\nThe details are stored in an CharlesTVSeriesDetails object on CharlesTVSeries so it is easy to distinguish between information which is always loaded and information which might be loaded.\n\nYou can check if the details are already loaded by the `isDetailsLoaded` property on instances of CharlesTVSeries.\n\n#### Artwork\n\nYou will find a banner on instances of CharlesTVSeries and in the details of the TV series you can find fanart and a poster. The artwork is stored in instanes of CharlesArtwork and to save bandwidth and potentially unnecessary requests, the images are not loaded right away.\nYou can load an image by calling `-loadImage:` on the artwork. If the image is already loaded, it won't be loaded again. Instead, the completion block will be called immediately.\n\nThe `isLoaded` property tells if the image is already loaded or not.\n\n## Demo Projects\n\nThe two demo projects that are in this repository are very boring and are in no way complete. I will make some more interesting examples when I get some more time. However, the above description should give you plenty information on how to use CharlesTVDB.\n\n## Credits\n\nCharlesTVDB is developed by [@simonbs](http://twitter.com/simonbs), [simonbs.dk](http://simonbs.dk) Feel free to fork the repository and send pull requests if you have made something awesome.\n\n## License\n\nCharlesTVDB is released under the MIT license. Please see the LICENSE file for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonbs%2Fcharlestvdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonbs%2Fcharlestvdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonbs%2Fcharlestvdb/lists"}