[PR #112] Add Playlist Support with Subscription-Aware Organization #112

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

📋 Pull Request Information

Original PR: https://github.com/tubearchivist/tubearchivist-plex/pull/112
Author: @coltoneshaw
Created: 12/17/2025
Status: 🔄 Open

Base: mainHead: sorting_playlists


📝 Commits (3)

  • 2766b25 initial sorting playlists
  • 910250e updated channel logic
  • ab3d46b Add Woodpecker CI for versioned releases

📊 Changes

4 files changed (+410 additions, -102 deletions)

View changed files

.woodpecker.yml (+40 -0)
📝 Contents/Code/__init__.py (+126 -57)
📝 README.md (+35 -1)
📝 Scanners/Series/TubeArchivist Series Scanner.py (+209 -44)

📄 Description

Summary

This PR adds support for organizing videos by TubeArchivist playlists in Plex, with subscription-based filtering. Videos now appear under their subscribed playlists instead of being scattered across individual channel shows.

After Before

Changes

Scanner (Scanners/Series/TubeArchivist Series Scanner.py)

  • Added get_ta_playlist_metadata() function to fetch playlist metadata from TubeArchivist API
  • Enhanced get_ta_video_metadata() to include channel_id, channel_name, and playlist fields
  • Enhanced get_ta_channel_metadata() to include channel_subscribed status
  • Implemented subscription-aware organization logic:
    • Checks videos for subscribed playlists first
    • Creates Media.Episode entries for each subscribed playlist
    • Falls back to channel organization if no subscribed playlists found
    • Skips videos that don't belong to any subscribed playlists or channels
  • Added metadata caching to minimize duplicate API calls during library scans

Agent (Contents/Code/__init__.py)

  • Added get_ta_playlist_metadata() function to fetch playlist metadata for agent
  • Implemented GUID type detection to differentiate between playlist IDs (PL prefix) and channel IDs (UC/UU prefix)
  • Updated Search() function with unified show IDs for playlists to prevent fragmentation across channel folders
  • Updated Update() function to handle both playlist and channel GUIDs
  • Added conditional handling for channel-specific metadata fields (tvart, banner)

Documentation (README.md)

  • Updated limitations section to reflect playlist support is now available
  • Added comprehensive "Playlist Support" section explaining:
    • How subscription-aware organization works
    • Setup requirements
    • Organization examples
    • Implementation notes

Behavior

Organization Logic

  1. Videos in subscribed playlists appear under those playlist shows
  2. Videos from subscribed channels also appear under their channel show
  3. Videos can appear in BOTH playlists and channels if both are subscribed
  4. Videos with no subscribed playlists or channels are filtered out

Multi-Playlist Support

Videos belonging to multiple subscribed playlists will appear in each playlist show (duplicate entries by design).

Backward Compatibility

Existing channel-only videos continue to work as before. The subscription filtering only applies when playlist/channel subscription data is available.

Performance

Metadata caching reduces duplicate API calls during scans. Cache is cleared at the start of each scan to ensure fresh subscription data.


🔄 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-plex/pull/112 **Author:** [@coltoneshaw](https://github.com/coltoneshaw) **Created:** 12/17/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `sorting_playlists` --- ### 📝 Commits (3) - [`2766b25`](https://github.com/tubearchivist/tubearchivist-plex/commit/2766b25093a36b98d2b794ee3491ed9ed26ce2d2) initial sorting playlists - [`910250e`](https://github.com/tubearchivist/tubearchivist-plex/commit/910250e9fb3c764fdb4d7325b5d0784f14776fd7) updated channel logic - [`ab3d46b`](https://github.com/tubearchivist/tubearchivist-plex/commit/ab3d46b168352769074f70762407586ec7a7c81d) Add Woodpecker CI for versioned releases ### 📊 Changes **4 files changed** (+410 additions, -102 deletions) <details> <summary>View changed files</summary> ➕ `.woodpecker.yml` (+40 -0) 📝 `Contents/Code/__init__.py` (+126 -57) 📝 `README.md` (+35 -1) 📝 `Scanners/Series/TubeArchivist Series Scanner.py` (+209 -44) </details> ### 📄 Description ## Summary This PR adds support for organizing videos by TubeArchivist playlists in Plex, with subscription-based filtering. Videos now appear under their subscribed playlists instead of being scattered across individual channel shows. <img width="400" alt="After" src="https://github.com/user-attachments/assets/2795b556-eef6-46c0-916e-d705f871cf94" /> <img width="400" alt="Before" src="https://github.com/user-attachments/assets/c6f13659-3124-4379-8b68-cf30ae76f256" /> ## Changes ### Scanner (`Scanners/Series/TubeArchivist Series Scanner.py`) - Added `get_ta_playlist_metadata()` function to fetch playlist metadata from TubeArchivist API - Enhanced `get_ta_video_metadata()` to include `channel_id`, `channel_name`, and `playlist` fields - Enhanced `get_ta_channel_metadata()` to include `channel_subscribed` status - Implemented subscription-aware organization logic: - Checks videos for subscribed playlists first - Creates Media.Episode entries for each subscribed playlist - Falls back to channel organization if no subscribed playlists found - **Skips videos that don't belong to any subscribed playlists or channels** - Added metadata caching to minimize duplicate API calls during library scans ### Agent (`Contents/Code/__init__.py`) - Added `get_ta_playlist_metadata()` function to fetch playlist metadata for agent - Implemented GUID type detection to differentiate between playlist IDs (PL prefix) and channel IDs (UC/UU prefix) - Updated `Search()` function with unified show IDs for playlists to prevent fragmentation across channel folders - Updated `Update()` function to handle both playlist and channel GUIDs - Added conditional handling for channel-specific metadata fields (tvart, banner) ### Documentation (`README.md`) - Updated limitations section to reflect playlist support is now available - Added comprehensive "Playlist Support" section explaining: - How subscription-aware organization works - Setup requirements - Organization examples - Implementation notes ## Behavior ### Organization Logic 1. Videos in subscribed playlists appear under those playlist shows 2. Videos from subscribed channels also appear under their channel show 3. Videos can appear in BOTH playlists and channels if both are subscribed 4. Videos with no subscribed playlists or channels are filtered out ### Multi-Playlist Support Videos belonging to multiple subscribed playlists will appear in each playlist show (duplicate entries by design). ### Backward Compatibility Existing channel-only videos continue to work as before. The subscription filtering only applies when playlist/channel subscription data is available. ## Performance Metadata caching reduces duplicate API calls during scans. Cache is cleared at the start of each scan to ensure fresh subscription data. --- <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-plex#112
No description provided.