From d423a3c350e713cabbad6f483618d9b60520fe72 Mon Sep 17 00:00:00 2001 From: Gianpiero Date: Fri, 1 Oct 2021 17:49:28 +0200 Subject: [PATCH 1/3] Added OSes support in the readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 46a7b5e..5265fab 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ ## Required - Swift 5.3 +- iOS 13 +- tvOS 13 +- watchOS 6 +- macOS 10.15 ## Installation From f0511e7e293f8a83f967d3ee46763250e9488f23 Mon Sep 17 00:00:00 2001 From: Gianpiero Date: Fri, 1 Oct 2021 17:55:56 +0200 Subject: [PATCH 2/3] Added film examples --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index 5265fab..713ebed 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,38 @@ LetterboxdAPI.shared.getLID(for: url) { result in } ``` +### Get a film providing the film ID +Just provide the film id, and get the response right away. +``` swift +LetterboxdAPI.shared.getFilm(withId: "id") { result in + switch result { + case .success(let film): + // film is of type Film + print(film.originalName) + + case .failure(let error): + // error may be of type LetterboxdAPIError + print(error) + } +} +``` + +### Get a film providing the film ID +Just provide the film id, and get the response right away. +``` swift +LetterboxdAPI.shared.getFilmAvailability(withId: "id") { result in + switch result { + case .success(let availability): + // availability is of type FilmAvailabilityResponse + print(film.items.displayName) + + case .failure(let error): + // error may be of type LetterboxdAPIError + print(error) + } +} +``` + ## Contributing - If you need help or you'd like to ask a general question, open an issue. From fe5af71dbbb1e8c73dc0e190e4edaba33f970a7c Mon Sep 17 00:00:00 2001 From: Gianpiero Date: Fri, 1 Oct 2021 18:35:57 +0200 Subject: [PATCH 3/3] Added members documentation --- README.md | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 713ebed..0a04671 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,51 @@ LetterboxdAPI.shared.getFilmAvailability(withId: "id") { result in switch result { case .success(let availability): // availability is of type FilmAvailabilityResponse - print(film.items.displayName) + print(film.items.map({ $0.displayName })) + + case .failure(let error): + // error may be of type LetterboxdAPIError + print(error) + } +} +``` + +### Get a member providing the member's ID +``` swift +LetterboxdAPI.shared.getMember(withId: "id") { result in + switch result { + case .success(let member): + // member is of type Member + print(member.username) + + case .failure(let error): + // error may be of type LetterboxdAPIError + print(error) + } +} +``` + +### Get a member's statistics providing the member's ID +``` swift +LetterboxdAPI.shared.getMemberStatistics(withId: "id") { result in + switch result { + case .success(let statistics): + // statistics is of type MemberStatistics + print(statistics.counts.watches) + + case .failure(let error): + // error may be of type LetterboxdAPIError + print(error) + } +} +``` +### Get a member's watchlist providing the member's ID +``` swift +LetterboxdAPI.shared.getMemberWatchlist(withId: "id") { result in + switch result { + case .success(let watchlist): + // watchlist is of type FilmResponse + print(watchlist.items.map({ $0.name })) case .failure(let error): // error may be of type LetterboxdAPIError