Skip to content

Commit

Permalink
Merge pull request #47 from anamewing/feature/ExHentaiApi
Browse files Browse the repository at this point in the history
fix #46, 让 e-hentai 与 ExHentai 分别调用各自的 API
  • Loading branch information
DaidoujiChen committed Feb 23, 2016
2 parents bf76950 + aa849c3 commit ba06f8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions e-Hentai/ExMainViewController/ExMainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ - (NSString *)filterString {
return filterString;
}

- (BOOL) isExHentai {
return YES;
}

#pragma mark - life cycle

- (void)viewDidLoad {
Expand Down
7 changes: 6 additions & 1 deletion e-Hentai/MainViewController/MainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ @interface MainViewController ()
@property (nonatomic, strong) UITableView *listTableView;
@property (nonatomic, strong) UIRefreshControl *refreshControl;
@property (nonatomic, readonly) NSString *filterString;
@property (nonatomic, readonly) BOOL isExHentai;
@property (nonatomic, assign) BOOL onceFlag;
@property (nonatomic, strong) NSMutableDictionary *textViewCacheMapping;

Expand All @@ -33,6 +34,10 @@ - (NSString *)filterString {
return [self filterDependOnURL:@"http://g.e-hentai.org/?page=%lu"];
}

- (BOOL) isExHentai {
return NO;
}

#pragma mark - SearchFilterV2ViewControllerDelegate

// 搜尋畫面按 done 回來時
Expand Down Expand Up @@ -236,7 +241,7 @@ - (void)reloadDatas {
//把 request 的判斷都放到這個 method 裡面來
- (void)loadList:(void (^)(BOOL successed, NSArray *listArray))completion {
[SVProgressHUD show];
[HentaiParser requestListAtFilterUrl:self.filterString forExHentai:NO completion: ^(HentaiParserStatus status, NSArray *listArray) {
[HentaiParser requestListAtFilterUrl:self.filterString forExHentai:[self isExHentai] completion: ^(HentaiParserStatus status, NSArray *listArray) {
if (status && [listArray count]) {
completion(YES, listArray);
}
Expand Down

0 comments on commit ba06f8e

Please sign in to comment.