diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index cbb9839f3..37ba27d32 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -85,7 +85,7 @@ - + @@ -379,19 +379,19 @@ - - artist contains[cd] $value + artist contains[cd] $value Album + - - genre contains[cd] $value + genre contains[cd] $value Genre + @@ -1099,8 +1099,8 @@ NSIsNotNil - + @@ -1150,8 +1150,8 @@ CA NSIsNotNil - + @@ -1159,6 +1159,13 @@ CA + + + + + + + @@ -1187,11 +1194,11 @@ CA - + RepeatAllTransformer - + @@ -1213,11 +1220,11 @@ CA - + RepeatOneTransformer - + @@ -1228,11 +1235,11 @@ CA - + RepeatNoneTransformer - + @@ -1478,11 +1485,11 @@ Gw - + - Not Playing + @@ -1492,11 +1499,11 @@ Gw - + - Not Playing + @@ -1619,8 +1626,8 @@ Gw NSIsNotNil - + @@ -1634,8 +1641,8 @@ Gw NSIsNotNil - + @@ -1652,8 +1659,8 @@ Gw NSIsNotNil - + @@ -1667,8 +1674,8 @@ Gw NSIsNotNil - + @@ -1680,10 +1687,10 @@ Gw - + - + NSIsNotNil @@ -1717,7 +1724,7 @@ Gw - + @@ -1773,7 +1780,7 @@ Gw - + YnBsaXN0MDDUAQIDBAUGRkdYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoK8QDwcI ExQZHh8qKyw0NzpAQ1UkbnVsbNUJCgsMDQ4PEBESVk5TU2l6ZVYkY2xhc3NcTlNJbWFnZUZsYWdzVk5T diff --git a/Playlist/PlaylistController.h b/Playlist/PlaylistController.h index 8aa900826..e0945847f 100644 --- a/Playlist/PlaylistController.h +++ b/Playlist/PlaylistController.h @@ -77,6 +77,8 @@ typedef enum { - (IBAction)randomizeList:(id)sender; +- (IBAction)removeDuplicates:(id)sender; + - (IBAction)showEntryInFinder:(id)sender; - (IBAction)clearFilterPredicate:(id)sender; - (IBAction)clear:(id)sender; diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index 747a8c7a1..8da711604 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -459,6 +459,25 @@ } } +- (IBAction)removeDuplicates:(id)sender { + NSMutableArray *originals = [[NSMutableArray alloc] init]; + NSMutableIndexSet *duplicates = [[NSMutableIndexSet alloc] init]; + + for (PlaylistEntry *pe in [self content]) + { + if ([originals containsObject:[pe URL]]) + [duplicates addIndex:[pe index]]; + else + [originals addObject:[pe URL]]; + } + + if ([duplicates count] > 0) + [self removeObjectsAtArrangedObjectIndexes:duplicates]; + + [duplicates release]; + [originals release]; +} + - (PlaylistEntry *)shuffledEntryAtIndex:(int)i { RepeatMode repeat = [self repeat];