Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLAYNEXT-1278 Remove view counts linked to Social View #525

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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.

Loading