Skip to content

Commit

Permalink
3.2-alpha3 - Fix discord
Browse files Browse the repository at this point in the history
  • Loading branch information
香風智乃 authored and 香風智乃 committed Aug 12, 2019
1 parent e5ac211 commit 9231cc4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DiscordManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

- (void)startDiscordRPC;
- (void)shutdownDiscordRPC;
- (void)UpdatePresence:(NSString *)state withDetails:(NSString *)details;
- (void)UpdatePresence:(NSString *)state withDetails:(NSString *)details isStreaming:(bool)isStreaming;
- (void)removePresence;
@end
4 changes: 2 additions & 2 deletions Hachidori-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.2-alpha2</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>20190605</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.entertainment</string>
<key>LSMinimumSystemVersion</key>
Expand Down
4 changes: 3 additions & 1 deletion Hachidori.m
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,9 @@ - (void)setNotifier {

- (void)sendDiscordPresence:(LastScrobbleStatus *)lscrobble {
if ([NSUserDefaults.standardUserDefaults boolForKey:@"usediscordrichpresence"] && self.discordmanager.discordrpcrunning) {
[self.discordmanager UpdatePresence:[NSString stringWithFormat:@"%@ Episode %@ ", lscrobble.WatchStatus,self.lastscrobble.LastScrobbledEpisode] withDetails:[NSString stringWithFormat:@"%@", lscrobble.LastScrobbledActualTitle]];
OnigRegexp *regex = [OnigRegexp compile:@"(Safari|Webkit|Omniweb|Roccat|Chrome|Chromium|Edge)" options:OnigOptionIgnorecase];
bool isStreaming = [regex search:lscrobble.LastScrobbledSource].strings.count > 0;
[self.discordmanager UpdatePresence:[NSString stringWithFormat:@"%@ Episode %@ ", lscrobble.WatchStatus,self.lastscrobble.LastScrobbledEpisode] withDetails:[NSString stringWithFormat:@"%@", lscrobble.LastScrobbledActualTitle] isStreaming:isStreaming];
}
}

Expand Down
4 changes: 4 additions & 0 deletions Hachidori.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1667,6 +1667,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 20190812;
DEVELOPMENT_TEAM = 9HDZTER525;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -1693,6 +1694,7 @@
"$(PROJECT_DIR)",
);
MACOSX_DEPLOYMENT_TARGET = 10.11;
MARKETING_VERSION = "3.2-alpha3";
PRODUCT_BUNDLE_IDENTIFIER = "moe.ateliershiori.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = Hachidori;
PROVISIONING_PROFILE = "";
Expand All @@ -1713,6 +1715,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 20190812;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 9HDZTER525;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -1737,6 +1740,7 @@
"$(PROJECT_DIR)",
);
MACOSX_DEPLOYMENT_TARGET = 10.11;
MARKETING_VERSION = "3.2-alpha3";
PRODUCT_BUNDLE_IDENTIFIER = "moe.ateliershiori.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = Hachidori;
PROVISIONING_PROFILE = "";
Expand Down

0 comments on commit 9231cc4

Please sign in to comment.