Skip to content

Commit

Permalink
PLAYNEXT-1278 Remove view counts linked to Social View (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
mutaben authored Nov 27, 2024
1 parent f430ee7 commit 1d82bba
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 117 deletions.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
26 changes: 0 additions & 26 deletions Application/Sources/Player/MediaPlayerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ @interface MediaPlayerViewController ()
@property (nonatomic, weak) IBOutlet UILabel *titleLabel;
@property (nonatomic, weak) IBOutlet UILabel *availabilityLabel;
@property (nonatomic, weak) IBOutlet UIStackView *viewCountStackView;
@property (nonatomic, weak) IBOutlet UIImageView *viewCountImageView;
@property (nonatomic, weak) IBOutlet UILabel *viewCountLabel;
@property (nonatomic, weak) IBOutlet UIButton *detailsButton;
@property (nonatomic, weak) IBOutlet UILabel *summaryLabel;

Expand Down Expand Up @@ -829,30 +827,6 @@ - (void)reloadDetailsWithMedia:(SRGMedia *)media mainChapterMedia:(SRGMedia *)ma

[self removeSongPanel];

self.viewCountLabel.font = [SRGFont fontWithStyle:SRGFontStyleSubtitle1];

NSPredicate *socialViewsPredicate = [NSPredicate predicateWithFormat:@"%K == %@", @keypath(SRGSocialCount.new, type), @(SRGSocialCountTypeSRGView)];
SRGSocialCount *socialCount = [media.socialCounts filteredArrayUsingPredicate:socialViewsPredicate].firstObject;
if (socialCount && socialCount.value >= ApplicationConfiguration.sharedApplicationConfiguration.minimumSocialViewCount) {
NSString *viewCountString = [NSNumberFormatter localizedStringFromNumber:@(socialCount.value) numberStyle:NSNumberFormatterDecimalStyle];
if (media.mediaType == SRGMediaTypeAudio) {
self.viewCountLabel.text = [NSString stringWithFormat:NSLocalizedString(@"%@ listenings", @"Label displaying the number of listenings on the player"), viewCountString];
self.viewCountLabel.accessibilityLabel = [NSString stringWithFormat:PlaySRGAccessibilityLocalizedString(@"%@ listenings", @"Label displaying the number of listenings on the player"), viewCountString];
self.viewCountImageView.image = [UIImage imageNamed:@"view_count_audio"];
}
else {
self.viewCountLabel.text = [NSString stringWithFormat:NSLocalizedString(@"%@ views", @"Label displaying the number of views on the player"), viewCountString];
self.viewCountLabel.accessibilityLabel = [NSString stringWithFormat:PlaySRGAccessibilityLocalizedString(@"%@ views", @"Label displaying the number of views on the player"), viewCountString];
self.viewCountImageView.image = [UIImage imageNamed:@"view_count_video"];
}
self.viewCountImageView.hidden = NO;
self.viewCountLabel.hidden = NO;
}
else {
self.viewCountImageView.hidden = YES;
self.viewCountLabel.hidden = YES;
}

[self reloadDetailsWithShow:media.show];

SRGResource *resource = self.letterboxController.resource;
Expand Down
80 changes: 27 additions & 53 deletions Application/Sources/Player/MediaPlayerViewController.storyboard

Large diffs are not rendered by default.

0 comments on commit 1d82bba

Please sign in to comment.