Compare commits

..

No commits in common. "master" and "v0.0.3" have entirely different histories.

3 changed files with 2 additions and 66 deletions

View File

@ -64,7 +64,7 @@ public class CoverageController : ControllerBase
foreach (var item in items) foreach (var item in items)
{ {
if (!TasksController.MediaFileExists(item)) if (string.IsNullOrEmpty(item.Path))
{ {
continue; continue;
} }

View File

@ -1,6 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using Jellyfin.Data.Enums; using Jellyfin.Data.Enums;
using Jellyfin.Plugin.JRay.Models; using Jellyfin.Plugin.JRay.Models;
@ -67,7 +66,7 @@ public class TasksController : ControllerBase
// drop anything ignored, and order prioritised items ahead of the rest. // drop anything ignored, and order prioritised items ahead of the rest.
// Randomise within each tier so the backlog still spreads across workers. // Randomise within each tier so the backlog still spreads across workers.
var pending = items var pending = items
.Where(item => MediaFileExists(item) && !_truthDataService.HasTruth(item.Id, item.Path)) .Where(item => !string.IsNullOrEmpty(item.Path) && !_truthDataService.HasTruth(item.Id, item.Path))
.Select(item => new .Select(item => new
{ {
Item = item, Item = item,
@ -97,35 +96,4 @@ public class TasksController : ControllerBase
{ {
return item is Episode episode ? episode.SeriesId : Guid.Empty; return item is Episode episode ? episode.SeriesId : Guid.Empty;
} }
/// <summary>
/// Determines whether an item's backing media still exists on disk.
/// <para>
/// A library item can outlive its file: deleting media from disk does not
/// always purge the Jellyfin database entry, and such ghosts keep
/// <c>IsVirtualItem == false</c>, so filtering on that flag alone is not
/// enough. Without this check the pending endpoint hands stale paths/URLs to
/// extraction workers, and — because a missing file can never gain truth
/// data — those items stay pending forever.
/// </para>
/// Only local (file-protocol) items are stat-checked; remote/streamed items
/// are assumed present so we never stat something off-box.
/// </summary>
/// <param name="item">The library item.</param>
/// <returns><c>true</c> if the item has usable backing media; otherwise <c>false</c>.</returns>
internal static bool MediaFileExists(BaseItem item)
{
if (string.IsNullOrEmpty(item.Path))
{
return false;
}
if (!item.IsFileProtocol)
{
return true;
}
// Path may point at a file or, for folder-based media, a directory.
return System.IO.File.Exists(item.Path) || Directory.Exists(item.Path);
}
} }

View File

@ -7,38 +7,6 @@
"owner": "dtourolle", "owner": "dtourolle",
"category": "General", "category": "General",
"versions": [ "versions": [
{
"version": "0.0.4",
"changelog": "Release 0.0.4",
"targetAbi": "10.9.0.0",
"sourceUrl": "https://gitea.tourolle.paris/dtourolle/jRay/releases/download/v0.0.4/jray_0.0.4.0.zip",
"checksum": "cb9613660b3fe3b730f46c9c7f257333",
"timestamp": "2026-07-04T19:47:05Z"
},
{
"version": "0.0.0.0",
"changelog": "Latest Build",
"targetAbi": "10.9.0.0",
"sourceUrl": "https://gitea.tourolle.paris/dtourolle/jRay/releases/download/latest/jray_0.0.0.0.zip",
"checksum": "a76316397228c9d8b8e38fbccad50390",
"timestamp": "2026-07-04T19:44:35Z"
},
{
"version": "0.0.3",
"changelog": "Release 0.0.3",
"targetAbi": "10.9.0.0",
"sourceUrl": "https://gitea.tourolle.paris/dtourolle/jRay/releases/download/v0.0.3/jray_0.0.3.0.zip",
"checksum": "da5ded2ee720f7a7f7e15ac092871a91",
"timestamp": "2026-07-04T19:11:39Z"
},
{
"version": "0.0.0.0",
"changelog": "Latest Build",
"targetAbi": "10.9.0.0",
"sourceUrl": "https://gitea.tourolle.paris/dtourolle/jRay/releases/download/latest/jray_0.0.0.0.zip",
"checksum": "0d1cc8954a1b0557eb5ec6c368bce486",
"timestamp": "2026-07-04T19:10:48Z"
},
{ {
"version": "0.0.2", "version": "0.0.2",
"changelog": "Release 0.0.2", "changelog": "Release 0.0.2",