mirror of
https://github.com/yattee/yattee.git
synced 2025-12-20 19:50:19 +00:00
View options, video details screen
This commit is contained in:
32
Model/SearchSortOrder.swift
Normal file
32
Model/SearchSortOrder.swift
Normal file
@@ -0,0 +1,32 @@
|
||||
import Defaults
|
||||
import Foundation
|
||||
|
||||
enum SearchSortOrder: String, CaseIterable, Identifiable, DefaultsSerializable {
|
||||
case relevance, rating, uploadDate, viewCount
|
||||
|
||||
var id: SearchSortOrder.RawValue {
|
||||
rawValue
|
||||
}
|
||||
|
||||
var name: String {
|
||||
switch self {
|
||||
case .uploadDate:
|
||||
return "Upload Date"
|
||||
case .viewCount:
|
||||
return "View Count"
|
||||
default:
|
||||
return rawValue.capitalized
|
||||
}
|
||||
}
|
||||
|
||||
var parameter: String {
|
||||
switch self {
|
||||
case .uploadDate:
|
||||
return "upload_date"
|
||||
case .viewCount:
|
||||
return "view_count"
|
||||
default:
|
||||
return rawValue
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user