Skip to content
Open

W3u #218

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 23 additions & 55 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tauri-build = { version = "2.1.0", features = [] }

[dependencies]
serde_json = "1.0.140"
rusqlite = { version = "0.32.1", features = ["bundled"] }
rusqlite = { version = "0.35.0", features = ["bundled"] }
serde = { version = "1.0.219", features = ["derive"] }
tauri = { version = "2.4.0", features = ["tray-icon"] }
anyhow = { version = "1.0.97" }
Expand All @@ -28,7 +28,7 @@ directories = "6.0.0"
reqwest = { version = "0.12.15", features = ["json"] }
tokio = { version = "1.44.1", features = ["full"] }
url = "2.5.4"
r2d2_sqlite = "0.25.0"
r2d2_sqlite = "0.28.0"
r2d2 = "0.8.10"
bytes = "1.10.1"
tauri-plugin-dialog = "2.2.0"
Expand All @@ -38,7 +38,7 @@ tauri-plugin-clipboard-manager = "2.2.2"
tauri-plugin-shell = "2.2.0"
simplelog = "0.12.2"
log = "0.4.27"
rusqlite_migration = "1.3.1"
rusqlite_migration = "2.1.0"
base64 = "0.22.1"
tauri-plugin-notification = "2.2.2"
warp = "0.3.7"
Expand Down
25 changes: 21 additions & 4 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub mod sql;
pub mod types;
pub mod utils;
pub mod view_type;
pub mod w3u;
pub mod xtream;

static ENABLE_TRAY_ICON: LazyLock<bool> = LazyLock::new(|| {
Expand Down Expand Up @@ -103,7 +104,9 @@ pub fn run() {
restore_favs,
abort_download,
clear_history,
is_container
is_container,
get_w3u,
get_w3u_from_link
])
.setup(|app| {
app.manage(Mutex::new(AppState {
Expand Down Expand Up @@ -184,9 +187,11 @@ fn map_err_frontend(e: Error) -> String {
return format!("{:?}", e);
}

#[tauri::command(async)]
fn get_m3u8(source: Source) -> Result<(), String> {
m3u::read_m3u8(source, false).map_err(map_err_frontend)
#[tauri::command]
async fn get_m3u8(source: Source) -> Result<(), String> {
m3u::read_m3u8(source, false)
.await
.map_err(map_err_frontend)
}

#[tauri::command]
Expand Down Expand Up @@ -526,3 +531,15 @@ fn clear_history() -> Result<(), String> {
fn is_container() -> bool {
utils::is_container()
}

#[tauri::command]
async fn get_w3u(source: Source) -> Result<(), String> {
w3u::read_w3u(source, false).await.map_err(map_err_frontend)
}

#[tauri::command]
async fn get_w3u_from_link(source: Source) -> Result<(), String> {
w3u::get_w3u_from_link(source, false)
.await
.map_err(map_err_frontend)
}
Loading
Loading