Skip to content

Commit

Permalink
feat: 增加应用插件创建语句
Browse files Browse the repository at this point in the history
  • Loading branch information
QingXia-Ela committed Jul 24, 2024
1 parent c64eb7b commit b3616c9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src-tauri/src/plugin_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ impl PluginManager {
}

pub fn list_plugins(dir: Option<String>) -> Result<Vec<String>, std::io::Error> {
// ensure dir is exist
let _ = std::fs::create_dir_all("plugins");
let dirs = std::fs::read_dir(dir.unwrap_or_else(|| "plugins".to_string()))?;

let mut plugins = Vec::new();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,14 @@ impl CustomPlaylistManager {
}

/// playlist_id should include namespace
// todo!: 过滤掉命名空间不存在的歌曲
pub async fn get_playlist(&self, playlist_id: &String) -> Option<SinglePlaylistInfo> {
// todo!: add fetch from disk
self.data.lock().await.get(playlist_id).map(|x| x.clone())
}

// This method is call in high frequency, need to optimize
// todo!: 过滤掉命名空间不存在的歌曲
pub async fn get_all_playlists(&self, force_refresh: bool) -> Vec<SinglePlaylistInfo> {
// todo!: add fetch from disk
let mut time_lock = GLOBAL_DISK_UPDATE_TIME.lock().await;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/playlist/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Styles from './index.module.scss';
import LeftList from './components/LeftList';
import RightDetails from './components/RightDetails';

interface PlayListProps extends RouterCombineProps { }
interface PlayListProps extends RouterCombineProps {}

const PlayList: FunctionComponent<PlayListProps> = ({ active, ...props }) => {
// first active always show
Expand Down

0 comments on commit b3616c9

Please sign in to comment.