Ticket #35 (new Enhancement)

Opened 7 years ago

Last modified 6 years ago

add option to show spoilers only if the ep is marked as watched

Reported by: anonymous Owned by:
Priority: normal Milestone:
Component: Browser Version: 1.0b4.1
Keywords: Cc:

Description

an option to show spoilers only if the selected episode is marked as watched would be good. can't live with them, can't live without them.

Attachments

only show spoilers of watched tv episodes.txt Download (2.4 KB) - added by jeremy 6 years ago.

Change History

Changed 6 years ago by jeremy

comment:1 Changed 6 years ago by jeremy

I thought I'd start with something small to begin with to learn how things work in Sapphire browser. Also, this is my first time coding for Macs (been coding for a while though).

I didn't like the idea of adding more and more options to sapphire browser. The attached patch:

o Only affects spoilers for television shows. Generally speaking, the description from IMDB doesn't contain spoilers for movies.

o The spoilers are only shown if show spoilers is on and the show has been watched.

To achieve this, I needed to add the WATCHED_KEY to the metadata collection that is used to populate the media preview. Even though we don't directly display the information in WATCHED_KEY, it is used to determine if the description is to be shown. I had to change the scope of the WATCHED_KEY #define so that it could be referenced from SapphireMediaPreview?.

comment:2 follow-up: ↓ 3 Changed 6 years ago by gbooker

This is really better done using the radio setting class I just committed in [511]. The reason is there are really 3 settings to this pref:

  • Show Spoilers all the time
  • Show Spoiler only on watched Episodes
  • Never Show Spoilers

So, it is best implemented with that.

BTW, jeremy, you should not do an if(astring == @"something") but instead do if([astring isEqualToString:@"something"])

comment:3 in reply to: ↑ 2 ; follow-up: ↓ 4 Changed 6 years ago by jeremy

Replying to gbooker:

This is really better done using the radio setting class I just committed in [511].

Sounds good. I'll check out the class and look at integrating it into a new patch using the radio setting class.

BTW, jeremy, you should not do an if(astring == @"something") but instead do if([astring isEqualToString:@"something"])

Thanks for the advice. I suppose using the "==" operator explicitly means object pointer comparison (bad) unless the object has overriden the "==" operator to "isEqualToString" method (is this actually what happens in Obj-c)? Sorry for any dumb mistakes - I started with Objective-c and Mac programming last week when I downloaded xcode 3.1 beta.

comment:4 in reply to: ↑ 3 Changed 6 years ago by gbooker

Replying to jeremy:

Thanks for the advice. I suppose using the "==" operator explicitly means object pointer comparison (bad)

Yep

unless the object has overriden the "==" operator to "isEqualToString" method (is this actually what happens in Obj-c)?

Nope, no operator overriding here (unless you mix C++ code with Obj-C). Personally, I see operator overloading as nice in some situations, but too many have abused it (see iostreams).

Sorry for any dumb mistakes - I started with Objective-c and Mac programming last week when I downloaded xcode 3.1 beta.

All part of the learning process. I was this way one day.

Note: See TracTickets for help on using tickets.