要從谷歌硬盤中類出 mp3,mp4,mkv,avi,aac,wmv 文件。目前我只能列出mp3文件。
我的代碼
怎麼使用query.q = @"mimeType ='audio/mpeg' 查詢多個擴展?
-(void)loadDriveFiles
{
GTLQueryDrive *query = [GTLQueryDrive queryForFilesList];
query.q = @"mimeType ='audio/mpeg' ";
UIAlertView *alert = [GoogleUtilities showLoadingMessageWithTitle:@"Loading files"
delegate:self];
[self.driveService executeQuery:query completionHandler:^(GTLServiceTicket *ticket,
GTLDriveFileList *files,
NSError *error)
{
[alert dismissWithClickedButtonIndex:0 animated:YES];
if (error == nil)
{
if (self.driveFiles == nil)
{
self.driveFiles = [[NSMutableArray alloc] init];
}
[self.driveFiles removeAllObjects];
[self.driveFiles addObjectsFromArray:files.items];
[self.tableView reloadData];
} else {
NSLog(@"An error occurred: %@", error);
[GoogleUtilities showErrorMessageWithTitle:@"Unable to load files"
message:[error description]
delegate:self];
}
}];
}
//非常感謝
在查詢中使用邏輯運算符
比如mimeType = 'audio/mpeg' or mimeType = 'audio/mp3'