Skip to content

Commit

Permalink
Merge pull request #30 from stephanebruckert/new-model-path
Browse files Browse the repository at this point in the history
Shazam 1.2.0 compatibility
  • Loading branch information
stephanebruckert authored Nov 28, 2016
2 parents 8ce66c0 + b2de0b5 commit 0b24e26
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 58 deletions.
50 changes: 32 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ It works together with the [Shazam Mac App](https://itunes.apple.com/us/app/shaz

### Requirements

- OS X Yosemite/El Capitan
- Shazam 1.1.2 (get it from the [App Store](https://itunes.apple.com/en/app/shazam/id897118787?mt=12))
- macOS Yosemite/El Capitan/Sierra
- Shazam 1.2.0 (get it from the [App Store](https://itunes.apple.com/gb/app/shazam/id897118787?mt=12))

### Installation

Expand All @@ -23,30 +23,44 @@ It works together with the [Shazam Mac App](https://itunes.apple.com/us/app/shaz

## CHANGELOG

#### v1.2 (2016/01/30)
#### 1.2.1 (2016/11/28)

- Enhanced the scrobbler to detect whether the user is currently playing a song. Shazam tags won't be scrobbled anymore if you are "now playing" from another player ([issue #22](https://github.com/stephanebruckert/ShazamScrobbler/issues/22)),
- Support for Shazam 1.1.2,
- Removed "now playing" feature to be able to resolve [issue #22](https://github.com/stephanebruckert/ShazamScrobbler/issues/22).
##### Changed
- Support for Shazam 1.2.0
- Confirmed compatibility with MacOS Sierra

#### v1.1.1 (2015/10/21)
#### 1.2 (2016/01/30)

- Fixed a minor issue causing the queued songs to not scrobble if the app has been restarted.
- Fixed a minor issue causing the time interval between two songs to be negative.
##### Added
- Enhanced the scrobbler to detect whether the user is currently playing a song. Shazam tags won't be scrobbled anymore if you are "now playing" from another player ([issue #22](https://github.com/stephanebruckert/ShazamScrobbler/issues/22))
- Support for Shazam 1.1.2

#### v1.1 (2015/10/09)
##### Removed
- Removed "now playing" feature to be able to resolve [issue #22](https://github.com/stephanebruckert/ShazamScrobbler/issues/22)

- New app logo.
- Added a feature to send "now playing" request and only scrobble songs if played more than 30 seconds ([issue #16](https://github.com/stephanebruckert/ShazamScrobbler/issues/16)).
- Confirmed compatibility with El Capitan.
#### 1.1.1 (2015/10/21)

#### v1.0.1 (2015/09/30)
##### Fixed
- Fixed a minor issue causing the queued songs to not scrobble if the app has been restarted
- Fixed a minor issue causing the time interval between two songs to be negative

- Fixed a major issue making it impossible for some users to connect ([issue #13](https://github.com/stephanebruckert/ShazamScrobbler/issues/13)).
#### 1.1 (2015/10/09)

#### v1 (2015/09/28)
##### Added
- New app logo
- Added a feature to send "now playing" request and only scrobble songs if played more than 30 seconds ([issue #16](https://github.com/stephanebruckert/ShazamScrobbler/issues/16))
- Confirmed compatibility with OS X El Capitan

- Support for Shazam 1.1.1.
#### 1.0.1 (2015/09/30)

##### Fixed

- Fixed a major issue making it impossible for some users to connect ([issue #13](https://github.com/stephanebruckert/ShazamScrobbler/issues/13))

#### 1 (2015/09/28)

##### Changed
- Support for Shazam 1.1.1

## Thanks

Expand All @@ -57,7 +71,7 @@ It works together with the [Shazam Mac App](https://itunes.apple.com/us/app/shaz
- [LaunchAtLoginController](https://github.com/Mozketo/LaunchAtLoginController) by [Ben Clark-Robinson](https://github.com/Mozketo)

Feel free to contribute!

## Licence

MIT
38 changes: 19 additions & 19 deletions ShazamScrobbler.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@

/* Begin PBXBuildFile section */
88057F99C098F9FCF7662C09 /* libPods-ShazamScrobbler.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F1D54F44336C30EFCD2B7952 /* libPods-ShazamScrobbler.a */; };
F44FC8F61BC72CDE005B688A /* NowPlayingOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F44FC8F51BC72CDE005B688A /* NowPlayingOperation.m */; settings = {ASSET_TAGS = (); }; };
F46159EB1BB343DA00AF80BC /* ShazamScrobblerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F46159EA1BB343DA00AF80BC /* ShazamScrobblerTests.m */; settings = {ASSET_TAGS = (); }; };
F44FC8F61BC72CDE005B688A /* NowPlayingOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F44FC8F51BC72CDE005B688A /* NowPlayingOperation.m */; };
F46159EB1BB343DA00AF80BC /* ShazamScrobblerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F46159EA1BB343DA00AF80BC /* ShazamScrobblerTests.m */; };
F46C01081BB34811007E4265 /* LoginViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F47C95F21BB33F67004B1254 /* LoginViewController.xib */; };
F47C95EF1BB33F5E004B1254 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F47C95EE1BB33F5E004B1254 /* AppDelegate.m */; settings = {ASSET_TAGS = (); }; };
F47C95F31BB33F67004B1254 /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F47C95F11BB33F67004B1254 /* LoginViewController.m */; settings = {ASSET_TAGS = (); }; };
F47C95F71BB33F75004B1254 /* MenuController.m in Sources */ = {isa = PBXBuildFile; fileRef = F47C95F61BB33F75004B1254 /* MenuController.m */; settings = {ASSET_TAGS = (); }; };
F47C95FA1BB33F85004B1254 /* ShazamController.m in Sources */ = {isa = PBXBuildFile; fileRef = F47C95F91BB33F85004B1254 /* ShazamController.m */; settings = {ASSET_TAGS = (); }; };
F47C95FD1BB33F8A004B1254 /* ShazamConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = F47C95FC1BB33F8A004B1254 /* ShazamConstants.m */; settings = {ASSET_TAGS = (); }; };
F47C96021BB33F95004B1254 /* LastFmConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = F47C95FF1BB33F95004B1254 /* LastFmConstants.m */; settings = {ASSET_TAGS = (); }; };
F47C96031BB33F95004B1254 /* LastFmController.m in Sources */ = {isa = PBXBuildFile; fileRef = F47C96011BB33F95004B1254 /* LastFmController.m */; settings = {ASSET_TAGS = (); }; };
F47C96061BB33FA4004B1254 /* Song.m in Sources */ = {isa = PBXBuildFile; fileRef = F47C96051BB33FA4004B1254 /* Song.m */; settings = {ASSET_TAGS = (); }; };
F47C96081BB33FAD004B1254 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F47C96071BB33FAD004B1254 /* Images.xcassets */; settings = {ASSET_TAGS = (); }; };
F47C960D1BB33FC1004B1254 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F47C960C1BB33FC1004B1254 /* main.m */; settings = {ASSET_TAGS = (); }; };
F47C96101BB3415B004B1254 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F47C960E1BB3415B004B1254 /* MainMenu.xib */; settings = {ASSET_TAGS = (); }; };
F47C96151BB34171004B1254 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = F47C96111BB34171004B1254 /* Credits.rtf */; settings = {ASSET_TAGS = (); }; };
F47C96161BB34171004B1254 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F47C96131BB34171004B1254 /* InfoPlist.strings */; settings = {ASSET_TAGS = (); }; };
F47C95EF1BB33F5E004B1254 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F47C95EE1BB33F5E004B1254 /* AppDelegate.m */; };
F47C95F31BB33F67004B1254 /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F47C95F11BB33F67004B1254 /* LoginViewController.m */; };
F47C95F71BB33F75004B1254 /* MenuController.m in Sources */ = {isa = PBXBuildFile; fileRef = F47C95F61BB33F75004B1254 /* MenuController.m */; };
F47C95FA1BB33F85004B1254 /* ShazamController.m in Sources */ = {isa = PBXBuildFile; fileRef = F47C95F91BB33F85004B1254 /* ShazamController.m */; };
F47C95FD1BB33F8A004B1254 /* ShazamConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = F47C95FC1BB33F8A004B1254 /* ShazamConstants.m */; };
F47C96021BB33F95004B1254 /* LastFmConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = F47C95FF1BB33F95004B1254 /* LastFmConstants.m */; };
F47C96031BB33F95004B1254 /* LastFmController.m in Sources */ = {isa = PBXBuildFile; fileRef = F47C96011BB33F95004B1254 /* LastFmController.m */; };
F47C96061BB33FA4004B1254 /* Song.m in Sources */ = {isa = PBXBuildFile; fileRef = F47C96051BB33FA4004B1254 /* Song.m */; };
F47C96081BB33FAD004B1254 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F47C96071BB33FAD004B1254 /* Images.xcassets */; };
F47C960D1BB33FC1004B1254 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F47C960C1BB33FC1004B1254 /* main.m */; };
F47C96101BB3415B004B1254 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F47C960E1BB3415B004B1254 /* MainMenu.xib */; };
F47C96151BB34171004B1254 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = F47C96111BB34171004B1254 /* Credits.rtf */; };
F47C96161BB34171004B1254 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F47C96131BB34171004B1254 /* InfoPlist.strings */; };
F48D994F19C8B0A80062A5FA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F48D994E19C8B0A80062A5FA /* Cocoa.framework */; };
F48D996E19C8B0A90062A5FA /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F48D996D19C8B0A90062A5FA /* XCTest.framework */; };
F48D996F19C8B0A90062A5FA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F48D994E19C8B0A80062A5FA /* Cocoa.framework */; };
F48D997719C8B0A90062A5FA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F48D997519C8B0A90062A5FA /* InfoPlist.strings */; };
F4E447771BB5C89300ABD578 /* MenuConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = F4E447761BB5C89300ABD578 /* MenuConstants.m */; settings = {ASSET_TAGS = (); }; };
F4E4477B1BB5EDBC00ABD578 /* AboutWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = F4E447791BB5EDBC00ABD578 /* AboutWindowController.m */; settings = {ASSET_TAGS = (); }; };
F4E4477C1BB5EDBC00ABD578 /* AboutWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F4E4477A1BB5EDBC00ABD578 /* AboutWindowController.xib */; settings = {ASSET_TAGS = (); }; };
F4E447811BB600D700ABD578 /* LaunchAtLoginController.m in Sources */ = {isa = PBXBuildFile; fileRef = F4E447801BB600D700ABD578 /* LaunchAtLoginController.m */; settings = {ASSET_TAGS = (); }; };
F4E447771BB5C89300ABD578 /* MenuConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = F4E447761BB5C89300ABD578 /* MenuConstants.m */; };
F4E4477B1BB5EDBC00ABD578 /* AboutWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = F4E447791BB5EDBC00ABD578 /* AboutWindowController.m */; };
F4E4477C1BB5EDBC00ABD578 /* AboutWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F4E4477A1BB5EDBC00ABD578 /* AboutWindowController.xib */; };
F4E447811BB600D700ABD578 /* LaunchAtLoginController.m in Sources */ = {isa = PBXBuildFile; fileRef = F4E447801BB600D700ABD578 /* LaunchAtLoginController.m */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down
16 changes: 12 additions & 4 deletions ShazamScrobbler/AboutWindowController.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9531" systemVersion="15D21" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="16B2555" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="AboutWindowController">
Expand All @@ -22,10 +23,12 @@
<subviews>
<colorWell fixedFrame="YES" bordered="NO" continuous="NO" enabled="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AqQ-rN-3Xt">
<rect key="frame" x="-8" y="37" width="626" height="270"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<color key="color" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</colorWell>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ACy-M7-Nhr">
<rect key="frame" x="100" y="204" width="398" height="47"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="ShazamScrobbler for OS X" id="KYO-GS-EYy">
<font key="font" size="27" name=".HelveticaNeueDeskInterface-Bold"/>
<color key="textColor" name="selectedTextColor" catalog="System" colorSpace="catalog"/>
Expand All @@ -34,14 +37,16 @@
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="SdM-5G-yCq">
<rect key="frame" x="189" y="172" width="277" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Scrobbler version 1.2.0 for Shazam 1.1.2" id="gJt-wU-JGY">
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Scrobbler version 1.2.1 for Shazam 1.2.0" id="gJt-wU-JGY">
<font key="font" size="13" name="Helvetica"/>
<color key="textColor" name="controlShadowColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="wwk-17-imr">
<rect key="frame" x="189" y="102" width="287" height="60"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="justified" title="ShazamScrobbler scrobbles songs detected by Shazam for Mac OS X to your Last.fm music profile." id="KqW-mL-6Km">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
Expand All @@ -50,6 +55,7 @@
</textField>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="BB1-Je-vl5">
<rect key="frame" x="440" y="2" width="82" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="GitHub" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="6JH-a5-qET">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
Expand All @@ -60,6 +66,7 @@
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7jJ-4i-y2o">
<rect key="frame" x="136" y="53" width="277" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Copyright © 2016 Stéphane Bruckert. All rights reserved." id="J5A-lt-eDn">
<font key="font" size="10" name=".HelveticaNeueDeskInterface-Regular"/>
<color key="textColor" name="gridColor" catalog="System" colorSpace="catalog"/>
Expand All @@ -68,6 +75,7 @@
</textField>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="rl2-OG-fUb">
<rect key="frame" x="41" y="82" width="121" height="121"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="logo" id="Psa-EX-LhD"/>
</imageView>
</subviews>
Expand Down
4 changes: 2 additions & 2 deletions ShazamScrobbler/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification
_menu = [[MenuController alloc] init];
[LastFmController init];
if ([ShazamController init]) {
[ShazamController watch:[ShazamConstants getJournalPath]];
[ShazamController watch:[ShazamConstants getSqliteWalPath]];
[ShazamController findNewTags];
} else {
[self alert];
Expand All @@ -38,7 +38,7 @@ - (void) loadView {
- (void) alert {
NSAlert* msgBox = [[NSAlert alloc] init];
[msgBox setAlertStyle:NSCriticalAlertStyle];
[msgBox setMessageText: @"The scrobbler could not find the Shazam library.\n\nMake sure of two things:\n\t- you are using Shazam 1.1.1,\n\t- Shazam found at least one song.\n\nRestart the scrobbler when that's done."];
[msgBox setMessageText: @"The scrobbler could not find the Shazam library.\n\nMake sure of two things:\n\t- you are using Shazam 1.2.0,\n\t- Shazam found at least one song.\n\nRestart the scrobbler when that's done."];
[msgBox addButtonWithTitle: @"OK"];
[msgBox runModal];
}
Expand Down
2 changes: 1 addition & 1 deletion ShazamScrobbler/LastFmConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ @implementation LastFmConstants : NSObject
NSString* const SECRET = @"973e0ce961320c989f83a97bd2bdb132";
NSInteger const PLAYTIME = 45;

@end
@end
2 changes: 1 addition & 1 deletion ShazamScrobbler/LoginViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ - (void)loginSuccess {

[_usernameField setEnabled:false];
[_passwordField setEnabled:false];
[_passwordField setStringValue:@"amzingpwd"];
[_passwordField setStringValue:@""];
_connectButton.enabled = true;
[self.connectButton setTarget:self];
[self.connectButton setTitle:@"Disconnect"];
Expand Down
2 changes: 0 additions & 2 deletions ShazamScrobbler/ShazamConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
extern NSString* const PATH;
extern NSString* const FILENAME;
extern NSString* const EXTENSION;
extern NSString* const JOURNAL;

+ (NSString*)getSqlitePath;
+ (NSString*)getSqliteWalPath;
+ (NSString*)getJournalPath;

@end

Expand Down
9 changes: 2 additions & 7 deletions ShazamScrobbler/ShazamConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@

@implementation ShazamConstants : NSObject

NSString* const PATH = @"~/Library/Group Containers/4GWDBCF5A4.group.com.shazam/com.shazam.mac.Shazam/";
NSString* const PATH = @"~/Library/Containers/com.shazam.mac.Shazam/Data/Documents";
NSString* const FILENAME = @"ShazamDataModel";
NSString* const EXTENSION = @"sqlite";
NSString* const EXTENSIONWAL = @"sqlite-wal";
NSString* const JOURNAL = @"Journal";

+ (NSString*)getSqlitePath {
return [[[[PATH stringByExpandingTildeInPath] stringByAppendingString:@"/"] stringByAppendingString:FILENAME] stringByAppendingPathExtension:EXTENSION];
Expand All @@ -25,9 +24,5 @@ + (NSString*)getSqliteWalPath {
return [[[[PATH stringByExpandingTildeInPath] stringByAppendingString:@"/"] stringByAppendingString:FILENAME] stringByAppendingPathExtension:EXTENSIONWAL];
}

+ (NSString*)getJournalPath {
return [[[PATH stringByExpandingTildeInPath] stringByAppendingString:@"/"] stringByAppendingString:JOURNAL];
}


@end
@end
2 changes: 1 addition & 1 deletion ShazamScrobbler/ShazamController.m
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@ + (Song*)createSongFromTag:(NSInteger)tag {
return nil;
}

@end
@end
Loading

0 comments on commit 0b24e26

Please sign in to comment.