Playlist View: Fix default sorting and playlist refreshing, which fixes playlist search bugging out
parent
26e0e0cead
commit
297b7b2909
|
@ -109,6 +109,9 @@ static NSArray * cellIdentifiers = nil;
|
||||||
|
|
||||||
statusImageTransformer = [NSValueTransformer valueTransformerForName:@"StatusImageTransformer"];
|
statusImageTransformer = [NSValueTransformer valueTransformerForName:@"StatusImageTransformer"];
|
||||||
|
|
||||||
|
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"index" ascending:YES];
|
||||||
|
[self.tableView setSortDescriptors:@[sortDescriptor]];
|
||||||
|
|
||||||
[self addObserver:self
|
[self addObserver:self
|
||||||
forKeyPath:@"arrangedObjects"
|
forKeyPath:@"arrangedObjects"
|
||||||
options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld)
|
options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld)
|
||||||
|
@ -123,6 +126,7 @@ static NSArray * cellIdentifiers = nil;
|
||||||
if ([keyPath isEqualToString:@"arrangedObjects"]) {
|
if ([keyPath isEqualToString:@"arrangedObjects"]) {
|
||||||
[self updatePlaylistIndexes];
|
[self updatePlaylistIndexes];
|
||||||
[self updateTotalTime];
|
[self updateTotalTime];
|
||||||
|
[self.tableView reloadData];
|
||||||
}
|
}
|
||||||
else if ([keyPath isEqualToString:@"values.fontSize"]) {
|
else if ([keyPath isEqualToString:@"values.fontSize"]) {
|
||||||
[self updateRowSize];
|
[self updateRowSize];
|
||||||
|
|
Loading…
Reference in New Issue