Skip to content

Commit 72eebc1

Browse files
committed
fix bugs
1 parent 5827f0b commit 72eebc1

File tree

5 files changed

+37
-17
lines changed

5 files changed

+37
-17
lines changed

flatpak/dev.fredol.open-tv.metainfo.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
</categories>
3030
<launchable type="desktop-id">dev.fredol.open-tv.desktop</launchable>
3131
<releases>
32-
<release version="1.3.1" date="2025-01-13">
32+
<release version="1.4.1" date="2025-01-22">
3333
<description>
3434
<p>
3535
Please see the official changelog at github.com/fredolx/open-tv/releases

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "open-tv",
3-
"version": "1.4.0",
3+
"version": "1.4.1",
44
"scripts": {
55
"ng": "ng",
66
"tauri": "tauri",
@@ -49,4 +49,4 @@
4949
"karma-jasmine-html-reporter": "~2.1.0",
5050
"typescript": "~5.4.2"
5151
}
52-
}
52+
}

src-tauri/src/mpv.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,10 @@ fn set_headers(headers: Option<ChannelHttpHeaders>, args: &mut Vec<String>) {
126126
args.push(ARG_IGNORE_SSL.to_string());
127127
}
128128
}
129-
let headers = headers_vec.join(",");
130-
args.push(format!("{ARG_HTTP_HEADERS}{headers}"));
129+
if headers_vec.len() > 0 {
130+
let headers = headers_vec.join(",");
131+
args.push(format!("{ARG_HTTP_HEADERS}{headers}"));
132+
}
131133
}
132134

133135
fn get_path(path_str: String) -> String {

src-tauri/src/restream.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::{
2+
os::windows::process::CommandExt,
23
path::{Path, PathBuf},
34
process::{Child, Command, Stdio},
45
time::Duration,
@@ -24,14 +25,12 @@ use crate::{
2425

2526
const WAN_IP_API: &str = "https://api.ipify.org";
2627
const FFMPEG_BIN_NAME: &str = "ffmpeg";
28+
const CREATE_NO_WINDOW: u32 = 0x08000000;
2729

2830
fn start_ffmpeg_listening(channel: Channel, restream_dir: PathBuf) -> Result<Child> {
2931
let headers = sql::get_channel_headers_by_id(channel.id.context("no channel id")?)?;
3032
let playlist_dir = get_playlist_dir(restream_dir);
3133
let mut command = Command::new(get_bin(FFMPEG_BIN_NAME));
32-
command
33-
.arg("-i")
34-
.arg(channel.url.context("no channel url")?);
3534
if let Some(headers) = headers {
3635
if let Some(referrer) = headers.referrer {
3736
command.arg("-headers");
@@ -52,7 +51,11 @@ fn start_ffmpeg_listening(channel: Channel, restream_dir: PathBuf) -> Result<Chi
5251
}
5352
}
5453
}
54+
#[cfg(target_os = "windows")]
55+
command.creation_flags(CREATE_NO_WINDOW);
5556
let child = command
57+
.arg("-i")
58+
.arg(channel.url.context("no channel url")?)
5659
.arg("-c")
5760
.arg("copy")
5861
.arg("-f")
@@ -76,7 +79,6 @@ fn start_ffmpeg_listening(channel: Channel, restream_dir: PathBuf) -> Result<Chi
7679
.arg(playlist_dir)
7780
.stdout(Stdio::null())
7881
.stderr(Stdio::null())
79-
.stdin(Stdio::null())
8082
.spawn()?;
8183
Ok(child)
8284
}

src-tauri/tauri.conf.json

+24-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"productName": "Open TV",
3-
"version": "1.4.0",
3+
"version": "1.4.1",
44
"identifier": "dev.fredol.open-tv",
55
"build": {
66
"frontendDist": "../dist/open-tv/browser",
@@ -11,7 +11,7 @@
1111
"app": {
1212
"windows": [
1313
{
14-
"title": "Open TV (v1.4.0)",
14+
"title": "Open TV (v1.4.1)",
1515
"width": 800,
1616
"height": 600,
1717
"resizable": true,
@@ -35,19 +35,35 @@
3535
"windows": {
3636
"wix": {
3737
"language": "en-US",
38-
"fragmentPaths": ["./windows/fragments/deps.wxs"],
39-
"componentGroupRefs": ["DependencyComponents"],
40-
"componentRefs": ["MpvComponent", "FfmpegComponent", "YtDlpComponent"]
38+
"fragmentPaths": [
39+
"./windows/fragments/deps.wxs"
40+
],
41+
"componentGroupRefs": [
42+
"DependencyComponents"
43+
],
44+
"componentRefs": [
45+
"MpvComponent",
46+
"FfmpegComponent",
47+
"YtDlpComponent"
48+
]
4149
}
4250
},
4351
"linux": {
4452
"deb": {
45-
"depends": ["mpv", "ffmpeg", "yt-dlp"]
53+
"depends": [
54+
"mpv",
55+
"ffmpeg",
56+
"yt-dlp"
57+
]
4658
},
4759
"rpm": {
48-
"depends": ["mpv", "ffmpeg", "yt-dlp"]
60+
"depends": [
61+
"mpv",
62+
"ffmpeg",
63+
"yt-dlp"
64+
]
4965
}
5066
}
5167
},
5268
"$schema": "../node_modules/@tauri-apps/cli/schema.json"
53-
}
69+
}

0 commit comments

Comments
 (0)