mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-15 21:21:45 +00:00
fixed issue with apps duplicating in app list
This commit is contained in:
@@ -19,9 +19,10 @@
|
||||
- (void) saveSettingsWithBitrate:(NSInteger)bitrate framerate:(NSInteger)framerate height:(NSInteger)height width:(NSInteger)width onscreenControls:(NSInteger)onscreenControls;
|
||||
- (Settings*) retrieveSettings;
|
||||
- (NSArray*) retrieveHosts;
|
||||
- (void) saveHosts;
|
||||
- (void) saveData;
|
||||
- (Host*) createHost;
|
||||
- (void) removeHost:(Host*)host;
|
||||
- (App*) createApp;
|
||||
- (void) removeApp:(App*)app;
|
||||
|
||||
@end
|
||||
|
||||
@@ -53,10 +53,10 @@
|
||||
|
||||
- (void) removeHost:(Host*)host {
|
||||
[[self.appDelegate managedObjectContext] deleteObject:host];
|
||||
[self saveHosts];
|
||||
[self saveData];
|
||||
}
|
||||
|
||||
- (void) saveHosts {
|
||||
- (void) saveData {
|
||||
NSError* error;
|
||||
if (![[self.appDelegate managedObjectContext] save:&error]) {
|
||||
Log(LOG_E, @"Unable to save hosts to database: %@", error);
|
||||
@@ -73,6 +73,10 @@
|
||||
return [[App alloc] initWithEntity:entity insertIntoManagedObjectContext:[self.appDelegate managedObjectContext]];
|
||||
}
|
||||
|
||||
- (void) removeApp:(App*)app {
|
||||
[[self.appDelegate managedObjectContext] deleteObject:app];
|
||||
}
|
||||
|
||||
- (NSArray*) fetchRecords:(NSString*)entityName {
|
||||
NSFetchRequest* fetchRequest = [[NSFetchRequest alloc] init];
|
||||
NSEntityDescription* entity = [NSEntityDescription entityForName:entityName inManagedObjectContext:[self.appDelegate managedObjectContext]];
|
||||
|
||||
Reference in New Issue
Block a user