mirror of
https://github.com/yattee/yattee.git
synced 2025-01-24 05:37:49 +00:00
Fix dislikes counter
This commit is contained in:
parent
2dbc50dc71
commit
a1ade66594
@ -134,11 +134,9 @@ struct Video: Identifiable, Equatable, Hashable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var dislikesCount: String? {
|
var dislikesCount: String? {
|
||||||
guard (dislikes ?? 0) > 0 else {
|
guard let dislikes else { return nil }
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return dislikes?.formattedAsAbbreviation()
|
return dislikes.formattedAsAbbreviation()
|
||||||
}
|
}
|
||||||
|
|
||||||
func thumbnailURL(quality: Thumbnail.Quality) -> URL? {
|
func thumbnailURL(quality: Thumbnail.Quality) -> URL? {
|
||||||
|
@ -30,6 +30,7 @@ struct VideoDetails: View {
|
|||||||
@EnvironmentObject<RecentsModel> private var recents
|
@EnvironmentObject<RecentsModel> private var recents
|
||||||
@EnvironmentObject<SubscriptionsModel> private var subscriptions
|
@EnvironmentObject<SubscriptionsModel> private var subscriptions
|
||||||
|
|
||||||
|
@Default(.enableReturnYouTubeDislike) private var enableReturnYouTubeDislike
|
||||||
@Default(.detailsToolbarPosition) private var detailsToolbarPosition
|
@Default(.detailsToolbarPosition) private var detailsToolbarPosition
|
||||||
@Default(.playerSidebar) private var playerSidebar
|
@Default(.playerSidebar) private var playerSidebar
|
||||||
|
|
||||||
@ -210,7 +211,7 @@ struct VideoDetails: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if Defaults[.enableReturnYouTubeDislike] {
|
if enableReturnYouTubeDislike {
|
||||||
Image(systemName: "hand.thumbsdown")
|
Image(systemName: "hand.thumbsdown")
|
||||||
|
|
||||||
if let dislikes = video?.dislikesCount, player.videoBeingOpened.isNil {
|
if let dislikes = video?.dislikesCount, player.videoBeingOpened.isNil {
|
||||||
|
Loading…
Reference in New Issue
Block a user