diff --git a/redeploy.sh b/redeploy.sh deleted file mode 100755 index 553579e..0000000 --- a/redeploy.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env bash -# Rebuild and deploy the local COSMIC Media Player fork. -# -# Keep this binary in /usr/local/bin so it intentionally overrides the packaged -# /usr/bin/cosmic-player, but only after rebuilding from the current local -# source tree. - -set -euo pipefail - -REPO="${COSMIC_PLAYER_REPO:-/home/lionel/Projets/COSMIC/cosmic-player}" -TOOLCHAIN="${COSMIC_RUST_TOOLCHAIN:-1.93.0}" -PREFIX="${COSMIC_LOCAL_PREFIX:-/usr/local}" -APPID="com.system76.CosmicPlayer" -BIN_NAME="cosmic-player" - -cd "$REPO" - -echo "==> Repository: $REPO" -echo "==> Branch: $(git branch --show-current 2>/dev/null || echo unknown)" -echo "==> Build release with Rust $TOOLCHAIN" -cargo "+$TOOLCHAIN" build --release - -bin_built="$REPO/target/release/$BIN_NAME" -bin_target="$PREFIX/bin/$BIN_NAME" - -if [[ -e "$bin_target" ]]; then - backup="${bin_target}.bak.$(date +%Y%m%d-%H%M%S)" - echo "==> Backup $bin_target -> $backup" - sudo cp -a "$bin_target" "$backup" -fi - -echo "==> Install binary" -sudo install -Dm0755 "$bin_built" "$bin_target" - -echo "==> Install desktop integration" -sudo install -Dm0644 "target/xdgen/$APPID.desktop" "$PREFIX/share/applications/$APPID.desktop" -sudo install -Dm0644 "target/xdgen/$APPID.metainfo.xml" "$PREFIX/share/metainfo/$APPID.metainfo.xml" -sudo install -Dm0644 "res/$APPID.thumbnailer" "$PREFIX/share/thumbnailers/$APPID.thumbnailer" - -while IFS= read -r icon; do - rel="${icon#res/icons/hicolor/}" - sudo install -Dm0644 "$icon" "$PREFIX/share/icons/hicolor/$rel" -done < <(find "res/icons/hicolor" -type f -name "$APPID.svg" | sort) - -if command -v update-desktop-database >/dev/null 2>&1; then - echo "==> Refresh desktop database" - if [[ -w "$PREFIX/share/applications" ]]; then - update-desktop-database "$PREFIX/share/applications" || true - else - sudo -n update-desktop-database "$PREFIX/share/applications" 2>/dev/null || \ - echo " skipped: sudo authentication required" - fi -fi - -if command -v xdg-mime >/dev/null 2>&1; then - echo "==> Register common legacy video defaults" - xdg-mime default "$APPID.desktop" \ - video/mpeg \ - video/x-mpeg \ - video/x-mpeg2 \ - video/x-ms-wmv \ - video/x-ms-wm \ - video/x-ms-asf \ - application/vnd.ms-asf -fi - -echo "==> Installed version" -"$bin_target" --version - -echo "OK - COSMIC Media Player rebuilt and redeployed." diff --git a/src/main.rs b/src/main.rs index 836fc31..d9c2233 100644 --- a/src/main.rs +++ b/src/main.rs @@ -33,7 +33,6 @@ mod config; mod key_bind; mod localize; mod menu; -mod mime; #[cfg(feature = "mpris-server")] mod mpris; mod project; diff --git a/src/mime.rs b/src/mime.rs deleted file mode 100644 index dd37736..0000000 --- a/src/mime.rs +++ /dev/null @@ -1,27 +0,0 @@ -const DESKTOP_ENTRY: &str = include_str!("../res/com.system76.CosmicPlayer.desktop"); - -pub fn supported_mime_types() -> Vec { - DESKTOP_ENTRY - .lines() - .find_map(|line| line.strip_prefix("MimeType=")) - .map(|mime_types| { - mime_types - .split(';') - .filter(|mime_type| !mime_type.is_empty()) - .map(ToOwned::to_owned) - .collect() - }) - .unwrap_or_default() -} - -pub fn supported_uri_schemes() -> Vec { - supported_mime_types() - .into_iter() - .filter_map(|mime_type| { - mime_type - .strip_prefix("x-scheme-handler/") - .map(ToOwned::to_owned) - }) - .chain(["file".to_string(), "http".to_string(), "https".to_string()]) - .collect() -} diff --git a/src/mpris.rs b/src/mpris.rs index 92dfcef..8c87244 100644 --- a/src/mpris.rs +++ b/src/mpris.rs @@ -138,12 +138,12 @@ impl RootInterface for Player { async fn supported_uri_schemes(&self) -> fdo::Result> { log::info!("SupportedUriSchemes"); - Ok(crate::mime::supported_uri_schemes()) + Ok(vec![]) } async fn supported_mime_types(&self) -> fdo::Result> { log::info!("SupportedMimeTypes"); - Ok(crate::mime::supported_mime_types()) + Ok(vec![]) } } diff --git a/vendor/iced_video_player/src/pipeline.rs b/vendor/iced_video_player/src/pipeline.rs index 792c1ee..2d9d3e7 100644 --- a/vendor/iced_video_player/src/pipeline.rs +++ b/vendor/iced_video_player/src/pipeline.rs @@ -32,7 +32,7 @@ pub struct VideoPipeline { } impl VideoPipeline { - fn new(device: &wgpu::Device, format: wgpu::TextureFormat, _queue: &wgpu::Queue) -> Self { + fn new(device: &wgpu::Device, format: wgpu::TextureFormat, queue: &wgpu::Queue) -> Self { let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor { label: Some("iced_video_player shader"), source: wgpu::ShaderSource::Wgsl(include_str!("shader.wgsl").into()), @@ -417,7 +417,7 @@ impl Primitive for VideoPrimitive { device: &wgpu::Device, queue: &wgpu::Queue, bounds: &Rectangle, - _viewport: &Viewport, + viewport: &Viewport, ) { if self.upload_frame { if let Some(readable) = self.frame.lock().expect("lock frame mutex").readable() { diff --git a/vendor/iced_video_player/src/video.rs b/vendor/iced_video_player/src/video.rs index 6d174e5..48e521c 100644 --- a/vendor/iced_video_player/src/video.rs +++ b/vendor/iced_video_player/src/video.rs @@ -50,7 +50,6 @@ impl Frame { pub fn new() -> Self { Self(gst::Sample::builder().build()) } - #[allow(dead_code)] pub fn store(&mut self, sample: gst::Sample) -> Option<()> { if sample.buffer().is_some() { self.0 = sample; @@ -59,7 +58,7 @@ impl Frame { None } } - pub fn readable(&self) -> Option> { + pub fn readable(&self) -> Option> { self.0.buffer().map(|x| x.map_readable().ok()).flatten() } }