Fix: Prevent crash when playing non-TubeArchivist media

- Fixed incorrect variable ordering in OnPlaybackProgress causing duplicate
  declaration and wrong hierarchy traversal
- Added type check to reject non-Episode items early
- Prevents 'Guid can't be empty' exception when playing movies

Fixes #60
This commit is contained in:
Matt Duran 2025-10-17 15:06:04 -07:00
parent bdd99441d1
commit e301a24a39
1 changed files with 6 additions and 0 deletions

View File

@ -161,6 +161,12 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata
if (Instance!.Configuration.JFTASync && eventArgs.Users.Any(u => Instance!.Configuration.JFUsernameFrom.Equals(u.Username, StringComparison.Ordinal)))
{
// Only process Episodes (YouTube videos), not Movies or other media types
if (eventArgs.Item is not Episode)
{
return;
}
BaseItem? season = LibraryManager.GetItemById(eventArgs.Item.ParentId);
BaseItem? channel = LibraryManager.GetItemById(season!.ParentId);
BaseItem? collection = LibraryManager.GetItemById(channel!.ParentId);