Compare commits

...

5 Commits

Author SHA1 Message Date
Gitea Actions
32f976e79f Update manifest.json for version 0.0.4 2026-07-04 19:47:05 +00:00
Gitea Actions
8e1679faed Update manifest.json for latest build (13471e2) 2026-07-04 19:44:35 +00:00
13471e21fb fix bug that causesd stale media (not on disk) to be suggested to workers
All checks were successful
🏗️ Build Plugin / build (push) Successful in 20s
Latest Release / latest-release (push) Successful in 24s
🧪 Test Plugin / test (push) Successful in 19s
🚀 Release Plugin / build-and-release (push) Successful in 20s
2026-07-04 21:42:43 +02:00
Gitea Actions
2ffbd2f50e Update manifest.json for version 0.0.3 2026-07-04 19:11:39 +00:00
Gitea Actions
edb93e1028 Update manifest.json for latest build (f6762fc) 2026-07-04 19:10:48 +00:00
3 changed files with 66 additions and 2 deletions

View File

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

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Jellyfin.Data.Enums;
using Jellyfin.Plugin.JRay.Models;
@ -66,7 +67,7 @@ public class TasksController : ControllerBase
// drop anything ignored, and order prioritised items ahead of the rest.
// Randomise within each tier so the backlog still spreads across workers.
var pending = items
.Where(item => !string.IsNullOrEmpty(item.Path) && !_truthDataService.HasTruth(item.Id, item.Path))
.Where(item => MediaFileExists(item) && !_truthDataService.HasTruth(item.Id, item.Path))
.Select(item => new
{
Item = item,
@ -96,4 +97,35 @@ public class TasksController : ControllerBase
{
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,6 +7,38 @@
"owner": "dtourolle",
"category": "General",
"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",
"changelog": "Release 0.0.2",