Skip to content

Commit

Permalink
Enable search from playlists
Browse files Browse the repository at this point in the history
Fixes GH-222
  • Loading branch information
NattyNarwhal committed Jan 29, 2025
1 parent 41adf7a commit 893eed1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ Doing so isn't fatal (it's not a secret), but it is annoying for other contribut
* Similar tracks for an artist (sometimes called "radio") can now be displayed
* Directories can be starred.
* Recover from situations where the cover file was deleted from the filesystem.
* Can create server playlists from the playlist view.
* Searches can be performed from the playlist view.
* Server playlists can be created from the playlist view.
* Allow multiple items to be selected in searches.
* Fix covers being deleted by the system on macOS 15.
* Fix searches being ran twice.
Expand Down
6 changes: 6 additions & 0 deletions Submariner/SBDatabaseController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1968,6 +1968,12 @@ - (void)pageController:(NSPageController *)pageController didTransitionToObject:
} else if ([navItem isKindOfClass: SBServerNavigationItem.class]) {
[searchToolbarItem setEnabled: YES];
[searchField setPlaceholderString: @"Server Search"];
} else if ([navItem isKindOfClass: SBPlaylistNavigationItem.class]) {
[searchToolbarItem setEnabled: YES];
SBPlaylistNavigationItem *playlistNavItem = (SBPlaylistNavigationItem*)navItem;
SBPlaylist *playlist = playlistNavItem.playlist;
// this does seem to set self.server in usage, so we don't need to special case search:
[searchField setPlaceholderString: playlist.server != nil ? @"Server Search" : @"Local Search"];
} else {
[searchToolbarItem setEnabled: NO];
[searchField setPlaceholderString: @""];
Expand Down

0 comments on commit 893eed1

Please sign in to comment.