mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-27 09:12:35 +01:00
refactored api functions
This commit is contained in:
@@ -20,6 +20,7 @@ use std::time::Duration;
|
||||
use tokio::sync::broadcast;
|
||||
use tokio_stream::wrappers::BroadcastStream;
|
||||
use url::Url;
|
||||
use crate::model::playlist::PlaylistItemType;
|
||||
|
||||
pub async fn serve_file(file_path: &Path, req: &HttpRequest, mime_type: mime::Mime) -> HttpResponse {
|
||||
if file_path.exists() {
|
||||
@@ -204,3 +205,7 @@ async fn shared_stream_response(app_state: &AppState, stream_url: &str) -> Optio
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
pub fn is_stream_share_enabled(item_type: PlaylistItemType, target: &ConfigTarget) -> bool {
|
||||
item_type == PlaylistItemType::Live && target.options.as_ref().map_or(false, |opt| opt.share_live_streams)
|
||||
}
|
||||
Reference in New Issue
Block a user