[PR #62] [CLOSED] Fix: Prevent crash when playing non-TubeArchivist media (Issue #60) #75

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

📋 Pull Request Information

Original PR: https://github.com/tubearchivist/tubearchivist-jf-plugin/pull/62
Author: @mattkduran
Created: 10/17/2025
Status: Closed

Base: masterHead: fix/playback-crash-issue-60


📝 Commits (1)

  • e301a24 Fix: Prevent crash when playing non-TubeArchivist media

📊 Changes

1 file changed (+6 additions, -0 deletions)

View changed files

📝 Jellyfin.Plugin.TubeArchivistMetadata/Plugin.cs (+6 -0)

📄 Description

Problem

The plugin crashes with System.ArgumentException: Guid can't be empty (Parameter 'id') when users play movies or other non-TubeArchivist content.

Root Cause

The OnPlaybackProgress method in Plugin.cs (line 178) attempts to traverse the TV show hierarchy (Episode → Season → Series → Collection) for ALL media playback events, including movies. Since movies don't follow this hierarchy structure, calling GetItemById() on a movie's parent can result in empty GUIDs, causing an exception.

Changes Made

Added a type check to immediately return if the item is not an Episode, before attempting any hierarchy traversal:

// Only process Episodes (YouTube videos), not Movies or other media types
if (eventArgs.Item is not Episode)
{
    return;
}

This ensures the plugin only processes TubeArchivist content (YouTube videos stored as TV Episodes) and safely ignores movies, music, and other media types.

Testing

Tested in Docker container with Jellyfin 10.10.7:

  • Movie playback - no crashes, properly ignored by plugin
  • TubeArchivist video playback - still syncs progress correctly
  • Progress sync to TubeArchivist API - verified working

Before Fix

[FTL] Main: Unhandled Exception
System.ArgumentException: Guid can't be empty (Parameter 'id')
   at Emby.Server.Implementations.Library.LibraryManager.GetItemById(Guid id)
   at Jellyfin.Plugin.TubeArchivistMetadata.Plugin.OnPlaybackProgress(...)

After Fix

[INF] User started playing "10 Things I Hate About You"
[INF] Playback stopped... Stopped at 83955 ms

(No errors - movie playback ignored as expected)

Fixes #60


🔄 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/62 **Author:** [@mattkduran](https://github.com/mattkduran) **Created:** 10/17/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `fix/playback-crash-issue-60` --- ### 📝 Commits (1) - [`e301a24`](https://github.com/tubearchivist/tubearchivist-jf-plugin/commit/e301a24a39f911bc94cd337f28d37b8312867732) Fix: Prevent crash when playing non-TubeArchivist media ### 📊 Changes **1 file changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `Jellyfin.Plugin.TubeArchivistMetadata/Plugin.cs` (+6 -0) </details> ### 📄 Description ## Problem The plugin crashes with `System.ArgumentException: Guid can't be empty (Parameter 'id')` when users play movies or other non-TubeArchivist content. ## Root Cause The `OnPlaybackProgress` method in `Plugin.cs` (line 178) attempts to traverse the TV show hierarchy (Episode → Season → Series → Collection) for ALL media playback events, including movies. Since movies don't follow this hierarchy structure, calling `GetItemById()` on a movie's parent can result in empty GUIDs, causing an exception. ## Changes Made Added a type check to immediately return if the item is not an Episode, before attempting any hierarchy traversal: ```csharp // Only process Episodes (YouTube videos), not Movies or other media types if (eventArgs.Item is not Episode) { return; } ``` This ensures the plugin only processes TubeArchivist content (YouTube videos stored as TV Episodes) and safely ignores movies, music, and other media types. ## Testing Tested in Docker container with Jellyfin 10.10.7: - Movie playback - no crashes, properly ignored by plugin - TubeArchivist video playback - still syncs progress correctly - Progress sync to TubeArchivist API - verified working ## Before Fix ``` [FTL] Main: Unhandled Exception System.ArgumentException: Guid can't be empty (Parameter 'id') at Emby.Server.Implementations.Library.LibraryManager.GetItemById(Guid id) at Jellyfin.Plugin.TubeArchivistMetadata.Plugin.OnPlaybackProgress(...) ``` ## After Fix ``` [INF] User started playing "10 Things I Hate About You" [INF] Playback stopped... Stopped at 83955 ms ``` (No errors - movie playback ignored as expected) Fixes #60 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 20:35:39 +00:00
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#75
No description provided.