jrtibbetts / swiftdiscogs Goto Github PK
View Code? Open in Web Editor NEWA Swift client for the Discogs REST API.
License: MIT License
A Swift client for the Discogs REST API.
License: MIT License
Discogs doesn't give me an easy way to retrieve these as quickly as I want to for the artist search results, so drop it. While I'm at it, add an image icon.
I had a placeholder in there, but it was causing runtime crashes for some unknown reason. I want to revisit this at some point.
Discussions on the Discogs API forums suggest that it's because the requests are unauthenticated, but I know that that's not the case.
It's just so much easier than Carthage or trying to get Swift Package Manager to do what it's supposed to do.
To take advantage of the OAuth1JSONClient
superclass.
Since there's no API for requesting a full collection database dump and then ingesting it, I think we just have to retrieve everything one page at a time.
Right now, the search bar searches against all of Discogs.
The Discogs API doesn't current have a song or track object, so create one. (The one in the Immediate project will probably work.)
It needs a travis.yml
file to tell Travis to compile using Xcode 9.2.
The sorting-related fields don't seem to be exposed on MPMediaItem
. How can that information be accessed another way, short of doing a parallel search for the artists on MusicBrainz?
Invalidates #48.
This is most prominent in the MasterReleaseViewController
.
Factor all Discogs client interactions into a coordinator class. (Coordinators aren't all bad, I guess.)
I plan to subclass UILabel
with a DiscogsLabel
that finds Discogs references in plain text, converts all of it to attributed text, and adds a tap gesture for jumping to the referred-to scene.
The regular MPMediaQuery
and other media classes aren't accessible when the app runs in the simulator or in unit tests, so create a mock one that can be used for those cases.
May as well.
And make it better than Spotify's or (๐คฎ) iTunes.
Things like the CollectionAndTableModel, etc.
Duh, Jason.
I should also keep track of which Discogs artist the user selected so that the disambiguation doesn't have to be displayed the next time.
When playing (or about to play) a track, I want to select the media source.
All available media sources should be listed.
If a source requires an account, it should have a way to sign in and out of the service, and should show the user's current signed-in status.
Sources should be reorderable according to the user's preference.
About a week ago, simulator calls to Discogs started failing with
Authorized GET for /oauth/identity; headers: ["User-Agent": "Mozilla/5.0; SwiftDiscogsApp (https://github.com/jrtibbetts/SwiftDiscogs)"]; params: [:]
"/oauth/identity" ["User-Agent": "Mozilla/5.0; SwiftDiscogsApp (https://github.com/jrtibbetts/SwiftDiscogs)"] [:]
2019-04-21 10:59:49.849680-0400 SwiftDiscogsApp[15261:3967886] CredStore - performQuery - Error copying matching creds. Error=-25300, query={
class = inet;
"m_Limit" = "m_LimitAll";
ptcl = htps;
"r_Attributes" = 1;
sdmn = "http://api.discogs.com";
srvr = "api.discogs.com";
sync = syna;
}
Couldn't sign in requestError[Error Domain=NSURLErrorDomain Code=401 "" UserInfo={OAuthSwiftError.response.data=<7b226d65 73736167 65223a20 22596f75 206d7573 74206175 7468656e 74696361 74652074 6f206163 63657373 20746869 73207265 736f7572 63652e22 7d>, Response-Headers={
"Access-Control-Allow-Headers" = "Content-Type, authorization, User-Agent";
"Access-Control-Allow-Methods" = "HEAD,OPTIONS,GET,OPTIONS";
"Access-Control-Allow-Origin" = "*";
"Access-Control-Expose-Headers" = Location;
"Content-Length" = 61;
"Content-Type" = "application/json";
Date = "Sun, 21 Apr 2019 14:59:50 GMT";
Server = "nginx/1.15.6";
"Strict-Transport-Security" = "max-age=16000000";
"Www-Authenticate" = "OAuth realm=\"http://api.discogs.com\"";
"X-Content-Type-Options" = nosniff;
"X-Discogs-Media-Type" = "discogs.v2";
"X-Discogs-Ratelimit" = 60;
"X-Discogs-Ratelimit-Remaining" = 58;
"X-Discogs-Ratelimit-Used" = 2;
"X-Frame-Options" = SAMEORIGIN;
"X-XSS-Protection" = "1; mode=block";
}, NSErrorFailingURLKey=https://api.discogs.com/oauth/identity, NSLocalizedDescription=, Response-Body={"message": "You must authenticate to access this resource."}, OAuthSwiftError.response=<NSHTTPURLResponse: 0x600000339d20> { URL: https://api.discogs.com/oauth/identity } { Status Code: 401, Headers {
"Access-Control-Allow-Headers" = (
"Content-Type, authorization, User-Agent"
);
"Access-Control-Allow-Methods" = (
"HEAD,OPTIONS,GET,OPTIONS"
);
"Access-Control-Allow-Origin" = (
"*"
);
"Access-Control-Expose-Headers" = (
Location
);
"Content-Length" = (
61
);
"Content-Type" = (
"application/json"
);
Date = (
"Sun, 21 Apr 2019 14:59:50 GMT"
);
Server = (
"nginx/1.15.6"
);
"Strict-Transport-Security" = (
"max-age=16000000"
);
"Www-Authenticate" = (
"OAuth realm=\"http://api.discogs.com\""
);
"X-Content-Type-Options" = (
nosniff
);
"X-Discogs-Media-Type" = (
"discogs.v2"
);
"X-Discogs-Ratelimit" = (
60
);
"X-Discogs-Ratelimit-Remaining" = (
58
);
"X-Discogs-Ratelimit-Used" = (
2
);
"X-Frame-Options" = (
SAMEORIGIN
);
"X-XSS-Protection" = (
"1; mode=block"
);
} }}]
I looked into it briefly, but couldn't find any reason. It seems to have happened after I made the switch to specifying the Discogs secret key and ID in environment variables instead of in a plist, but I know that it did work for some time after that switch.
Get all user-facing strings ready for localization. Use SwiftGen to make it easy to use.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.