소스 검색

library: fix non-MLFile deletions on iPad

Felix Paul Kühne 11 년 전
부모
커밋
e1e2afb375
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      Sources/VLCPlaylistCollectionViewCell.m

+ 8 - 1
Sources/VLCPlaylistCollectionViewCell.m

@@ -114,8 +114,15 @@
 
 - (IBAction)removeMedia:(id)sender
 {
+    NSString *title;
+    id mediaObject = self.mediaObject;
+    if ([mediaObject isKindOfClass:[MLAlbum class]] || [mediaObject isKindOfClass:[MLShowEpisode class]] || [mediaObject isKindOfClass:[MLShow class]])
+        title = [mediaObject name];
+    else
+        title = [mediaObject title];
+
     /* ask user if s/he really wants to delete the media file */
-    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"DELETE_FILE", @"") message:[NSString stringWithFormat:NSLocalizedString(@"DELETE_FILE_LONG", @""), self.mediaObject.title] delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"") otherButtonTitles:NSLocalizedString(@"BUTTON_DELETE", @""), nil];
+    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"DELETE_FILE", @"") message:[NSString stringWithFormat:NSLocalizedString(@"DELETE_FILE_LONG", @""), title] delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"") otherButtonTitles:NSLocalizedString(@"BUTTON_DELETE", @""), nil];
     [alert show];
 }