Skip to content
Permalink
Browse files

3.0.8 - Fix bug where incorrect values

populate in advanced edit dialog if the user
opened this dialog for a previous entry and
then open the advanced edit dialog for another
entry

Add ability to edit rewatch/reread repeat count

Disable edit buttons in user's library
view when list is being refreshed.

Show current service name in addition to the logged
in username
  • Loading branch information...
moyitpro committed Jun 22, 2018
1 parent f219aac commit dfff8334e04a1f4d4025922e2fb8c6683e7bc538
@@ -29,8 +29,8 @@ @implementation AniListConstants
NSString *const kAnilistAddMangaListEntry = @"mutation ($mediaid : Int, $progress : Int, $progressVolumes : Int, $status : MediaListStatus, $score : Int) {\n SaveMediaListEntry(mediaId: $mediaid, progress: $progress, progressVolumes: $progressVolumes,status: $status, scoreRaw: $score) {\n id\n progress\n progressVolumes\n status\n score(format: POINT_100)\n }\n}";
NSString *const kAnilistUpdateAnimeListEntrySimple = @"mutation ($id : Int, $progress : Int, $status : MediaListStatus, $score : Int) {\n SaveMediaListEntry(id: $id, progress: $progress, status: $status, scoreRaw: $score) {\n id\n progress\n status\n score(format: POINT_100)\n }\n}";
NSString *const kAnilistUpdateMangaListEntrySimple = @"mutation ($id : Int, $progress : Int, $progressVolumes : Int, $status : MediaListStatus, $score : Int) {\n SaveMediaListEntry(id: $id, progress: $progress, progressVolumes: $progressVolumes,status: $status, scoreRaw: $score) {\n id\n progress\n progressVolumes\n status\n score(format: POINT_100)\n }\n}";
NSString *const kAnilistUpdateAnimeListEntryAdvanced = @"mutation ($id : Int, $progress : Int, $status : MediaListStatus, $score : Int, $notes : String, $private : Boolean, $startedAt : FuzzyDateInput, $completedAt : FuzzyDateInput) {\n SaveMediaListEntry(id: $id, progress: $progress, status: $status, scoreRaw: $score, notes: $notes, private: $private, startedAt: $startedAt, completedAt: $completedAt) {\n id\n progress\n status\n score(format: POINT_100)\n notes\n private\n startedAt {\n year\n month\n day\n }\n completedAt {\n year\n month\n day\n }\n }\n}";
NSString *const kAnilistUpdateMangaListEntryAdvanced = @"mutation ($id : Int, $progress : Int, $progressVolumes : Int, $status : MediaListStatus, $score : Int, $notes : String, $private : Boolean, $startedAt : FuzzyDateInput, $completedAt : FuzzyDateInput) {\n SaveMediaListEntry(id: $id, progress: $progress, progressVolumes: $progressVolumes, status: $status, scoreRaw: $score, notes: $notes, private: $private, startedAt: $startedAt, completedAt: $completedAt) {\n id\n progress\n progressVolumes\n status\n score(format: POINT_100)\n notes\n private\n startedAt {\n year\n month\n day\n }\n completedAt {\n year\n month\n day\n }\n }\n}";
NSString *const kAnilistUpdateAnimeListEntryAdvanced = @"mutation ($id : Int, $progress : Int, $status : MediaListStatus, $score : Int, $notes : String, $private : Boolean, $startedAt : FuzzyDateInput, $completedAt : FuzzyDateInput, $reconsumeCount : Int) {\n SaveMediaListEntry(id: $id, progress: $progress, status: $status, scoreRaw: $score, notes: $notes, private: $private, startedAt: $startedAt, completedAt: $completedAt, repeat: $reconsumeCount) {\n id\n progress\n status\n score(format: POINT_100)\n notes\n private\n startedAt {\n year\n month\n day\n }\n completedAt {\n year\n month\n day\n }\n }\n}";
NSString *const kAnilistUpdateMangaListEntryAdvanced = @"mutation ($id : Int, $progress : Int, $progressVolumes : Int, $status : MediaListStatus, $score : Int, $notes : String, $private : Boolean, $startedAt : FuzzyDateInput, $completedAt : FuzzyDateInput, $reconsumeCount : Int) {\n SaveMediaListEntry(id: $id, progress: $progress, progressVolumes: $progressVolumes, status: $status, scoreRaw: $score, notes: $notes, private: $private, startedAt: $startedAt, completedAt: $completedAt, repeat: $reconsumeCount) {\n id\n progress\n progressVolumes\n status\n score(format: POINT_100)\n notes\n private\n startedAt {\n year\n month\n day\n }\n completedAt {\n year\n month\n day\n }\n }\n}";
NSString *const kAnilistDeleteListEntry = @"mutation ($id : Int) {\n DeleteMediaListEntry (id: $id) {\n deleted\n }\n}";

@end
@@ -36,6 +36,7 @@
<outlet property="privatecheck" destination="oHv-pa-m2o" id="5uI-pI-YSt"/>
<outlet property="progressindicator" destination="JVY-MR-fnL" id="1dE-1f-GTp"/>
<outlet property="reconsuming" destination="UM2-pg-7eP" id="3my-aN-YDK"/>
<outlet property="repeattimes" destination="vk3-2s-hgv" id="uIg-I5-oip"/>
<outlet property="score" destination="EFA-fa-hfs" id="k03-Hk-CVh"/>
<outlet property="segmentfield" destination="0VS-xT-OYp" id="hJs-Yw-AD8"/>
<outlet property="setenddatecheck" destination="6WI-nf-Nm7" id="Tin-WL-kfA"/>
@@ -59,7 +60,7 @@
<windowStyleMask key="styleMask" titled="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="480" height="297"/>
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="697"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1177"/>
<view key="contentView" wantsLayer="YES" id="se5-gp-TjO">
<rect key="frame" x="0.0" y="0.0" width="480" height="297"/>
<autoresizingMask key="autoresizingMask"/>
@@ -117,15 +118,15 @@ Gw
</popUpButtonCell>
</popUpButton>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="UM2-pg-7eP">
<rect key="frame" x="274" y="240" width="125" height="18"/>
<rect key="frame" x="274" y="249" width="125" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Reconsuming" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="ZyH-fD-5UV">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="oHv-pa-m2o">
<rect key="frame" x="274" y="218" width="125" height="18"/>
<rect key="frame" x="274" y="206" width="125" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Private" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="Wig-8q-9Qy">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@@ -251,12 +252,40 @@ Gw
<action selector="dateCheckStateChanged:" target="-2" id="DRQ-Qw-it0"/>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qma-Wf-G7I">
<rect key="frame" x="258" y="227" width="97" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Reconsumed:" id="mYU-dj-iDP">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="vk3-2s-hgv">
<rect key="frame" x="361" y="224" width="50" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="FHF-zt-YvK">
<numberFormatter key="formatter" formatterBehavior="default10_4" usesGroupingSeparator="NO" groupingSize="0" minimumIntegerDigits="0" maximumIntegerDigits="42" id="zne-UB-cp3" customClass="NSNumberFormatterNumberOnly"/>
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6cw-HT-3NI">
<rect key="frame" x="417" y="226" width="65" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Times" id="KIL-UY-ztf">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<connections>
<outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
</connections>
<point key="canvasLocation" x="316" y="404"/>
<point key="canvasLocation" x="316" y="403.5"/>
</window>
<menu id="Xss-Ga-Pzn">
<items>
@@ -242,7 +242,6 @@ - (void)updateanimeentry {
_minieditpopover.behavior = NSPopoverBehaviorTransient;
_minipopoverindicator.hidden = true;
[_minipopoverindicator stopAnimation:nil];
[_mlv setUpdatingState:false];
[_minieditpopover close];
[self cleanup];
}
@@ -324,7 +323,6 @@ - (void)updatemangaentry {
_minieditpopover.behavior = NSPopoverBehaviorTransient;
_minipopoverindicator.hidden = true;
[_minipopoverindicator stopAnimation:nil];
[_mlv setUpdatingState:false];
[_minieditpopover close];
[self cleanup];
}error:^(NSError * error) {
@@ -475,14 +473,25 @@ - (IBAction)showadvanced:(id)sender {
if (!_mw.ade) {
_mw.ade = [advancededitdialog new];
}
[_mw.ade window];
[_mw.ade.window makeKeyAndOrderFront:self];
[_mw.ade setupeditwindow:_selecteditem.copy type:_selectedtype];
[_mw.ade.window close];
[_minieditpopover close];
[_mlv setUpdatingState:true];
[_mw.window beginSheet:_mw.ade.window completionHandler:^(NSModalResponse returnCode) {
if (returnCode == NSModalResponseOK) {
[_mw loadlist:@(true) type:_selectedtype];
[_mw loadlist:@(true) type:2];
}
else {
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(queue, ^{
sleep(1);
dispatch_async(dispatch_get_main_queue(), ^{
[_mlv setUpdatingState:false];
});
});
}
}];
}

@@ -21,7 +21,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.0.7</string>
<string>3.0.8</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
@@ -309,7 +309,7 @@ - (void)setAppearance {

- (void)refreshloginlabel{
if ([listservice checkAccountForCurrentService]) {
_loggedinuser.stringValue = [NSString stringWithFormat:@"Logged in as %@",[listservice getCurrentServiceUsername]];
_loggedinuser.stringValue = [NSString stringWithFormat:@"Logged in as %@ (%@)",[listservice getCurrentServiceUsername], [listservice currentservicename]];
}
else {
_loggedinuser.stringValue = @"Not logged in.";
@@ -681,6 +681,7 @@ - (IBAction)showadvancedpopover:(id)sender {
#pragma mark Anime List
- (IBAction)refreshlist:(id)sender {
[_appdel.servicemenucontrol enableservicemenuitems:NO];
[_listview setUpdatingState:true];
switch ([listservice getCurrentServiceID]) {
case 1: {
[self performlistRefresh];
@@ -724,14 +725,17 @@ - (void)performlistRefresh {
else if ([identifier isEqualToString:@"history"]){
[self loadlist:@(true) type:2];
[_appdel.servicemenucontrol enableservicemenuitems:YES];
[_listview setUpdatingState:false];
}
else if ([identifier isEqualToString:@"seasons"]){
[_seasonview performseasonindexretrieval];
[_appdel.servicemenucontrol enableservicemenuitems:YES];
[_listview setUpdatingState:false];
}
else if ([identifier isEqualToString:@"airing"]){
[_airingview loadAiring:@(true)];
[_appdel.servicemenucontrol enableservicemenuitems:YES];
[_listview setUpdatingState:false];
}
}
- (void)loadlist:(NSNumber *)refresh type:(int)type {
@@ -751,14 +755,21 @@ - (void)loadlist:(NSNumber *)refresh type:(int)type {
return;
}
else if (!exists || refreshlist){
[_listview setUpdatingState:true];
[self showProgressWheel:false];
[_appdel.servicemenucontrol enableservicemenuitems:NO];
[listservice retrieveownListWithType:MALAnime completion:^(id responseObject){
[_listview populateList:[Utility saveJSON:responseObject withFilename:[listservice retrieveListFileName:0] appendpath:@"" replace:TRUE] type:0];
[self refreshStatistics];
_refreshanime = false;
[_listview setUpdatingState:false];
[self showProgressWheel:true];
[self enableservicemenuitems];
}error:^(NSError *error){
NSLog(@"%@", error.userInfo);
_refreshanime = false;
[self showProgressWheel:true];
[_listview setUpdatingState:false];
[self enableservicemenuitems];
}];
}
@@ -774,14 +785,21 @@ - (void)loadlist:(NSNumber *)refresh type:(int)type {
return;
}
else if (!exists || refreshlist){
[_listview setUpdatingState:true];
[self showProgressWheel:false];
[_appdel.servicemenucontrol enableservicemenuitems:NO];
[listservice retrieveownListWithType:MALManga completion:^(id responseObject){
[_listview populateList:[Utility saveJSON:responseObject withFilename:[listservice retrieveListFileName:1] appendpath:@"" replace:TRUE] type:1];
[self refreshStatistics];
_refreshmanga = false;
[self showProgressWheel:true];
[_listview setUpdatingState:false];
[self enableservicemenuitems];
}error:^(NSError *error){
NSLog(@"%@", error.userInfo);
_refreshmanga = false;
[self showProgressWheel:true];
[_listview setUpdatingState:false];
[self enableservicemenuitems];
}];
}
@@ -1201,6 +1219,7 @@ - (id)retreveentryfromlist:(int)idnum type:(int)type{
}
- (void)enableservicemenuitems {
[_appdel.servicemenucontrol enableservicemenuitems:!_refreshmanga && !_refreshanime];
[_listview setUpdatingState:_refreshmanga && _refreshanime];
[self showProgressWheel:!_refreshmanga &&! _refreshanime];
}

@@ -225,6 +225,7 @@ - (void)tableViewSelectionDidChange:(NSNotification *)notification {
}

- (void)setToolbarButtonState{
[self view];
if (self.currentlist == 0) {
if (self.animelistarraycontroller.selectedObjects.count > 0 && !_updating) {
_edittitleitem.enabled = YES;
@@ -18,6 +18,7 @@
@property bool selectedfinished;
@property bool selectedpublished;
@property (strong) NSDictionary *selecteditem;
@property (strong) IBOutlet NSTextField *repeattimes;

// MyAnimeList fields
@property (strong) IBOutlet NSView *malfieldsview;
@@ -71,6 +71,7 @@ - (void)setupeditwindow:(NSDictionary *)d type:(int)type {
[_status selectItemWithTitle:d[@"watched_status"]];
[self setScoreMenu:d];
_reconsuming.state = ((NSNumber *)d[@"rewatching"]).boolValue;
_repeattimes.integerValue = ((NSNumber *)d[@"rewatch_count"]).integerValue;
if (!_privatecheck.hidden) {
_privatecheck.state = ((NSNumber *)d[@"private"]).boolValue;
if (d[@"personal_comments"] != [NSNull null]) {
@@ -141,6 +142,7 @@ - (void)setupeditwindow:(NSDictionary *)d type:(int)type {
[_status selectItemWithTitle:d[@"read_status"]];
[self setScoreMenu:d];
_reconsuming.state = ((NSNumber *)d[@"rereading"]).boolValue;
_repeattimes.integerValue = ((NSNumber *)d[@"reread_count"]).integerValue;
if (!_privatecheck.hidden) {
_privatecheck.state = ((NSNumber *)d[@"private"]).boolValue;
if (d[@"personal_comments"] != [NSNull null]) {
@@ -548,10 +550,12 @@ - (NSDictionary *)generateExtraFieldsWithType:(int)type {
extrafields[@"end"] = [df stringFromDate:_enddatepicker.dateValue];
}
if (type == 0) {
extrafields[@"is_rewatching"] = @(_reconsuming.state);
extrafields[@"is_rewatching"] = @(_reconsuming.state);
extrafields[@"rewatch_count"] = @(_repeattimes.intValue);
}
else {
extrafields[@"is_rereading"] = @(_reconsuming.state);
extrafields[@"reread_count"] = @(_repeattimes.intValue);
}
break;
}
@@ -570,6 +574,7 @@ - (NSDictionary *)generateExtraFieldsWithType:(int)type {
}
extrafields[@"private"] = @(_privatecheck.state);
extrafields[@"reconsuming"] = @(_reconsuming.state);
extrafields[@"reconsumeCount"] = @(_repeattimes.intValue);
break;
}
case 3:{
@@ -595,6 +600,7 @@ - (NSDictionary *)generateExtraFieldsWithType:(int)type {
}
extrafields[@"private"] = @(_privatecheck.state);
extrafields[@"reconsuming"] = @(_reconsuming.state);
extrafields[@"reconsumeCount"] = @(_repeattimes.intValue);
break;
}
default:

0 comments on commit dfff833

Please sign in to comment.
You can’t perform that action at this time.