Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev'
Browse files Browse the repository at this point in the history
# Conflicts:
#	src-tauri/Cargo.lock
#	src-tauri/Cargo.toml
  • Loading branch information
Chikage0o0 committed May 31, 2023
2 parents f6d4779 + 0f866dc commit 737e280
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src-tauri/src/controller/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ pub fn send_storage_notification(file_name: &str) {
}

let context = tauri::generate_context!();
Notification::new(&context.config().tauri.bundle.identifier)
let _ = Notification::new(&context.config().tauri.bundle.identifier)
.title(title)
.body(format!("{}", file_name))
.show()
.unwrap();
.show();
}
2 changes: 1 addition & 1 deletion src-tauri/src/controller/setting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ pub fn get_setting() -> Setting {
}

#[tauri::command]
pub fn save_setting(setting: Setting) -> Result<(), SettingError> {
pub async fn save_setting(setting: Setting) -> Result<(), SettingError> {
Setting::apply(setting)
}
9 changes: 6 additions & 3 deletions src-tauri/src/controller/subscribe_rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,20 @@ impl From<(Key, Value)> for SubscribeRule {
}

#[tauri::command]
pub fn get_subscribe_rules() -> Vec<SubscribeRule> {
pub async fn get_subscribe_rules() -> Vec<SubscribeRule> {
list().into_iter().map(|x| SubscribeRule::from(x)).collect()
}

#[tauri::command]
pub fn delete_subscribe_rule(id: String, provider: ProviderKnown) -> Result<(), String> {
pub async fn delete_subscribe_rule(id: String, provider: ProviderKnown) -> Result<(), String> {
subscribe::remove(Key { id, provider }).map_err(|e| e.to_string())
}

#[tauri::command]
pub fn get_subscribe_rule(id: String, provider: ProviderKnown) -> Result<SubscribeRule, String> {
pub async fn get_subscribe_rule(
id: String,
provider: ProviderKnown,
) -> Result<SubscribeRule, String> {
let key = Key { id, provider };
let value = key.get().map_err(|e| e.to_string())?;
Ok(SubscribeRule::from((key, value)))
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/controller/unrecognized_videos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn refresh_unrecognized_videos_list() -> Result<(), String> {
}

#[tauri::command]
pub fn delete_unrecognized_video_info(path: PathBuf) -> Result<(), String> {
pub async fn delete_unrecognized_video_info(path: PathBuf) -> Result<(), String> {
crate::service::unrecognized_videos::delete(path).map_err(|e| e.to_string())?;
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/utils/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ pub fn create_shortcut<P: AsRef<Path>>(src: P, target: P) -> Result<(), std::io:

pub fn is_video<P: AsRef<Path>>(path: P) -> bool {
let path = path.as_ref();
if !path.is_file() || path.is_symlink() || !path.exists() {
if !path.exists() || !path.is_file() || path.is_symlink() {
return false;
}
let ext = path.extension().unwrap_or_default().to_str().unwrap();
Expand Down

0 comments on commit 737e280

Please sign in to comment.