Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get top and similar tracks #219

Merged
merged 6 commits into from
Dec 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Expose top tracks in the UI
There's an issue with titles that kind of sucks. Will have to fix.

Fixes GH-109
  • Loading branch information
NattyNarwhal committed Nov 13, 2024
commit a5a990972a0d8d134243086d78c5bfca85914aa6
2 changes: 2 additions & 0 deletions Submariner/SBDatabaseController.h
Original file line number Diff line number Diff line change
@@ -153,6 +153,8 @@
- (IBAction)showDownloadView:(id)sender;
- (IBAction)showLibraryView:(id)sender;

- (void)getTopTracksFor:(NSString*)artistName;

- (IBAction)openAudioFiles:(id)sender;
- (IBAction)toggleTrackList:(id)sender;
- (IBAction)toggleServerUsers:(id)sender;
6 changes: 6 additions & 0 deletions Submariner/SBDatabaseController.m
Original file line number Diff line number Diff line change
@@ -934,6 +934,12 @@ - (IBAction)search:(id)sender {
}


- (void)getTopTracksFor:(NSString*)artistName {
SBNavigationItem *navItem = [[SBServerSearchNavigationItem alloc] initWithServer: self.server topTracksFor:artistName];
[self navigateForwardToNavItem: navItem];
}


- (IBAction)cleanTracklist:(id)sender {
[self stop: sender];
[tracklistController cleanTracklist: sender];
9 changes: 9 additions & 0 deletions Submariner/SBServerLibraryController.m
Original file line number Diff line number Diff line change
@@ -273,6 +273,15 @@ - (IBAction)filterArtist:(id)sender {
}


- (IBAction)getTopTracksForSelectedArtist:(id)sender {
SBArtist *artist = [[self selectedArtists] firstObject];
if (artist) {
NSString *name = [artist itemName];
[self.databaseController getTopTracksFor: name];
}
}


- (void)showTrackInLibrary:(SBTrack*)track {
[artistsController setSelectedObjects: @[track.album.artist]];
[artistsTableView scrollRowToVisible: [artistsTableView selectedRow]];
19 changes: 13 additions & 6 deletions Submariner/ServerLibrary.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22690"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -22,7 +22,7 @@
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="80">
<customView id="80">
<rect key="frame" x="0.0" y="0.0" width="619" height="398"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
@@ -167,11 +167,11 @@
<rect key="frame" x="-2" y="41" width="446" height="199"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<clipView key="contentView" id="uNg-bD-Z0H">
<rect key="frame" x="0.0" y="0.0" width="446" height="199"/>
<rect key="frame" x="0.0" y="0.0" width="446" height="184"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnSelection="YES" autosaveName="ServerMusicTable" headerView="110" id="108" customClass="SBTableView">
<rect key="frame" x="0.0" y="0.0" width="711" height="171"/>
<rect key="frame" x="0.0" y="0.0" width="711" height="156"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -336,7 +336,7 @@
</subviews>
</clipView>
<scroller key="horizontalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="109">
<rect key="frame" x="0.0" y="183" width="446" height="16"/>
<rect key="frame" x="0.0" y="184" width="446" height="15"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="111">
@@ -417,6 +417,13 @@
<action selector="addArtistToTracklist:" target="-2" id="8WC-C9-moT"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="S4t-oH-lEJ"/>
<menuItem title="Top Tracks" id="ZBC-Ib-PPY">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="getTopTracksForSelectedArtist:" target="-1" id="hnt-lV-CEC"/>
</connections>
</menuItem>
</items>
<point key="canvasLocation" x="89" y="-153"/>
</menu>