Playlist View: Fix default sorting and playlist refreshing, which fixes playlist search bugging out

CQTexperiment
Christopher Snowhill 2022-01-21 00:16:29 -08:00
parent 26e0e0cead
commit 297b7b2909
1 changed files with 4 additions and 0 deletions

View File

@ -109,6 +109,9 @@ static NSArray * cellIdentifiers = nil;
statusImageTransformer = [NSValueTransformer valueTransformerForName:@"StatusImageTransformer"];
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"index" ascending:YES];
[self.tableView setSortDescriptors:@[sortDescriptor]];
[self addObserver:self
forKeyPath:@"arrangedObjects"
options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld)
@ -123,6 +126,7 @@ static NSArray * cellIdentifiers = nil;
if ([keyPath isEqualToString:@"arrangedObjects"]) {
[self updatePlaylistIndexes];
[self updateTotalTime];
[self.tableView reloadData];
}
else if ([keyPath isEqualToString:@"values.fontSize"]) {
[self updateRowSize];