mirror of
https://github.com/yattee/yattee.git
synced 2026-05-12 18:35:05 +00:00
Tapping bit.ly/tinyurl/t.co/etc. in a description or comment previously opened Safari even when the destination was a playable YouTube URL. Added an opt-in "Resolve Short Links" toggle under YouTube Enhancements (off by default) that follows the redirect on tap: if the target is a YouTube/PeerTube/direct-media URL, open it in-app; otherwise prompt the user before falling back to yt-dlp extraction or the browser. Also added a confirmation dialog for non-shortener links that only matched the loose .externalVideo yt-dlp fallback, so arbitrary web pages in descriptions no longer silently kick off extraction. Prompts live on NavigationCoordinator and are dual-hosted by YatteeApp and ExpandedPlayerSheet so they remain visible whether or not the expanded player is covering the main view.
26 lines
1.1 KiB
Swift
26 lines
1.1 KiB
Swift
//
|
|
// Notifications.swift
|
|
// Yattee
|
|
//
|
|
// App-wide notification names.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
extension Notification.Name {
|
|
static let showSettings = Notification.Name("showSettings")
|
|
static let showOpenLinkSheet = Notification.Name("showOpenLinkSheet")
|
|
static let openDescriptionLink = Notification.Name("openDescriptionLink")
|
|
/// Posted when a URL shortener (bit.ly, etc.) has been resolved to an
|
|
/// ambiguous destination — the app isn't certain it can play it, so the
|
|
/// user is prompted whether to try opening it in Yattee or in the browser.
|
|
/// `object` is the resolved `URL`.
|
|
static let promptResolvedShortLink = Notification.Name("promptResolvedShortLink")
|
|
/// Posted when a tapped link is not confidently a video (no YouTube /
|
|
/// PeerTube / direct-media match) but could potentially be extracted via
|
|
/// the Yattee server / yt-dlp. User is prompted whether to try extracting
|
|
/// or open it in the system browser instead.
|
|
/// `object` is the candidate `URL`.
|
|
static let promptAmbiguousExternalLink = Notification.Name("promptAmbiguousExternalLink")
|
|
}
|