[PR #86] Normalize TubeArchivist URL resolution and redirect handling #85

Open
opened 2026-03-23 20:35:42 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/tubearchivist/tubearchivist-jf-plugin/pull/86
Author: @cheahkhing
Created: 3/8/2026
Status: 🔄 Open

Base: masterHead: master


📝 Commits (4)

  • 07eb39e Initial plan
  • d97eee6 Fix TubeArchivist URL resolution
  • f0ce4eb Refine redirect handling follow-ups
  • a449a9a Merge pull request #1 from cheahkhing/copilot/fix-issue-85

📊 Changes

6 files changed (+86 additions, -45 deletions)

View changed files

📝 Jellyfin.Plugin.TubeArchivistMetadata/Providers/EpisodeImageProvider.cs (+1 -1)
📝 Jellyfin.Plugin.TubeArchivistMetadata/Providers/EpisodeMetadataProvider.cs (+1 -1)
📝 Jellyfin.Plugin.TubeArchivistMetadata/Providers/SeriesImageProvider.cs (+1 -1)
📝 Jellyfin.Plugin.TubeArchivistMetadata/Providers/SeriesMetadataProvider.cs (+1 -1)
📝 Jellyfin.Plugin.TubeArchivistMetadata/TubeArchivist/TubeArchivistApi.cs (+50 -41)
📝 Jellyfin.Plugin.TubeArchivistMetadata/Utils/Utils.cs (+32 -0)

📄 Description

This pull request refactors how URLs are constructed and handled throughout the TubeArchivist plugin, with a focus on robust URL resolution and improved handling of HTTP redirects. The main changes are the introduction of a new utility method for resolving URLs, consistent usage of this method across all HTTP requests, and centralized redirect handling logic.

URL Resolution and HTTP Request Handling:

  • Added a new Utils.ResolveUrl method to robustly resolve relative and absolute URLs against the configured TubeArchivist base URL, ensuring requests always target the correct host.
  • Updated all HTTP requests in EpisodeImageProvider, EpisodeMetadataProvider, SeriesImageProvider, and SeriesMetadataProvider to use Utils.ResolveUrl instead of manual string concatenation and sanitization. [1] [2] [3] [4]

Centralized Redirect Handling:

  • Introduced a private GetAsync method in TubeArchivistApi that follows HTTP redirects up to a maximum count, logging each redirect and preventing infinite loops. All relevant API methods now use this method for GET requests. [1] [2]
  • Refactored channel, video, ping, and playlist retrieval methods in TubeArchivistApi to use the new redirect-handling logic and URL resolution, replacing previous manual redirect handling. [1] [2] [3] [4] [5]

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/tubearchivist/tubearchivist-jf-plugin/pull/86 **Author:** [@cheahkhing](https://github.com/cheahkhing) **Created:** 3/8/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (4) - [`07eb39e`](https://github.com/tubearchivist/tubearchivist-jf-plugin/commit/07eb39edce6a0d27f7b729395eb39b36e80d7e56) Initial plan - [`d97eee6`](https://github.com/tubearchivist/tubearchivist-jf-plugin/commit/d97eee684f100a7048436ae6d6e17284c2cc78d5) Fix TubeArchivist URL resolution - [`f0ce4eb`](https://github.com/tubearchivist/tubearchivist-jf-plugin/commit/f0ce4eb997209bf8c3b5373435fef0d2a0fc03d6) Refine redirect handling follow-ups - [`a449a9a`](https://github.com/tubearchivist/tubearchivist-jf-plugin/commit/a449a9a5427fe81763a2bbbe9989bb7116de5a40) Merge pull request #1 from cheahkhing/copilot/fix-issue-85 ### 📊 Changes **6 files changed** (+86 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `Jellyfin.Plugin.TubeArchivistMetadata/Providers/EpisodeImageProvider.cs` (+1 -1) 📝 `Jellyfin.Plugin.TubeArchivistMetadata/Providers/EpisodeMetadataProvider.cs` (+1 -1) 📝 `Jellyfin.Plugin.TubeArchivistMetadata/Providers/SeriesImageProvider.cs` (+1 -1) 📝 `Jellyfin.Plugin.TubeArchivistMetadata/Providers/SeriesMetadataProvider.cs` (+1 -1) 📝 `Jellyfin.Plugin.TubeArchivistMetadata/TubeArchivist/TubeArchivistApi.cs` (+50 -41) 📝 `Jellyfin.Plugin.TubeArchivistMetadata/Utils/Utils.cs` (+32 -0) </details> ### 📄 Description This pull request refactors how URLs are constructed and handled throughout the TubeArchivist plugin, with a focus on robust URL resolution and improved handling of HTTP redirects. The main changes are the introduction of a new utility method for resolving URLs, consistent usage of this method across all HTTP requests, and centralized redirect handling logic. **URL Resolution and HTTP Request Handling:** * Added a new `Utils.ResolveUrl` method to robustly resolve relative and absolute URLs against the configured TubeArchivist base URL, ensuring requests always target the correct host. * Updated all HTTP requests in `EpisodeImageProvider`, `EpisodeMetadataProvider`, `SeriesImageProvider`, and `SeriesMetadataProvider` to use `Utils.ResolveUrl` instead of manual string concatenation and sanitization. [[1]](diffhunk://#diff-d73a3fffc0e8d64be2c4021f0e28c58878dc3b14cfc8e19db5c95aa82fd51512L90-R90) [[2]](diffhunk://#diff-292a0a77b9d9b11650c2913cb9f5f9faa4417864e462cffce79df310acefb4d3L103-R103) [[3]](diffhunk://#diff-1cdd3493fe849060e7ff6b2cbdb8a8f5eb39216e933e114423a8da29ccc8521cL108-R108) [[4]](diffhunk://#diff-9f99ab03cd240392fd7cb0d8a99ba29a40d77e57d08f96e7d5cff505aa6d982aL101-R101) **Centralized Redirect Handling:** * Introduced a private `GetAsync` method in `TubeArchivistApi` that follows HTTP redirects up to a maximum count, logging each redirect and preventing infinite loops. All relevant API methods now use this method for GET requests. [[1]](diffhunk://#diff-1222fef62ad821cebda2940fcc21181db9a6e539ed8f582486814ec9655fce68R20) [[2]](diffhunk://#diff-1222fef62ad821cebda2940fcc21181db9a6e539ed8f582486814ec9655fce68R64-R99) * Refactored channel, video, ping, and playlist retrieval methods in `TubeArchivistApi` to use the new redirect-handling logic and URL resolution, replacing previous manual redirect handling. [[1]](diffhunk://#diff-1222fef62ad821cebda2940fcc21181db9a6e539ed8f582486814ec9655fce68L73-R112) [[2]](diffhunk://#diff-1222fef62ad821cebda2940fcc21181db9a6e539ed8f582486814ec9655fce68L103-R137) [[3]](diffhunk://#diff-1222fef62ad821cebda2940fcc21181db9a6e539ed8f582486814ec9655fce68L133-R161) [[4]](diffhunk://#diff-1222fef62ad821cebda2940fcc21181db9a6e539ed8f582486814ec9655fce68L216-R237) [[5]](diffhunk://#diff-1222fef62ad821cebda2940fcc21181db9a6e539ed8f582486814ec9655fce68L239-R255) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
tubearchivist/archived-tubearchivist-jf-plugin#85
No description provided.