Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add UPnP/DLNA support #135

Merged
merged 10 commits into from
Feb 13, 2023
Prev Previous commit
fix: resolve cover url issue
  • Loading branch information
tsirysndr committed Feb 13, 2023
commit 8d3d21c15b6be218f0cb64bc68d8eb70588f3e70
12 changes: 8 additions & 4 deletions types/src/types.rs
Original file line number Diff line number Diff line change
@@ -580,11 +580,15 @@ impl RemoteCoverUrl for Track {

impl RemoteCoverUrl for Album {
fn with_remote_cover_url(&self, base_url: &str) -> Self {
Self {
cover: match self.cover {
Some(ref cover) => Some(format!("{}/covers/{}", base_url, cover)),
None => None,
let cover_url = match self.cover {
Some(ref cover) => match cover.starts_with("http") {
true => Some(cover.to_owned()),
false => Some(format!("{}/covers/{}", base_url, cover)),
},
None => None,
};
Self {
cover: cover_url,
tracks: self
.tracks
.iter()