Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion SkipMe.Db.Plugin/Tasks/SyncSegmentsTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,16 @@ private static string BuildMovieLookupCacheKey(MovieLookupRequest request)

private static int? TryGetIntProviderId(BaseItem? item, string provider)
{
// Only positive ids are real. Jellyfin stores provider ids as strings and does not
// validate them as numbers, and a negative placeholder is an established convention
// for "do not match this item" - the anime providers only search by name when the id
// is empty, so a deliberately invalid one suppresses a wrong match. Forwarding such a
// value makes the API reject the entire batch, and NumberStyles.Integer parses it
// happily because it allows a leading sign. Returning null instead drops the field
// from the request body via JsonIgnoreCondition.WhenWritingNull.
if (item?.ProviderIds.TryGetValue(provider, out var raw) == true
&& int.TryParse(raw, NumberStyles.Integer, CultureInfo.InvariantCulture, out var parsed))
&& int.TryParse(raw, NumberStyles.Integer, CultureInfo.InvariantCulture, out var parsed)
&& parsed > 0)
{
return parsed;
}
Expand Down