Fix playlist filepath generation to ignore already-absolute paths
This commit is contained in:
parent
9a3919754e
commit
17057accc2
1 changed files with 23 additions and 7 deletions
|
@ -395,14 +395,30 @@ impl FilesystemExecutor {
|
|||
let path = path.as_ref();
|
||||
index += 1;
|
||||
let item_path = if let Some(parent) = path.parent() {
|
||||
let joined_path = parent.join(&segment.uri);
|
||||
if let Some(s) = joined_path.to_str() {
|
||||
s.to_owned()
|
||||
if segment.uri.starts_with('/') {
|
||||
format!("file://{}", segment.uri)
|
||||
} else if segment.uri.starts_with("file:///") {
|
||||
segment.uri.clone()
|
||||
} else if segment.uri.starts_with("file://") {
|
||||
let joined_path = parent.join(&segment.uri.strip_prefix("file://").unwrap());
|
||||
if let Some(s) = joined_path.to_str() {
|
||||
s.to_owned()
|
||||
} else {
|
||||
return Some(Err(RuntimeMsg(format!(
|
||||
"Failed to convert path to string for `{}`",
|
||||
joined_path.display()
|
||||
))));
|
||||
}
|
||||
} else {
|
||||
return Some(Err(RuntimeMsg(format!(
|
||||
"Failed to convert path to string for `{}`",
|
||||
joined_path.display()
|
||||
))));
|
||||
let joined_path = parent.join(&segment.uri);
|
||||
if let Some(s) = joined_path.to_str() {
|
||||
s.to_owned()
|
||||
} else {
|
||||
return Some(Err(RuntimeMsg(format!(
|
||||
"Failed to convert path to string for `{}`",
|
||||
joined_path.display()
|
||||
))));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
segment.uri.clone()
|
||||
|
|
Loading…
Reference in a new issue