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

refactor(targets): use get_url util for subpaths #167

Merged
merged 2 commits into from
Jan 16, 2025

Conversation

dan-online
Copy link
Owner

@dan-online dan-online commented Jan 15, 2025

Description

Fixes path joining in:

  • Emby/Jellyfin
  • Autopulse
  • Fileflows
  • Plex
  • Tdarr

Closes #149

Type of change

  • Bug (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (addition or change to documentation)

Technical

Parsed urls technically kept their path but unless the original url ended in a "/", future join calls would override instead of- join

fn get_url(&self) -> anyhow::Result<url::Url> {
    let url = if self.url.ends_with('/') {
        self.url.clone()
    } else {
        format!("{}/", self.url)
    };

    url::Url::parse(&url).map_err(Into::into)
}

Copy link

cloudflare-workers-and-pages bot commented Jan 15, 2025

Deploying autopulseui with  Cloudflare Pages  Cloudflare Pages

Latest commit: ab57f5a
Status: ✅  Deploy successful!
Preview URL: https://cb5ba248.autopulseui.pages.dev
Branch Preview URL: https://fix-emby-path-joining.autopulseui.pages.dev

View logs

@dan-online dan-online changed the title fix(emby): path joining with subpaths refactor(targets): use get_url util for subpaths Jan 15, 2025
@dan-online dan-online merged commit 7641e11 into main Jan 16, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(jellyfin): error decoding response body
1 participant