mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 15:48:03 +00:00
Merge pull request #14887 from JPVenson/bugfix/fixMigrationReferences
Some checks failed
Stale PR Check / Check PRs with merge conflicts (push) Has been cancelled
Stale Issue Labeler / Check for stale issues (push) Has been cancelled
CodeQL / Analyze (csharp) (push) Has been cancelled
Project Automation / Project board (push) Has been cancelled
Merge Conflict Labeler / Labeling (push) Has been cancelled
OpenAPI / OpenAPI - HEAD (push) Has been cancelled
OpenAPI / OpenAPI - BASE (push) Has been cancelled
Tests / run-tests (macos-latest) (push) Has been cancelled
Tests / run-tests (ubuntu-latest) (push) Has been cancelled
Tests / run-tests (windows-latest) (push) Has been cancelled
OpenAPI / OpenAPI - Difference (push) Has been cancelled
OpenAPI / OpenAPI - Publish Unstable Spec (push) Has been cancelled
OpenAPI / OpenAPI - Publish Stable Spec (push) Has been cancelled
Some checks failed
Stale PR Check / Check PRs with merge conflicts (push) Has been cancelled
Stale Issue Labeler / Check for stale issues (push) Has been cancelled
CodeQL / Analyze (csharp) (push) Has been cancelled
Project Automation / Project board (push) Has been cancelled
Merge Conflict Labeler / Labeling (push) Has been cancelled
OpenAPI / OpenAPI - HEAD (push) Has been cancelled
OpenAPI / OpenAPI - BASE (push) Has been cancelled
Tests / run-tests (macos-latest) (push) Has been cancelled
Tests / run-tests (ubuntu-latest) (push) Has been cancelled
Tests / run-tests (windows-latest) (push) Has been cancelled
OpenAPI / OpenAPI - Difference (push) Has been cancelled
OpenAPI / OpenAPI - Publish Unstable Spec (push) Has been cancelled
OpenAPI / OpenAPI - Publish Stable Spec (push) Has been cancelled
Add explicit reference check to migration
This commit is contained in:
@@ -257,6 +257,11 @@ internal class MigrateLibraryDb : IDatabaseMigrationRoutine
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!baseItemIds.Contains(refItem.Id))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
userData.ItemId = refItem.Id;
|
||||
operation.JellyfinDbContext.UserData.Add(userData);
|
||||
}
|
||||
@@ -287,7 +292,13 @@ internal class MigrateLibraryDb : IDatabaseMigrationRoutine
|
||||
{
|
||||
foreach (SqliteDataReader dto in connection.Query(mediaStreamQuery))
|
||||
{
|
||||
operation.JellyfinDbContext.MediaStreamInfos.Add(GetMediaStream(dto));
|
||||
var entity = GetMediaStream(dto);
|
||||
if (!baseItemIds.Contains(entity.ItemId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
operation.JellyfinDbContext.MediaStreamInfos.Add(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,7 +321,13 @@ internal class MigrateLibraryDb : IDatabaseMigrationRoutine
|
||||
{
|
||||
foreach (SqliteDataReader dto in connection.Query(mediaAttachmentQuery))
|
||||
{
|
||||
operation.JellyfinDbContext.AttachmentStreamInfos.Add(GetMediaAttachment(dto));
|
||||
var entity = GetMediaAttachment(dto);
|
||||
if (!baseItemIds.Contains(entity.ItemId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
operation.JellyfinDbContext.AttachmentStreamInfos.Add(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,6 +413,11 @@ internal class MigrateLibraryDb : IDatabaseMigrationRoutine
|
||||
foreach (SqliteDataReader dto in connection.Query(chapterQuery))
|
||||
{
|
||||
var chapter = GetChapter(dto);
|
||||
if (!baseItemIds.Contains(chapter.ItemId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
operation.JellyfinDbContext.Chapters.Add(chapter);
|
||||
}
|
||||
}
|
||||
@@ -422,6 +444,11 @@ internal class MigrateLibraryDb : IDatabaseMigrationRoutine
|
||||
foreach (SqliteDataReader dto in connection.Query(ancestorIdsQuery))
|
||||
{
|
||||
var ancestorId = GetAncestorId(dto);
|
||||
if (!baseItemIds.Contains(ancestorId.ItemId) || !baseItemIds.Contains(ancestorId.ParentItemId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
operation.JellyfinDbContext.AncestorIds.Add(ancestorId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user