Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32f976e79f | ||
|
|
8e1679faed | ||
| 13471e21fb | |||
|
|
2ffbd2f50e | ||
|
|
edb93e1028 |
@ -64,7 +64,7 @@ public class CoverageController : ControllerBase
|
||||
|
||||
foreach (var item in items)
|
||||
{
|
||||
if (string.IsNullOrEmpty(item.Path))
|
||||
if (!TasksController.MediaFileExists(item))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user