Skip to content

Commit 8d3d21c

Browse files
committed
fix: resolve cover url issue
1 parent 4fca1f5 commit 8d3d21c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

types/src/types.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -580,11 +580,15 @@ impl RemoteCoverUrl for Track {
580580

581581
impl RemoteCoverUrl for Album {
582582
fn with_remote_cover_url(&self, base_url: &str) -> Self {
583-
Self {
584-
cover: match self.cover {
585-
Some(ref cover) => Some(format!("{}/covers/{}", base_url, cover)),
586-
None => None,
583+
let cover_url = match self.cover {
584+
Some(ref cover) => match cover.starts_with("http") {
585+
true => Some(cover.to_owned()),
586+
false => Some(format!("{}/covers/{}", base_url, cover)),
587587
},
588+
None => None,
589+
};
590+
Self {
591+
cover: cover_url,
588592
tracks: self
589593
.tracks
590594
.iter()

0 commit comments

Comments
 (0)