Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 72a330f
Author: Dennis Oberhoff <[email protected]>
Date:   Sun Oct 4 06:08:10 2020 +0200

    Removed Spotify Following

commit c64d772
Author: Dennis Oberhoff <[email protected]>
Date:   Sat Oct 3 20:39:23 2020 +0200

    Added German Translation. Improve

    - added german translation
    - improved Animation functions
    - Bugfixes and more

commit 5f289e4
Author: Dennis Oberhoff <[email protected]>
Date:   Sat Oct 3 16:58:34 2020 +0200

    Made for Big Sur

commit 29818d3
Author: Dennis Oberhoff <[email protected]>
Date:   Fri Oct 2 14:37:18 2020 +0200

    Added TextFields for delay

commit c725efc
Author: Dennis Oberhoff <[email protected]>
Date:   Fri Oct 2 13:59:44 2020 +0200

    More Layouting of Preferences

commit abef167
Author: Dennis Oberhoff <[email protected]>
Date:   Thu Oct 1 22:37:48 2020 +0200

    WIP New Preferences

commit f73475c
Author: Dennis Oberhoff <[email protected]>
Date:   Thu Oct 1 22:32:31 2020 +0200

    Preference Changes
  • Loading branch information
obrhoff committed Oct 4, 2020
1 parent 4661bff commit b72920d
Show file tree
Hide file tree
Showing 43 changed files with 1,507 additions and 1,095 deletions.
Binary file added Designs.sketch
Binary file not shown.
210 changes: 110 additions & 100 deletions MusaicFM.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions MusaicFM.xcodeproj/xcshareddata/xcschemes/MusaicFM.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
launchStyle = "1"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
Expand Down Expand Up @@ -77,12 +75,10 @@
</MacroExpansion>
<CommandLineArguments>
<CommandLineArgument
argument = "-background -window -module &quot;MusaicFM&quot;"
argument = "-window -module &quot;MusaicFM&quot;"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
10 changes: 0 additions & 10 deletions MusaicFM.xcworkspace/contents.xcworkspacedata

This file was deleted.

8 changes: 0 additions & 8 deletions MusaicFM.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

This file was deleted.

11 changes: 7 additions & 4 deletions MusaicFM/Artwork.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

@implementation Artwork

- (instancetype)initWithCoder:(NSCoder *)decoder {
- (instancetype)initWithCoder:(NSCoder*)decoder
{
self = [super init];
if (self) {
self.url = [decoder decodeObjectForKey:@"url"];
Expand All @@ -21,18 +22,20 @@ - (instancetype)initWithCoder:(NSCoder *)decoder {
return self;
}

- (void)encodeWithCoder:(NSCoder *)encoder {
- (void)encodeWithCoder:(NSCoder*)encoder
{
[encoder encodeObject:self.url forKey:@"url"];
[encoder encodeObject:self.artworkUrl forKey:@"artworkUrl"];
[encoder encodeObject:self.album forKey:@"album"];
[encoder encodeObject:self.artist forKey:@"artist"];
}

- (BOOL)isEqual:(id)object {
- (BOOL)isEqual:(id)object
{
if (![object isKindOfClass:[self class]]) {
return NO;
}
Artwork *compare = object;
Artwork* compare = object;
return [compare.artworkUrl isEqual:self.artworkUrl];
}

Expand Down
6 changes: 3 additions & 3 deletions MusaicFM/Constants.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "Constants.h"

NSString *const spotifyClientId = @"";
NSString *const spotifySecretId = @"";
NSString *const spotifyClientId = @"465423dcfdca4d8f8213181e9e5e3fa4";
NSString *const spotifySecretId = @"8330d56673864353ac187b5b29532f06";
NSString *const spotifyRedirectUrl = @"musaicfm://spotify";
NSString *const lastFmId = @"";
NSString *const lastFmId = @"b61d847786cc5f854207a51afd77b01f";
63 changes: 37 additions & 26 deletions MusaicFM/Factory.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,73 +11,84 @@

@implementation Factory

+ (NSURLRequest*)lastFmRequest:(NSArray*)queryItems
{
NSMutableArray* items = queryItems ? queryItems.mutableCopy : [NSMutableArray new];

+ (NSURLRequest *)lastFmRequest:(NSArray *)queryItems {
NSMutableArray *items = queryItems ? queryItems.mutableCopy : [NSMutableArray new];

[items addObjectsFromArray:@[[NSURLQueryItem queryItemWithName:@"api_key" value:lastFmId],
[NSURLQueryItem queryItemWithName:@"format" value:@"json"]]];

NSURLComponents *components = [NSURLComponents new];
[items addObjectsFromArray:@[ [NSURLQueryItem queryItemWithName:@"api_key" value:lastFmId],
[NSURLQueryItem queryItemWithName:@"format"
value:@"json"] ]];

NSURLComponents* components = [NSURLComponents new];
components.scheme = @"https";
components.host = @"ws.audioscrobbler.com";
components.path = @"/2.0/";
components.queryItems = items.copy;
return [NSURLRequest requestWithURL:components.URL];
}

+ (NSURLComponents *)spotifyAlbums {
NSURLComponents *components = [NSURLComponents new];
+ (NSURLComponents*)spotifyAlbums
{
NSURLComponents* components = [NSURLComponents new];
components.scheme = @"https";
components.host = @"api.spotify.com";
components.path = @"/v1/me/albums";
return components;
}

+ (NSURLComponents *)spotifyTracks {
NSURLComponents *components = [NSURLComponents new];
+ (NSURLComponents*)spotifyTracks
{
NSURLComponents* components = [NSURLComponents new];
components.scheme = @"https";
components.host = @"api.spotify.com";
components.path = @"/v1/me/tracks";
return components;
}

+ (NSURLComponents *)spotifyNewReleases {
NSURLComponents *components = [NSURLComponents new];
+ (NSURLComponents*)spotifyNewReleases
{
NSURLComponents* components = [NSURLComponents new];
components.scheme = @"https";
components.host = @"api.spotify.com";
components.path = @"/v1/browse/new-releases";
return components;
}

+ (NSURLComponents *)spotifyArtists {
NSURLComponents *components = [NSURLComponents new];
+ (NSURLComponents*)spotifyArtists
{
NSURLComponents* components = [NSURLComponents new];
components.scheme = @"https";
components.host = @"api.spotify.com";
components.path = @"/v1/me/following";
components.queryItems = @[[NSURLQueryItem queryItemWithName:@"type" value:@"artist"]];
components.queryItems = @[ [NSURLQueryItem queryItemWithName:@"type" value:@"artist"] ];
return components;
}

+ (NSURLComponents *)spotifyToken {
NSURLComponents *components = [NSURLComponents new];
+ (NSURLComponents*)spotifyToken
{
NSURLComponents* components = [NSURLComponents new];
components.scheme = @"https";
components.host = @"accounts.spotify.com";
components.path = @"/api/token";
return components;
}

+ (NSURLComponents *)spotifyAuthentification {
NSURLComponents *components = [NSURLComponents new];
+ (NSURLComponents*)spotifyAuthentification
{
NSURLComponents* components = [NSURLComponents new];
components.scheme = @"https";
components.host = @"accounts.spotify.com";
components.path = @"/authorize/";
components.queryItems = @[[NSURLQueryItem queryItemWithName:@"client_id" value:spotifyClientId],
[NSURLQueryItem queryItemWithName:@"response_type" value:@"code"],
[NSURLQueryItem queryItemWithName:@"scope" value:@"user-library-read"],
[NSURLQueryItem queryItemWithName:@"show_dialog" value:@"true"],
[NSURLQueryItem queryItemWithName:@"redirect_uri" value:spotifyRedirectUrl]];

components.queryItems = @[ [NSURLQueryItem queryItemWithName:@"client_id" value:spotifyClientId],
[NSURLQueryItem queryItemWithName:@"response_type"
value:@"code"],
[NSURLQueryItem queryItemWithName:@"scope"
value:@"user-library-read"],
[NSURLQueryItem queryItemWithName:@"show_dialog"
value:@"true"],
[NSURLQueryItem queryItemWithName:@"redirect_uri"
value:spotifyRedirectUrl] ];

return components;
}

Expand Down
5 changes: 0 additions & 5 deletions MusaicFM/Manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,10 @@ typedef NS_ENUM (NSUInteger, Weekly) {

@interface Manager : NSObject

@property (nonatomic, readwrite, strong)Preferences * preferences;


- (void)performSpotifyUserAlbums:(void (^)(NSArray *items)) completion andFailure:(void (^)(NSError *error))failure;
- (void)performSpotifyReleases:(void (^)(NSArray *items)) completion andFailure:(void (^)(NSError *error))failure;
- (void)performSpotifyLikedSongs:(void (^)(NSArray *items)) completion andFailure:(void (^)(NSError *error))failure;
- (void)performSpotifyArtists:(void (^)(NSArray *items)) completion andFailure:(void (^)(NSError *error))failure;
- (void)performSpotifyToken:(NSString *)code completionHandler:(dispatch_block_t)completion andFailure:(void (^)(NSError *error))failure;

- (void)performLastfmTag:(void (^)(NSArray *items)) completion andFailure:(void (^)(NSError *error))failure;
- (void)performLastfmWeekly:(void (^)(NSArray *items)) completion andFailure:(void (^)(NSError *error))failure;

Expand Down
Loading

0 comments on commit b72920d

Please sign in to comment.