mirror of
https://github.com/yattee/yattee.git
synced 2024-12-12 21:30:32 +05:30
Swiftformat fixes
This commit is contained in:
parent
4b21cd48e3
commit
7741e531f4
@ -17,13 +17,13 @@ extension String {
|
|||||||
|
|
||||||
var outputText = self
|
var outputText = self
|
||||||
|
|
||||||
results.reversed().forEach { match in
|
for match in results.reversed() {
|
||||||
(1 ..< match.numberOfRanges).reversed().forEach { rangeIndex in
|
for rangeIndex in (1 ..< match.numberOfRanges).reversed() {
|
||||||
let matchingGroup: String = (self as NSString).substring(with: match.range(at: rangeIndex))
|
let matchingGroup: String = (self as NSString).substring(with: match.range(at: rangeIndex))
|
||||||
let rangeBounds = match.range(at: rangeIndex)
|
let rangeBounds = match.range(at: rangeIndex)
|
||||||
|
|
||||||
guard let range = Range(rangeBounds, in: self) else {
|
guard let range = Range(rangeBounds, in: self) else {
|
||||||
return
|
continue
|
||||||
}
|
}
|
||||||
let replacement = replacementStringClosure(matchingGroup) ?? matchingGroup
|
let replacement = replacementStringClosure(matchingGroup) ?? matchingGroup
|
||||||
|
|
||||||
|
@ -111,12 +111,13 @@ extension VideosAPI {
|
|||||||
func shareURL(_ item: ContentItem, frontendURLString: String? = nil, time: CMTime? = nil) -> URL? {
|
func shareURL(_ item: ContentItem, frontendURLString: String? = nil, time: CMTime? = nil) -> URL? {
|
||||||
var urlComponents: URLComponents?
|
var urlComponents: URLComponents?
|
||||||
if let frontendURLString,
|
if let frontendURLString,
|
||||||
let frontendURL = URL(string: frontendURLString) {
|
let frontendURL = URL(string: frontendURLString)
|
||||||
|
{
|
||||||
urlComponents = URLComponents(URL: frontendURL, resolvingAgainstBaseURL: false)
|
urlComponents = URLComponents(URL: frontendURL, resolvingAgainstBaseURL: false)
|
||||||
} else if let instanceComponents = account?.instance?.urlComponents {
|
} else if let instanceComponents = account?.instance?.urlComponents {
|
||||||
urlComponents = instanceComponents
|
urlComponents = instanceComponents
|
||||||
}
|
}
|
||||||
|
|
||||||
guard var urlComponents else {
|
guard var urlComponents else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ struct BrowsingSettingsGroupImporter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let favorites = json["favorites"].array {
|
if let favorites = json["favorites"].array {
|
||||||
favorites.forEach { favoriteJSON in
|
for favoriteJSON in favorites {
|
||||||
if let jsonString = favoriteJSON.rawString(options: []),
|
if let jsonString = favoriteJSON.rawString(options: []),
|
||||||
let item = FavoriteItem.bridge.deserialize(jsonString)
|
let item = FavoriteItem.bridge.deserialize(jsonString)
|
||||||
{
|
{
|
||||||
@ -32,7 +32,7 @@ struct BrowsingSettingsGroupImporter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let widgetsFavorites = json["widgetsSettings"].array {
|
if let widgetsFavorites = json["widgetsSettings"].array {
|
||||||
widgetsFavorites.forEach { widgetJSON in
|
for widgetJSON in widgetsFavorites {
|
||||||
let dict = widgetJSON.dictionaryValue.mapValues { json in json.stringValue }
|
let dict = widgetJSON.dictionaryValue.mapValues { json in json.stringValue }
|
||||||
if let item = WidgetSettingsBridge().deserialize(dict) {
|
if let item = WidgetSettingsBridge().deserialize(dict) {
|
||||||
FavoritesModel.shared.updateWidgetSettings(item)
|
FavoritesModel.shared.updateWidgetSettings(item)
|
||||||
|
@ -56,7 +56,7 @@ struct LocationsSettingsGroupImporter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let accounts = json["accounts"].array {
|
if let accounts = json["accounts"].array {
|
||||||
accounts.forEach { accountJSON in
|
for accountJSON in accounts {
|
||||||
let dict = accountJSON.dictionaryValue.mapValues { json in json.stringValue }
|
let dict = accountJSON.dictionaryValue.mapValues { json in json.stringValue }
|
||||||
if let account = AccountsBridge().deserialize(dict),
|
if let account = AccountsBridge().deserialize(dict),
|
||||||
includedAccountsIDs.contains(account.id)
|
includedAccountsIDs.contains(account.id)
|
||||||
|
@ -26,7 +26,7 @@ struct QualitySettingsGroupImporter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let qualityProfiles = json["qualityProfiles"].array {
|
if let qualityProfiles = json["qualityProfiles"].array {
|
||||||
qualityProfiles.forEach { qualityProfileJSON in
|
for qualityProfileJSON in qualityProfiles {
|
||||||
let dict = qualityProfileJSON.dictionaryValue.mapValues { json in json.stringValue }
|
let dict = qualityProfileJSON.dictionaryValue.mapValues { json in json.stringValue }
|
||||||
if let item = QualityProfileBridge().deserialize(dict) {
|
if let item = QualityProfileBridge().deserialize(dict) {
|
||||||
QualityProfilesModel.shared.update(item, item)
|
QualityProfilesModel.shared.update(item, item)
|
||||||
|
@ -6,7 +6,7 @@ struct RecentlyOpenedImporter {
|
|||||||
|
|
||||||
func performImport() {
|
func performImport() {
|
||||||
if let recentlyOpened = json["recentlyOpened"].array {
|
if let recentlyOpened = json["recentlyOpened"].array {
|
||||||
recentlyOpened.forEach { recentlyOpenedJSON in
|
for recentlyOpenedJSON in recentlyOpened {
|
||||||
let dict = recentlyOpenedJSON.dictionaryValue.mapValues { json in json.stringValue }
|
let dict = recentlyOpenedJSON.dictionaryValue.mapValues { json in json.stringValue }
|
||||||
if let item = RecentItemBridge().deserialize(dict) {
|
if let item = RecentItemBridge().deserialize(dict) {
|
||||||
RecentsModel.shared.add(item)
|
RecentsModel.shared.add(item)
|
||||||
|
@ -147,7 +147,7 @@ struct OpenVideosModel {
|
|||||||
if prepending {
|
if prepending {
|
||||||
videos.reverse()
|
videos.reverse()
|
||||||
}
|
}
|
||||||
videos.forEach { video in
|
for video in videos {
|
||||||
player.enqueueVideo(video, play: false, prepending: prepending, loadDetails: false)
|
player.enqueueVideo(video, play: false, prepending: prepending, loadDetails: false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,21 +60,21 @@ class Stream: Equatable, Hashable, Identifiable {
|
|||||||
var bitrate: Int {
|
var bitrate: Int {
|
||||||
switch self {
|
switch self {
|
||||||
case .hd2160p60, .hd2160p50, .hd2160p48, .hd2160p30:
|
case .hd2160p60, .hd2160p50, .hd2160p48, .hd2160p30:
|
||||||
return 56000000 // 56 Mbit/s
|
return 56_000_000 // 56 Mbit/s
|
||||||
case .hd1440p60, .hd1440p50, .hd1440p48, .hd1440p30:
|
case .hd1440p60, .hd1440p50, .hd1440p48, .hd1440p30:
|
||||||
return 24000000 // 24 Mbit/s
|
return 24_000_000 // 24 Mbit/s
|
||||||
case .hd1080p60, .hd1080p50, .hd1080p48, .hd1080p30:
|
case .hd1080p60, .hd1080p50, .hd1080p48, .hd1080p30:
|
||||||
return 12000000 // 12 Mbit/s
|
return 12_000_000 // 12 Mbit/s
|
||||||
case .hd720p60, .hd720p50, .hd720p48, .hd720p30:
|
case .hd720p60, .hd720p50, .hd720p48, .hd720p30:
|
||||||
return 9500000 // 9.5 Mbit/s
|
return 9_500_000 // 9.5 Mbit/s
|
||||||
case .sd480p30:
|
case .sd480p30:
|
||||||
return 4000000 // 4 Mbit/s
|
return 4_000_000 // 4 Mbit/s
|
||||||
case .sd360p30:
|
case .sd360p30:
|
||||||
return 1500000 // 1.5 Mbit/s
|
return 1_500_000 // 1.5 Mbit/s
|
||||||
case .sd240p30:
|
case .sd240p30:
|
||||||
return 1000000 // 1 Mbit/s
|
return 1_000_000 // 1 Mbit/s
|
||||||
case .sd144p30:
|
case .sd144p30:
|
||||||
return 600000 // 0.6 Mbit/s
|
return 600_000 // 0.6 Mbit/s
|
||||||
case .unknown:
|
case .unknown:
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ struct URLBookmarkModel {
|
|||||||
func refreshAll() {
|
func refreshAll() {
|
||||||
logger.info("refreshing all bookmarks")
|
logger.info("refreshing all bookmarks")
|
||||||
|
|
||||||
allURLs.forEach { url in
|
for url in allURLs {
|
||||||
if loadBookmark(url) != nil {
|
if loadBookmark(url) != nil {
|
||||||
logger.info("bookmark for \(url) exists")
|
logger.info("bookmark for \(url) exists")
|
||||||
} else {
|
} else {
|
||||||
|
@ -57,7 +57,7 @@ final class URLParserTests: XCTestCase {
|
|||||||
]
|
]
|
||||||
|
|
||||||
func testUrlsParsing() throws {
|
func testUrlsParsing() throws {
|
||||||
Self.urls.forEach { urlString in
|
for urlString in Self.urls {
|
||||||
let url = URL(string: urlString)!
|
let url = URL(string: urlString)!
|
||||||
let parser = URLParser(url: url)
|
let parser = URLParser(url: url)
|
||||||
XCTAssertEqual(parser.destination, .fileURL)
|
XCTAssertEqual(parser.destination, .fileURL)
|
||||||
@ -66,7 +66,7 @@ final class URLParserTests: XCTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testVideosParsing() throws {
|
func testVideosParsing() throws {
|
||||||
Self.videos.forEach { url, id in
|
for (url, id) in Self.videos {
|
||||||
let parser = URLParser(url: URL(string: url)!)
|
let parser = URLParser(url: URL(string: url)!)
|
||||||
XCTAssertEqual(parser.destination, .video)
|
XCTAssertEqual(parser.destination, .video)
|
||||||
XCTAssertEqual(parser.videoID, id)
|
XCTAssertEqual(parser.videoID, id)
|
||||||
@ -74,7 +74,7 @@ final class URLParserTests: XCTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testChannelsByNameParsing() throws {
|
func testChannelsByNameParsing() throws {
|
||||||
Self.channelsByName.forEach { url, name in
|
for (url, name) in Self.channelsByName {
|
||||||
let parser = URLParser(url: URL(string: url)!)
|
let parser = URLParser(url: URL(string: url)!)
|
||||||
XCTAssertEqual(parser.destination, .channel)
|
XCTAssertEqual(parser.destination, .channel)
|
||||||
XCTAssertEqual(parser.channelName, name)
|
XCTAssertEqual(parser.channelName, name)
|
||||||
@ -83,7 +83,7 @@ final class URLParserTests: XCTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testChannelsByIdParsing() throws {
|
func testChannelsByIdParsing() throws {
|
||||||
Self.channelsByID.forEach { url, id in
|
for (url, id) in Self.channelsByID {
|
||||||
let parser = URLParser(url: URL(string: url)!)
|
let parser = URLParser(url: URL(string: url)!)
|
||||||
XCTAssertEqual(parser.destination, .channel)
|
XCTAssertEqual(parser.destination, .channel)
|
||||||
XCTAssertEqual(parser.channelID, id)
|
XCTAssertEqual(parser.channelID, id)
|
||||||
@ -92,7 +92,7 @@ final class URLParserTests: XCTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testUsersParsing() throws {
|
func testUsersParsing() throws {
|
||||||
Self.users.forEach { url, user in
|
for (url, user) in Self.users {
|
||||||
let parser = URLParser(url: URL(string: url)!)
|
let parser = URLParser(url: URL(string: url)!)
|
||||||
XCTAssertEqual(parser.destination, .channel)
|
XCTAssertEqual(parser.destination, .channel)
|
||||||
XCTAssertNil(parser.channelID)
|
XCTAssertNil(parser.channelID)
|
||||||
@ -102,7 +102,7 @@ final class URLParserTests: XCTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testPlaylistsParsing() throws {
|
func testPlaylistsParsing() throws {
|
||||||
Self.playlists.forEach { url, id in
|
for (url, id) in Self.playlists {
|
||||||
let parser = URLParser(url: URL(string: url)!)
|
let parser = URLParser(url: URL(string: url)!)
|
||||||
XCTAssertEqual(parser.destination, .playlist)
|
XCTAssertEqual(parser.destination, .playlist)
|
||||||
XCTAssertEqual(parser.playlistID, id)
|
XCTAssertEqual(parser.playlistID, id)
|
||||||
@ -110,7 +110,7 @@ final class URLParserTests: XCTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testSearchesParsing() throws {
|
func testSearchesParsing() throws {
|
||||||
Self.searches.forEach { url, query in
|
for (url, query) in Self.searches {
|
||||||
let parser = URLParser(url: URL(string: url)!)
|
let parser = URLParser(url: URL(string: url)!)
|
||||||
XCTAssertEqual(parser.destination, .search)
|
XCTAssertEqual(parser.destination, .search)
|
||||||
XCTAssertEqual(parser.searchQuery, query)
|
XCTAssertEqual(parser.searchQuery, query)
|
||||||
@ -127,7 +127,7 @@ final class URLParserTests: XCTestCase {
|
|||||||
"watch?v=IUTGFQpKaPU&t=30s": 30
|
"watch?v=IUTGFQpKaPU&t=30s": 30
|
||||||
]
|
]
|
||||||
|
|
||||||
samples.forEach { url, time in
|
for (url, time) in samples {
|
||||||
XCTAssertEqual(
|
XCTAssertEqual(
|
||||||
URLParser(url: URL(string: url)!).time,
|
URLParser(url: URL(string: url)!).time,
|
||||||
time
|
time
|
||||||
|
@ -53,7 +53,6 @@ struct ChannelPlaylistCell: View {
|
|||||||
|
|
||||||
Text("\(playlist.videosCount ?? playlist.videos.count) videos")
|
Text("\(playlist.videosCount ?? playlist.videos.count) videos")
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
|
|
||||||
.frame(height: 20)
|
.frame(height: 20)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,6 @@ struct FavoriteItemView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.contentShape(Rectangle())
|
.contentShape(Rectangle())
|
||||||
|
|
||||||
.onAppear {
|
.onAppear {
|
||||||
if item.section == .history {
|
if item.section == .history {
|
||||||
reloadVisibleWatches()
|
reloadVisibleWatches()
|
||||||
@ -165,7 +164,7 @@ struct FavoriteItemView: View {
|
|||||||
.prefix(favoritesModel.limit(item))
|
.prefix(favoritesModel.limit(item))
|
||||||
)
|
)
|
||||||
let last = watches.last
|
let last = watches.last
|
||||||
watches.forEach { watch in
|
for watch in watches {
|
||||||
player.loadHistoryVideoDetails(watch) {
|
player.loadHistoryVideoDetails(watch) {
|
||||||
guard let video = player.historyVideo(watch.videoID), itemVisible(.init(video: video)) else { return }
|
guard let video = player.historyVideo(watch.videoID), itemVisible(.init(video: video)) else { return }
|
||||||
visibleWatches.append(watch)
|
visibleWatches.append(watch)
|
||||||
|
@ -142,7 +142,6 @@ struct PlaybackSettings: View {
|
|||||||
}
|
}
|
||||||
.animation(nil, value: player.activeBackend)
|
.animation(nil, value: player.activeBackend)
|
||||||
.frame(alignment: .topLeading)
|
.frame(alignment: .topLeading)
|
||||||
|
|
||||||
.ignoresSafeArea(.all, edges: .bottom)
|
.ignoresSafeArea(.all, edges: .bottom)
|
||||||
.backport
|
.backport
|
||||||
.playbackSettingsPresentationDetents()
|
.playbackSettingsPresentationDetents()
|
||||||
@ -235,7 +234,6 @@ struct PlaybackSettings: View {
|
|||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
.padding(12)
|
.padding(12)
|
||||||
.frame(width: 40, height: 40)
|
.frame(width: 40, height: 40)
|
||||||
|
|
||||||
.background(RoundedRectangle(cornerRadius: 4).strokeBorder(Color.accentColor, lineWidth: 1))
|
.background(RoundedRectangle(cornerRadius: 4).strokeBorder(Color.accentColor, lineWidth: 1))
|
||||||
.contentShape(Rectangle())
|
.contentShape(Rectangle())
|
||||||
#endif
|
#endif
|
||||||
@ -261,7 +259,6 @@ struct PlaybackSettings: View {
|
|||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
.padding(12)
|
.padding(12)
|
||||||
.frame(width: 40, height: 40)
|
.frame(width: 40, height: 40)
|
||||||
|
|
||||||
.background(RoundedRectangle(cornerRadius: 4).strokeBorder(Color.accentColor, lineWidth: 1))
|
.background(RoundedRectangle(cornerRadius: 4).strokeBorder(Color.accentColor, lineWidth: 1))
|
||||||
.contentShape(Rectangle())
|
.contentShape(Rectangle())
|
||||||
#endif
|
#endif
|
||||||
|
@ -57,7 +57,6 @@ import SwiftUI
|
|||||||
}
|
}
|
||||||
.indicator(.activity)
|
.indicator(.activity)
|
||||||
.frame(width: Self.thumbnailWidth, height: Self.thumbnailHeight)
|
.frame(width: Self.thumbnailWidth, height: Self.thumbnailHeight)
|
||||||
|
|
||||||
.mask(RoundedRectangle(cornerRadius: 6))
|
.mask(RoundedRectangle(cornerRadius: 6))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ struct ChaptersView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if !os(tvOS)
|
#if !os(tvOS)
|
||||||
private func chapterViews(for chaptersToShow: ArraySlice<Chapter>, opacity: Double = 1.0, clickable: Bool = true, scrollViewProxy: ScrollViewProxy? = nil) -> some View {
|
private func chapterViews(for chaptersToShow: ArraySlice<Chapter>, opacity: Double = 1.0, clickable: Bool = true, scrollViewProxy _: ScrollViewProxy? = nil) -> some View {
|
||||||
ForEach(Array(chaptersToShow.indices), id: \.self) { index in
|
ForEach(Array(chaptersToShow.indices), id: \.self) { index in
|
||||||
let chapter = chaptersToShow[index]
|
let chapter = chaptersToShow[index]
|
||||||
ChapterView(chapter: chapter, chapterIndex: index, showThumbnail: showThumbnails)
|
ChapterView(chapter: chapter, chapterIndex: index, showThumbnail: showThumbnails)
|
||||||
|
@ -88,7 +88,7 @@ struct VideoDescription: View {
|
|||||||
var formattedString: AttributedString {
|
var formattedString: AttributedString {
|
||||||
var attrString = AttributedString(description)
|
var attrString = AttributedString(description)
|
||||||
let words = description.unicodeScalars.split(whereSeparator: separators.contains).map(String.init)
|
let words = description.unicodeScalars.split(whereSeparator: separators.contains).map(String.init)
|
||||||
words.forEach { word in
|
for word in words {
|
||||||
if word.hasPrefix("https://") || word.hasPrefix("http://"), let url = URL(string: String(word)) {
|
if word.hasPrefix("https://") || word.hasPrefix("http://"), let url = URL(string: String(word)) {
|
||||||
if let range = attrString.range(of: word) {
|
if let range = attrString.range(of: word) {
|
||||||
attrString[range].link = url
|
attrString[range].link = url
|
||||||
|
@ -263,7 +263,6 @@ struct VideoPlayerView: View {
|
|||||||
#else
|
#else
|
||||||
GeometryReader { geometry in
|
GeometryReader { geometry in
|
||||||
player.playerBackendView
|
player.playerBackendView
|
||||||
|
|
||||||
.modifier(
|
.modifier(
|
||||||
VideoPlayerSizeModifier(
|
VideoPlayerSizeModifier(
|
||||||
geometry: geometry,
|
geometry: geometry,
|
||||||
|
@ -198,7 +198,7 @@ struct PlaylistFormView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
Button(self.visibility.name) {
|
Button(visibility.name) {
|
||||||
self.visibility = self.visibility.next()
|
self.visibility = self.visibility.next()
|
||||||
}
|
}
|
||||||
.contextMenu {
|
.contextMenu {
|
||||||
|
@ -61,23 +61,23 @@ struct HistorySettings: View {
|
|||||||
Toggle("Save history of played videos", isOn: $saveHistory)
|
Toggle("Save history of played videos", isOn: $saveHistory)
|
||||||
Toggle("Show recents in sidebar", isOn: $showRecents)
|
Toggle("Show recents in sidebar", isOn: $showRecents)
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
HStack {
|
HStack {
|
||||||
Toggle("Limit recents shown", isOn: $limitRecents)
|
Toggle("Limit recents shown", isOn: $limitRecents)
|
||||||
.frame(minWidth: 140, alignment: .leading)
|
.frame(minWidth: 140, alignment: .leading)
|
||||||
.disabled(!showRecents)
|
.disabled(!showRecents)
|
||||||
Spacer()
|
Spacer()
|
||||||
counterButtons(for: $limitRecentsAmount)
|
counterButtons(for: $limitRecentsAmount)
|
||||||
.disabled(!limitRecents)
|
.disabled(!limitRecents)
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
Toggle("Limit recents shown", isOn: $limitRecents)
|
Toggle("Limit recents shown", isOn: $limitRecents)
|
||||||
.disabled(!showRecents)
|
.disabled(!showRecents)
|
||||||
HStack {
|
HStack {
|
||||||
Text("Recents shown")
|
Text("Recents shown")
|
||||||
Spacer()
|
Spacer()
|
||||||
counterButtons(for: $limitRecentsAmount)
|
counterButtons(for: $limitRecentsAmount)
|
||||||
.disabled(!limitRecents)
|
.disabled(!limitRecents)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
Toggle("Show progress of watching on thumbnails", isOn: $showWatchingProgress)
|
Toggle("Show progress of watching on thumbnails", isOn: $showWatchingProgress)
|
||||||
.disabled(!saveHistory)
|
.disabled(!saveHistory)
|
||||||
@ -196,7 +196,7 @@ struct HistorySettings: View {
|
|||||||
private func counterButtons(for _value: Binding<Int>) -> some View {
|
private func counterButtons(for _value: Binding<Int>) -> some View {
|
||||||
var value: Binding<Int> {
|
var value: Binding<Int> {
|
||||||
Binding(
|
Binding(
|
||||||
get: { return _value.wrappedValue },
|
get: { _value.wrappedValue },
|
||||||
set: {
|
set: {
|
||||||
if $0 < 1 {
|
if $0 < 1 {
|
||||||
_value.wrappedValue = 1
|
_value.wrappedValue = 1
|
||||||
|
@ -68,7 +68,7 @@ struct HomeSettings: View {
|
|||||||
}
|
}
|
||||||
.help("Add to Favorites")
|
.help("Add to Favorites")
|
||||||
#if !os(tvOS)
|
#if !os(tvOS)
|
||||||
.buttonStyle(.borderless)
|
.buttonStyle(.borderless)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,6 @@ struct PlayerControlsSettings: View {
|
|||||||
TextField("Duration", text: value)
|
TextField("Duration", text: value)
|
||||||
.frame(width: textFieldWidth, alignment: .trailing)
|
.frame(width: textFieldWidth, alignment: .trailing)
|
||||||
.multilineTextAlignment(.center)
|
.multilineTextAlignment(.center)
|
||||||
|
|
||||||
.labelsHidden()
|
.labelsHidden()
|
||||||
#if !os(macOS)
|
#if !os(macOS)
|
||||||
.keyboardType(.numberPad)
|
.keyboardType(.numberPad)
|
||||||
|
@ -48,7 +48,6 @@ struct QualityProfileForm: View {
|
|||||||
|
|
||||||
.onAppear(perform: initializeForm)
|
.onAppear(perform: initializeForm)
|
||||||
.onChange(of: backend, perform: { _ in backendChanged(self.backend); updateActiveFormats(); validate() })
|
.onChange(of: backend, perform: { _ in backendChanged(self.backend); updateActiveFormats(); validate() })
|
||||||
|
|
||||||
.onChange(of: name, perform: { _ in validate() })
|
.onChange(of: name, perform: { _ in validate() })
|
||||||
.onChange(of: resolution, perform: { _ in validate() })
|
.onChange(of: resolution, perform: { _ in validate() })
|
||||||
.onChange(of: orderedFormats, perform: { _ in validate() })
|
.onChange(of: orderedFormats, perform: { _ in validate() })
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import Defaults
|
import Defaults
|
||||||
import Foundation
|
import Foundation
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct SettingsView: View {
|
struct SettingsView: View {
|
||||||
static let matrixURL = URL(string: "https://tinyurl.com/matrix-yattee")!
|
static let matrixURL = URL(string: "https://tinyurl.com/matrix-yattee")!
|
||||||
static let discordURL = URL(string: "https://yattee.stream/discord")!
|
static let discordURL = URL(string: "https://yattee.stream/discord")!
|
||||||
|
@ -176,7 +176,7 @@ struct URLParser {
|
|||||||
private func removePrefixes(_ value: String, _ prefixes: [String]) -> String {
|
private func removePrefixes(_ value: String, _ prefixes: [String]) -> String {
|
||||||
var value = value
|
var value = value
|
||||||
|
|
||||||
prefixes.forEach { prefix in
|
for prefix in prefixes {
|
||||||
if value.hasPrefix(prefix) {
|
if value.hasPrefix(prefix) {
|
||||||
value.removeFirst(prefix.count)
|
value.removeFirst(prefix.count)
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ extension UIView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func viewsInHierarchy<ViewType: UIView>(views: inout [ViewType]) {
|
private func viewsInHierarchy<ViewType: UIView>(views: inout [ViewType]) {
|
||||||
subviews.forEach { eachSubView in
|
for eachSubView in subviews {
|
||||||
if let matchingView = eachSubView as? ViewType {
|
if let matchingView = eachSubView as? ViewType {
|
||||||
views.append(matchingView)
|
views.append(matchingView)
|
||||||
}
|
}
|
||||||
|
@ -19,8 +19,8 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
|
|||||||
#endif
|
#endif
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
|
func application(_: UIApplication, open url: URL, options _: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
|
||||||
if url.scheme == "yattee" {
|
if url.scheme == "yattee" {
|
||||||
OpenURLHandler.handle(url)
|
OpenURLHandler.handle(url)
|
||||||
return true
|
return true
|
||||||
|
@ -153,7 +153,6 @@ struct InstancesSettings: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.frame(minWidth: 0, maxWidth: .infinity, alignment: .leading)
|
.frame(minWidth: 0, maxWidth: .infinity, alignment: .leading)
|
||||||
|
|
||||||
.onAppear {
|
.onAppear {
|
||||||
selectedInstanceID = instances.first?.id
|
selectedInstanceID = instances.first?.id
|
||||||
frontendURL = selectedInstanceFrontendURL
|
frontendURL = selectedInstanceFrontendURL
|
||||||
|
@ -31,7 +31,7 @@ struct VerticalScrollingFixWrapper<Content>: View where Content: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VerticalScrollingFixViewRepresentable(content: self.content())
|
VerticalScrollingFixViewRepresentable(content: content())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user