Explorar o código

library: fix non-MLFile deletions on iPad

Felix Paul Kühne %!s(int64=11) %!d(string=hai) anos
pai
achega
e1e2afb375
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  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];
 }