Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Update MAL list service to use SSO for sign-in.
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperMarcus committed Jul 11, 2020
1 parent 72fc6a5 commit db587b5
Show file tree
Hide file tree
Showing 20 changed files with 549 additions and 74 deletions.
53 changes: 26 additions & 27 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,36 @@ GEM
public_suffix (>= 2.0.2, < 5.0)
atomos (0.1.3)
aws-eventstream (1.1.0)
aws-partitions (1.326.0)
aws-sdk-core (3.98.0)
aws-partitions (1.341.0)
aws-sdk-core (3.103.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.33.0)
aws-sdk-core (~> 3, >= 3.71.0)
aws-sdk-kms (1.36.0)
aws-sdk-core (~> 3, >= 3.99.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.67.1)
aws-sdk-core (~> 3, >= 3.96.1)
aws-sdk-s3 (1.74.0)
aws-sdk-core (~> 3, >= 3.102.1)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.1.4)
aws-eventstream (~> 1.0, >= 1.0.2)
aws-sigv4 (1.2.1)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.3)
claide (1.0.3)
colored (1.2)
colored2 (3.1.2)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
declarative (0.0.10)
declarative (0.0.20)
declarative-option (0.1.0)
digest-crc (0.5.1)
digest-crc (0.6.1)
rake (~> 13.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.5)
emoji_regex (1.0.1)
excon (0.73.0)
emoji_regex (3.0.0)
excon (0.75.0)
faraday (1.0.1)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
Expand All @@ -43,16 +44,16 @@ GEM
faraday_middleware (1.0.0)
faraday (~> 1.0)
fastimage (2.1.7)
fastlane (2.149.1)
fastlane (2.151.2)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
aws-sdk-s3 (~> 1.0)
babosa (>= 1.0.2, < 2.0.0)
babosa (>= 1.0.3, < 2.0.0)
bundler (>= 1.12.0, < 3.0.0)
colored
commander-fastlane (>= 4.4.6, < 5.0.0)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 2.0)
emoji_regex (>= 0.1, < 4.0)
excon (>= 0.71.0, < 1.0.0)
faraday (>= 0.17, < 2.0)
faraday-cookie_jar (~> 0.0.6)
Expand All @@ -63,13 +64,11 @@ GEM
google-cloud-storage (>= 1.15.0, < 2.0.0)
highline (>= 1.7.2, < 2.0.0)
json (< 3.0.0)
jwt (~> 2.1.0)
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
multi_xml (~> 0.5)
multipart-post (~> 2.0.0)
plist (>= 3.1.0, < 4.0.0)
public_suffix (~> 2.0.0)
rubyzip (>= 1.3.0, < 2.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.3)
simctl (~> 1.6.3)
slack-notifier (>= 2.0.0, < 3.0.0)
Expand Down Expand Up @@ -104,7 +103,7 @@ GEM
google-cloud-core (~> 1.2)
googleauth (~> 0.9)
mini_mime (~> 1.0)
googleauth (0.12.0)
googleauth (0.13.0)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
Expand All @@ -116,26 +115,26 @@ GEM
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.4.0)
json (2.3.0)
jwt (2.1.0)
json (2.3.1)
jwt (2.2.1)
memoist (0.16.2)
mini_magick (4.10.1)
mini_mime (1.0.2)
multi_json (1.14.1)
multi_xml (0.6.0)
multi_json (1.15.0)
multipart-post (2.0.0)
nanaimo (0.2.6)
naturally (2.2.0)
os (1.1.0)
plist (3.5.0)
public_suffix (2.0.5)
public_suffix (4.0.5)
rake (13.0.1)
representable (3.0.4)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rouge (2.0.7)
rubyzip (1.3.0)
rubyzip (2.3.0)
security (0.1.3)
signet (0.14.0)
addressable (~> 2.3)
Expand All @@ -159,7 +158,7 @@ GEM
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
word_wrap (1.0.0)
xcodeproj (1.16.0)
xcodeproj (1.17.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
Expand Down
16 changes: 16 additions & 0 deletions NineAnimator.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
2C35C962227DFB4500D469E6 /* AnimeScheduleCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C35C961227DFB4500D469E6 /* AnimeScheduleCollectionViewController.swift */; };
2C35C966227E94B900D469E6 /* CalendarAnimeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C35C965227E94B900D469E6 /* CalendarAnimeCell.swift */; };
2C35C968227F223700D469E6 /* CalendarHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C35C967227F223700D469E6 /* CalendarHeaderView.swift */; };
2C371C8124B9536600EBC5D1 /* UInt8Sequence+HexConversion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C371C8024B9536600EBC5D1 /* UInt8Sequence+HexConversion.swift */; };
2C3BBAAC2217635000F1C77B /* Dictionary+KeyPathAccess.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C3BBAAB2217635000F1C77B /* Dictionary+KeyPathAccess.swift */; };
2C3BBAAF22183BCF00F1C77B /* ListingService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C3BBAAE22183BCF00F1C77B /* ListingService.swift */; };
2C3D7BF62210825B0045D648 /* NineAnime+Reachability.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C3D7BF52210825B0045D648 /* NineAnime+Reachability.swift */; };
Expand Down Expand Up @@ -216,6 +217,9 @@
2C7FD5822359060800E37A89 /* MinFilledFlowLayoutHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C7FD5812359060800E37A89 /* MinFilledFlowLayoutHelper.swift */; };
2C7FD584235909B300E37A89 /* ClosedRange+Clamp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C7FD583235909B300E37A89 /* ClosedRange+Clamp.swift */; };
2C8374EA24AF808A0009F8D7 /* SettingsRichPresenceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C8374E924AF808A0009F8D7 /* SettingsRichPresenceController.swift */; };
2C84D8E324B4ACCD00E495A8 /* EndpointRelativeRequestManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C84D8E224B4ACCD00E495A8 /* EndpointRelativeRequestManager.swift */; };
2C84D8E524B4BF0000E495A8 /* ServiceDescriptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C84D8E424B4BF0000E495A8 /* ServiceDescriptor.swift */; };
2C84D8E724B4D25900E495A8 /* NineAnimatorCloud+Requests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C84D8E624B4D25900E495A8 /* NineAnimatorCloud+Requests.swift */; };
2C8519A722CC8DBD00EEF3AC /* Kissanime.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C8519A622CC8DBD00EEF3AC /* Kissanime.swift */; };
2C8519A922CC8DD900EEF3AC /* Kissanime+RequestModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C8519A822CC8DD900EEF3AC /* Kissanime+RequestModifier.swift */; };
2C8519AB22CC919800EEF3AC /* Kissanime+Featured.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C8519AA22CC919800EEF3AC /* Kissanime+Featured.swift */; };
Expand Down Expand Up @@ -514,6 +518,7 @@
2C35C961227DFB4500D469E6 /* AnimeScheduleCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimeScheduleCollectionViewController.swift; sourceTree = "<group>"; };
2C35C965227E94B900D469E6 /* CalendarAnimeCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarAnimeCell.swift; sourceTree = "<group>"; };
2C35C967227F223700D469E6 /* CalendarHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarHeaderView.swift; sourceTree = "<group>"; };
2C371C8024B9536600EBC5D1 /* UInt8Sequence+HexConversion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UInt8Sequence+HexConversion.swift"; sourceTree = "<group>"; };
2C3BBAAB2217635000F1C77B /* Dictionary+KeyPathAccess.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Dictionary+KeyPathAccess.swift"; sourceTree = "<group>"; };
2C3BBAAE22183BCF00F1C77B /* ListingService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListingService.swift; sourceTree = "<group>"; };
2C3D7BF52210825B0045D648 /* NineAnime+Reachability.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NineAnime+Reachability.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -655,6 +660,9 @@
2C7FD5812359060800E37A89 /* MinFilledFlowLayoutHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MinFilledFlowLayoutHelper.swift; sourceTree = "<group>"; };
2C7FD583235909B300E37A89 /* ClosedRange+Clamp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ClosedRange+Clamp.swift"; sourceTree = "<group>"; };
2C8374E924AF808A0009F8D7 /* SettingsRichPresenceController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsRichPresenceController.swift; sourceTree = "<group>"; };
2C84D8E224B4ACCD00E495A8 /* EndpointRelativeRequestManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EndpointRelativeRequestManager.swift; sourceTree = "<group>"; };
2C84D8E424B4BF0000E495A8 /* ServiceDescriptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServiceDescriptor.swift; sourceTree = "<group>"; };
2C84D8E624B4D25900E495A8 /* NineAnimatorCloud+Requests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NineAnimatorCloud+Requests.swift"; sourceTree = "<group>"; };
2C85031E24271F610038F881 /* CONTRIBUTING.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CONTRIBUTING.md; sourceTree = "<group>"; };
2C8519A622CC8DBD00EEF3AC /* Kissanime.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Kissanime.swift; sourceTree = "<group>"; };
2C8519A822CC8DD900EEF3AC /* Kissanime+RequestModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Kissanime+RequestModifier.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1172,6 +1180,8 @@
children = (
2C46FC8B232030E500D4206D /* LinkSerialization.swift */,
2CDE858723226B2300F1A61A /* NineAnimatorCloud.swift */,
2C84D8E424B4BF0000E495A8 /* ServiceDescriptor.swift */,
2C84D8E624B4D25900E495A8 /* NineAnimatorCloud+Requests.swift */,
);
path = NineAnimatorCloud;
sourceTree = "<group>";
Expand Down Expand Up @@ -1368,6 +1378,7 @@
2C6C47352394491F001E723C /* AtomicProperty.swift */,
2CCBC5BF24041E2C0013C4FE /* Alamofire+Legacy.swift */,
2C852B4024632454000F2C85 /* QueryItems+ExpressibleByDictionaryLiteral.swift */,
2C371C8024B9536600EBC5D1 /* UInt8Sequence+HexConversion.swift */,
);
path = Utilities;
sourceTree = "<group>";
Expand Down Expand Up @@ -1502,6 +1513,7 @@
2C563B312248108600A9CCB8 /* RequestManager+CloudflareWAFResolver.swift */,
2C055AF424A93E1F00FCAC25 /* RequestManager+QueryEncoding.swift */,
2C055AF224A9298900FCAC25 /* SourceRequestManager.swift */,
2C84D8E224B4ACCD00E495A8 /* EndpointRelativeRequestManager.swift */,
);
path = Networking;
sourceTree = "<group>";
Expand Down Expand Up @@ -2352,6 +2364,7 @@
2C23AE3E2229CFBD00512150 /* MyAnimeList+User.swift in Sources */,
2C71DEC5226E0610004F3AC3 /* ServerSelectionView.swift in Sources */,
2CA1DD5C21E2B404009241CB /* HomeController.swift in Sources */,
2C371C8124B9536600EBC5D1 /* UInt8Sequence+HexConversion.swift in Sources */,
2CE1F84822EEB9E6005448FF /* VideoProviderRegistry.swift in Sources */,
2C90C6A6236F98C600C18620 /* LibraryTrackingReferenceCell.swift in Sources */,
2C1C71792218EFEB00760A69 /* Anilist+Collections.swift in Sources */,
Expand Down Expand Up @@ -2386,6 +2399,7 @@
2C684BD2229066AD00E1BA35 /* AnimePahe+Anime.swift in Sources */,
2C6CF254221CA1C20009D554 /* InformationSceneCharactersTableViewCell.swift in Sources */,
2C480015237061EC00ADB03F /* LibraryRecentsCategoryController.swift in Sources */,
2C84D8E724B4D25900E495A8 /* NineAnimatorCloud+Requests.swift in Sources */,
2C6A390423A0179700FC00A9 /* FourAnime+Featured.swift in Sources */,
2C8519A922CC8DD900EEF3AC /* Kissanime+RequestModifier.swift in Sources */,
2C055AFC24AAAF9300FCAC25 /* WonderfulSubs+LinkRetrival.swift in Sources */,
Expand Down Expand Up @@ -2499,6 +2513,7 @@
2C0E7558226241A500DF3AC4 /* QuickActionsTableViewCell.swift in Sources */,
2C42577D2325365100FCCCCE /* Simkl+User.swift in Sources */,
2C4ABC7D21B6B3F2009B4D47 /* FeaturedAnimeTableViewCell.swift in Sources */,
2C84D8E524B4BF0000E495A8 /* ServiceDescriptor.swift in Sources */,
2C1C7171221854CA00760A69 /* BaseListingService.swift in Sources */,
2CDA17A522065456009543F9 /* OfflineEpisodeTableViewCell.swift in Sources */,
2C9C450221CD56B0004C8F0C /* Notifications.swift in Sources */,
Expand Down Expand Up @@ -2573,6 +2588,7 @@
2C23AE3C2229B17A00512150 /* MyAnimeList+Mutation.swift in Sources */,
2C1C7189221A6C8300760A69 /* ListingCollectionEntryTableViewCell.swift in Sources */,
2C1C71832219975A00760A69 /* Promise+Hashable.swift in Sources */,
2C84D8E324B4ACCD00E495A8 /* EndpointRelativeRequestManager.swift in Sources */,
2C1C716C221845A800760A69 /* ContentListingLoadingTableViewCell.swift in Sources */,
6520A111246B6F4C001D9634 /* StreamTapeParser.swift in Sources */,
2C9325C424ACDE34001E3708 /* DiscordPresenceController.swift in Sources */,
Expand Down
5 changes: 3 additions & 2 deletions NineAnimator/Base.lproj/Settings.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@ Clear Shortcuts and Spotlight Items will delete all NineAnimator shortcuts and S
<outlet property="dynamicAppearanceSwitchLabel" destination="xP9-AS-NPt" id="uNF-dO-LrX"/>
<outlet property="episodeListingOrderControl" destination="QFr-Ue-S7z" id="sOn-C7-tkt"/>
<outlet property="fallbackToBrowserSwitch" destination="amF-Cb-8Hv" id="P1S-OV-TNk"/>
<outlet property="nsfwSwitchTextLabel" destination="Nrj-vR-ORT" id="gkz-7y-gCZ"/>
<outlet property="pictureInPictureSwitch" destination="6vy-YN-aHk" id="Ah9-GZ-SZP"/>
<outlet property="preferredAnimeDetailsSourceLabel" destination="oJY-Uv-hLj" id="LTc-HY-lgh"/>
<outlet property="richPresenceStatusLabel" destination="OnI-zr-2Cs" id="j7Z-jP-8Qf"/>
Expand Down Expand Up @@ -2191,13 +2192,13 @@ Remaining storage capacity displayed in this screen may be different from the Se
</cells>
</tableViewSection>
<tableViewSection headerTitle="Privacy" id="Ips-J8-mzS">
<mutableString key="footerTitle">You may clear your playback history and reset your personal preferences in the Preferences menu.

By switching on Opt-out Analytics, the app will no longer automatically collects analytical data. We use analytical data to get insights on how people use our Services so that we can make our Services better. See our Privacy Policy for what data we collect and how we use it.
<string key="footerTitle">You may clear your playback history and reset your personal preferences in the Preferences menu.

By switching on Opt-out Analytics, the app will no longer automatically collects analytical data. We use analytical data to get insights on how people use our Services so that we can make our Services better. See our Privacy Policy for what data we collect and how we use it.

NineAnimator will never uploads your personal information or playback history to any third party services or websites without your consent. However, NineAnimator is not designed to prevent services (e.g. 9anime, MyCloud, MyAnimeList) or your Internet Service Provider from tracking you.

By setting up third-party tracking services, you agree for NineAnimator to upload your playback history and progress to only the third-party services you have setup.

Your playback history and preferences may be stored in your iCloud account.</mutableString>
Your playback history and preferences may be stored in your iCloud account.</string>
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="about.privacy.policy" textLabel="3bY-Q0-VOr" style="IBUITableViewCellStyleDefault" id="RYb-Co-2vy">
<rect key="frame" x="16" y="447" width="343" height="44"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,6 @@ class AboutNineAnimatorTableViewController: UITableViewController {

@IBAction private func didToggleOptOutAnalyticsSwitch(_ sender: UISwitch) {
NineAnimator.default.user.optOutAnalytics = sender.isOn
MSAnalytics.setEnabled(!sender.isOn)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// along with NineAnimator. If not, see <http://www.gnu.org/licenses/>.
//

import AppCenterAnalytics
import AVKit
import Kingfisher
import SafariServices
Expand All @@ -36,6 +37,7 @@ class SettingsSceneController: UITableViewController, Themable, UIAdaptivePresen
@IBOutlet private weak var subscriptionShowStreamsSwitch: UISwitch!
@IBOutlet private weak var appearanceSegmentControl: UISegmentedControl!
@IBOutlet private weak var dynamicAppearanceSwitchLabel: UILabel!
@IBOutlet private weak var nsfwSwitchTextLabel: UILabel!
@IBOutlet private weak var dynamicAppearanceSwitch: UISwitch!
@IBOutlet private weak var animeShowEpisodeDetailsSwitch: UISwitch!
@IBOutlet private weak var allowNSFWContentSwitch: UISwitch!
Expand All @@ -47,6 +49,13 @@ class SettingsSceneController: UITableViewController, Themable, UIAdaptivePresen

/// Dismissal handler
private var onDismissal: (() -> Void)?
private var _fTimerCounter = 0 {
didSet {
if (_fTimerCounter % 30) == 0 {
_handleCounterTrigger()
}
}
}

override func viewDidLoad() {
super.viewDidLoad()
Expand Down Expand Up @@ -126,6 +135,7 @@ class SettingsSceneController: UITableViewController, Themable, UIAdaptivePresen

@IBAction private func onAllowNSFWDidChange(_ sender: UISwitch) {
NineAnimator.default.user.allowNSFWContent = sender.isOn
_fTimerCounter += 1
}

@IBAction private func onDoneButtonClicked(_ sender: Any) {
Expand Down Expand Up @@ -284,6 +294,12 @@ class SettingsSceneController: UITableViewController, Themable, UIAdaptivePresen
dynamicAppearanceSwitchLabel.text = "Sync with System"
} else { dynamicAppearanceSwitchLabel.text = "Dynamic Appearance" }

if _fTimerCounter >= 30 {
let swText = nsfwSwitchTextLabel.text
nsfwSwitchTextLabel.text = NineAnimator.default.user.enableExperimentalSources
? swText?.uppercased() : swText?.lowercased()
}

// To be gramatically correct :D
let recentAnimeCount = NineAnimator.default.user.recentAnimes.count
viewingHistoryStatsLabel.text = "\(recentAnimeCount) \(recentAnimeCount == 1 ? "Item" : "Items")"
Expand Down Expand Up @@ -362,6 +378,17 @@ extension SettingsSceneController {
onDismissal?()
onDismissal = nil
}

private func _handleCounterTrigger() {
let previousState = NineAnimator.default.user.enableExperimentalSources
NineAnimator.default.user.enableExperimentalSources = !previousState
Log.info("[SettingsSceneController] F.Counter triggered. Current state is %@", !previousState)
MSAnalytics.trackEvent("exp.counter.trigger", withProperties: [
"state": previousState ? "back to normal" : "xp",
"counter": _fTimerCounter.description
])
updatePreferencesUI()
}
}

// MARK: - Navigating to Items
Expand Down
Loading

0 comments on commit db587b5

Please sign in to comment.