mirror of
https://github.com/yattee/yattee.git
synced 2026-02-20 01:39:46 +00:00
Yattee v2 rewrite
This commit is contained in:
18
Yattee/Extensions/Video+DeArrow.swift
Normal file
18
Yattee/Extensions/Video+DeArrow.swift
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// Video+DeArrow.swift
|
||||
// Yattee
|
||||
//
|
||||
// Extension for DeArrow title resolution on Video.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Video {
|
||||
/// Returns the DeArrow-replaced title if available, otherwise the original title.
|
||||
///
|
||||
/// Usage: `video.displayTitle(using: appEnvironment?.deArrowBrandingProvider)`
|
||||
@MainActor
|
||||
func displayTitle(using provider: DeArrowBrandingProvider?) -> String {
|
||||
provider?.title(for: self) ?? title
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user