un-gate media feature

pull/22/head
chris west 4 years ago
parent 1359a4eb49
commit b6cea29372

@ -16,7 +16,6 @@ exclude = [
[features]
tls = ["native-tls"]
tor = ["tor-stream"]
media = []
default = ["tls", "tor"]
[profile.release]

@ -125,13 +125,11 @@ To enable just TLS support, or just Tor support, use `--features`:
## media player support
phetch includes experimental support for opening video files (`;` item
type) and sound files (`s` item type) in [mpv]. To test it out,
compile phetch using the `--features media` flag and then visit a
compatible Gopher server (maybe one using [gophor]?). Or check out the
"gopher types" help page by pressing `ctrl-h` then `3` in phetch:
cargo run --features media gopher://phetch/1/help/types
phetch includes support for opening video files (`;` item type) and
sound files (`s` item type) in [mpv] or an application of your choice
using the `-m` command line flag. To test it out, visit a compatible
Gopher server (maybe one using [Gophor]?). Or check out the "gopher
types" help page by pressing `ctrl-h` then `3` in phetch.
## todo

@ -76,13 +76,6 @@ impl Type {
}
}
#[cfg(not(feature = "media"))]
/// Does nothing without the 'media' feature.
pub fn is_media(self) -> bool {
false
}
#[cfg(feature = "media")]
/// Check if media to open in player
pub fn is_media(self) -> bool {
match self {

@ -239,39 +239,6 @@ i# show emoji status indicators
iemoji no
";
#[cfg(not(feature = "media"))]
const TYPES: &str = "
i ** gopher types **
i
iphetch supports these links:
i
0text files /Mirrors/RFC/rfc1436.txt fnord.one 65446
1menu items /lawn/ascii bitreich.org
3errors /help/types phetch
7search servers / forthworks.com 7001
8telnet links /help/types phetch
hexternal urls URL:https://en.wikipedia.org/wiki/Phetch phetch
i
iand these download types:
i
4binhex /help/types phetch
5dosfiles /help/types phetch
6uuencoded files /help/types phetch
9binaries /help/types phetch
gGIFs /help/types phetch
Iimages downloads /help/types phetch
ssound files /help/types phetch
ddocuments /help/types phetch
i
iphetch does not support:
i
2CSO Entries /help/types phetch
+Mirrors /help/types phetch
TTelnet3270 /help/types phetch
i
";
#[cfg(feature = "media")]
const TYPES: &str = "
i ** gopher types **
i

@ -188,7 +188,6 @@ impl UI {
// binary downloads
let typ = gopher::type_for_url(url);
#[cfg(feature = "media")]
if typ.is_media() {
self.dirty = true;
return if self.confirm(&format!("Open in media player? {}", url)) {

@ -96,7 +96,6 @@ pub fn open_external(url: &str) -> Result<()> {
}
}
#[cfg(feature = "media")]
/// Opens a media file with `mpv`.
pub fn open_media(url: &str) -> Result<()> {
use {crate::terminal, std::io};

Loading…
Cancel
Save