Ticket #35: only show spoilers of watched tv episodes.txt

File only show spoilers of watched tv episodes.txt, 2.4 kB (added by jeremy, 8 months ago)
Line 
1 Index: SapphireMetaData.h
2 ===================================================================
3 --- SapphireMetaData.h  (revision 505)
4 +++ SapphireMetaData.h  (working copy)
5 @@ -70,6 +70,7 @@
6  #define        META_MOVIE_IMDB_STATS_KEY               @"IMDB"
7  #define AUDIO_DESC_LABEL_KEY                   @"Audio"
8  #define VIDEO_DESC_LABEL_KEY                   @"Video"
9 +#define WATCHED_KEY                                            @"Watched"
10
11  //Sapphire Virtual Directory Movie Folders
12  #define VIRTUAL_DIR_ROOT_KEY                   @"@MOVIES"
13 @@ -1027,4 +1028,4 @@
14   */
15  - (NSComparisonResult) episodeCompare:(SapphireFileMetaData *)other;
16
17 -@end
18 \ No newline at end of file
19 +@end
20 Index: SapphireMetaData.m
21 ===================================================================
22 --- SapphireMetaData.m  (revision 505)
23 +++ SapphireMetaData.m  (working copy)
24 @@ -41,7 +41,7 @@
25
26  //File Specific Keys
27  #define MODIFIED_KEY                           @"Modified"
28 -#define WATCHED_KEY                                    @"Watched"
29 +//#define WATCHED_KEY                                  @"Watched"
30  #define FAVORITE_KEY                           @"Favorite"
31  #define RESUME_KEY                                     @"Resume Time"
32  #define SIZE_KEY                                       @"Size"
33 @@ -2092,6 +2092,13 @@
34                 else
35                         [ret setObject:[NSString stringWithFormat:@"%@ - %d / %d",[self showName], season, ep] forKey:META_EPISODE_AND_SEASON_KEY];
36         }
37 +
38 +       /*If the show has been watched or not. Not 'displayed' as such but alters if spoilers are displayed*/
39 +       if ([self watched])
40 +               [ret setObject:@"Watched" forKey:WATCHED_KEY];
41 +       else
42 +               [ret setObject:@"Unwatched" forKey:WATCHED_KEY];
43 +
44         return ret;
45  }
46
47 Index: SapphireMediaPreview.m
48 ===================================================================
49 --- SapphireMediaPreview.m      (revision 505)
50 +++ SapphireMediaPreview.m      (working copy)
51 @@ -221,7 +221,7 @@
52         /*Get the description*/
53         value = [allMeta objectForKey:META_DESCRIPTION_KEY];
54         if(value != nil)
55 -               if([[SapphireSettings sharedSettings] displaySpoilers])
56 +               if(([[SapphireSettings sharedSettings] displaySpoilers]) && ([allMeta objectForKey:WATCHED_KEY] == @"Watched"))
57                         [metaLayer setSummary:value];
58
59         /*Get the copyright*/