set correct playlist plath, get playlist in read mode
This commit is contained in:
parent
e184003e67
commit
f023445d60
@ -62,6 +62,7 @@ pub fn read_json(
|
|||||||
let mut current_file: String = playlist_path.as_path().display().to_string();
|
let mut current_file: String = playlist_path.as_path().display().to_string();
|
||||||
|
|
||||||
if let Some(p) = path {
|
if let Some(p) = path {
|
||||||
|
playlist_path = Path::new(&p).to_owned();
|
||||||
current_file = p
|
current_file = p
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +74,11 @@ pub fn read_json(
|
|||||||
|
|
||||||
info!("Read Playlist: <b><magenta>{}</></b>", ¤t_file);
|
info!("Read Playlist: <b><magenta>{}</></b>", ¤t_file);
|
||||||
|
|
||||||
let f = File::open(¤t_file).expect("Could not open json playlist file.");
|
let f = File::options()
|
||||||
|
.read(true)
|
||||||
|
.write(false)
|
||||||
|
.open(¤t_file)
|
||||||
|
.expect("Could not open json playlist file.");
|
||||||
let mut playlist: Playlist =
|
let mut playlist: Playlist =
|
||||||
serde_json::from_reader(f).expect("Could not read json playlist file.");
|
serde_json::from_reader(f).expect("Could not read json playlist file.");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user