mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Stubbing in story's containing folders, used for saved story tagging.
This commit is contained in:
parent
6c134a1d0e
commit
b5f2b43a50
4 changed files with 25 additions and 1 deletions
|
@ -328,6 +328,7 @@
|
||||||
+ (int)computeStoryScore:(NSDictionary *)intelligence;
|
+ (int)computeStoryScore:(NSDictionary *)intelligence;
|
||||||
- (NSString *)extractFolderName:(NSString *)folderName;
|
- (NSString *)extractFolderName:(NSString *)folderName;
|
||||||
- (NSString *)extractParentFolderName:(NSString *)folderName;
|
- (NSString *)extractParentFolderName:(NSString *)folderName;
|
||||||
|
- (NSArray *)parentFoldersForFeed:(NSString *)feedId;
|
||||||
- (NSDictionary *)getFeed:(NSString *)feedId;
|
- (NSDictionary *)getFeed:(NSString *)feedId;
|
||||||
- (NSDictionary *)getStory:(NSString *)storyHash;
|
- (NSDictionary *)getStory:(NSString *)storyHash;
|
||||||
|
|
||||||
|
|
|
@ -2003,6 +2003,28 @@
|
||||||
return folderName;
|
return folderName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSArray *)parentFoldersForFeed:(NSString *)feedId {
|
||||||
|
NSMutableArray *folderNames = [[NSMutableArray alloc] init];
|
||||||
|
|
||||||
|
for (NSString *folderName in self.dictFoldersArray) {
|
||||||
|
NSArray *folder = [self.dictFolders objectForKey:folderName];
|
||||||
|
if ([folder containsObject:feedId]) {
|
||||||
|
[folderNames addObject:[self extractFolderName:folderName]];
|
||||||
|
[folderNames addObject:[self extractParentFolderName:folderName]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
NSMutableArray *uniqueFolderNames = [[NSMutableArray alloc] init];
|
||||||
|
for (NSString *folderName in folderNames) {
|
||||||
|
if ([uniqueFolderNames containsObject:folderName]) continue;
|
||||||
|
if ([folderName containsString:@"Top Level"]) continue;
|
||||||
|
if ([folderName length] < 1) continue;
|
||||||
|
|
||||||
|
[uniqueFolderNames addObject:folderName];
|
||||||
|
}
|
||||||
|
|
||||||
|
return uniqueFolderNames;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSDictionary *)getFeed:(NSString *)feedId {
|
- (NSDictionary *)getFeed:(NSString *)feedId {
|
||||||
NSDictionary *feed;
|
NSDictionary *feed;
|
||||||
if (storiesCollection.isSocialView ||
|
if (storiesCollection.isSocialView ||
|
||||||
|
|
|
@ -636,6 +636,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)markStory:(NSDictionary *)story asSaved:(BOOL)saved {
|
- (void)markStory:(NSDictionary *)story asSaved:(BOOL)saved {
|
||||||
|
NSLog(@"Saving in folders: %@", [appDelegate parentFoldersForFeed:[story objectForKey:@"story_feed_id"]]);
|
||||||
NSMutableDictionary *newStory = [[appDelegate getStory:[story objectForKey:@"story_hash"]] mutableCopy];
|
NSMutableDictionary *newStory = [[appDelegate getStory:[story objectForKey:@"story_hash"]] mutableCopy];
|
||||||
[newStory setValue:[NSNumber numberWithBool:saved] forKey:@"starred"];
|
[newStory setValue:[NSNumber numberWithBool:saved] forKey:@"starred"];
|
||||||
if (saved) {
|
if (saved) {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#import <SystemConfiguration/SystemConfiguration.h>
|
#import <SystemConfiguration/SystemConfiguration.h>
|
||||||
#import <MobileCoreServices/MobileCoreServices.h>
|
#import <MobileCoreServices/MobileCoreServices.h>
|
||||||
|
|
||||||
//#define DEBUG 1
|
#define DEBUG 1
|
||||||
//#define PROD_DEBUG 1
|
//#define PROD_DEBUG 1
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
Loading…
Add table
Reference in a new issue