Respect options passed by ff2mpv extension #12

Merged
eNV25 merged 2 commits from pr/use-args into main 2024-02-16 09:33:12 +01:00
2 changed files with 9 additions and 5 deletions

View file

@ -8,6 +8,7 @@ use crate::error::FF2MpvError;
#[derive(Deserialize)] #[derive(Deserialize)]
pub struct FF2MpvMessage { pub struct FF2MpvMessage {
pub url: String, pub url: String,
pub options: Vec<String>,
} }
pub fn send_reply() -> Result<(), io::Error> { pub fn send_reply() -> Result<(), io::Error> {

View file

@ -12,10 +12,9 @@ pub enum Command {
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
ShowManifest, ShowManifest,
ShowManifestChromium, ShowManifestChromium,
ValidateConfig, ValidateConfig,
FF2Mpv FF2Mpv,
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
} }
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
impl Command { impl Command {
pub fn execute(&self) -> Result<(), FF2MpvError> { pub fn execute(&self) -> Result<(), FF2MpvError> {
match self { match self {
@ -23,7 +22,7 @@ impl Command {
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
Command::ShowManifest => Self::show_manifest(false), Command::ShowManifest => Self::show_manifest(false),
Command::ShowManifestChromium => Self::show_manifest(true), Command::ShowManifestChromium => Self::show_manifest(true),
Command::ValidateConfig => Self::validate_config(), Command::ValidateConfig => Self::validate_config(),
Command::FF2Mpv => Self::ff2mpv() Command::FF2Mpv => Self::ff2mpv(),
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
} }
} }
@ -43,7 +42,10 @@ impl Command {
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
fn show_manifest(chromium: bool) -> Result<(), FF2MpvError> { fn show_manifest(chromium: bool) -> Result<(), FF2MpvError> {
let executable_path = env::current_exe()?; let executable_path = env::current_exe()?;
let allowed_keyvalue = if chromium { let allowed_keyvalue = if chromium {
("allowed_origins", "chrome-extension://ephjcajbkgplkjmelpglennepbpmdpjg") (
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
"allowed_origins",
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
"chrome-extension://ephjcajbkgplkjmelpglennepbpmdpjg",
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
)
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
} else { } else {
("allowed_extensions", "ff2mpv@yossarian.net") ("allowed_extensions", "ff2mpv@yossarian.net")
}; };
@ -72,7 +74,8 @@ impl Command {
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
fn ff2mpv() -> Result<(), FF2MpvError> { fn ff2mpv() -> Result<(), FF2MpvError> {
let config = Config::build(); let config = Config::build();
let ff2mpv_message = browser::get_mpv_message()?; let ff2mpv_message = browser::get_mpv_message()?;
Command::launch_mpv(config.player_command, config.player_args, &ff2mpv_message.url)?; let args = [config.player_args, ff2mpv_message.options].concat();
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
Command::launch_mpv(config.player_command, args, &ff2mpv_message.url)?;
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
browser::send_reply()?; browser::send_reply()?;
Ok(()) Ok(())

ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```
ryze312 commented 2024-02-16 09:30:50 +01:00 (Migrated from github.com)
Review

Let's keep the order of imports as is, i.e:

  1. std
  2. External crates
  3. Local crates
use std::env;
use std::io;
use std::process;
use serde_json::{self, json};
Let's keep the order of imports as is, i.e: 1. `std` 2. External crates 3. Local crates ```suggestion use std::env; use std::io; use std::process; use serde_json::{self, json}; ```