Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static partial class MetadataProviderHelper
{
public static async Task ProcessRelations(JitenDbContext context, int deckId, List<MetadataRelation> relations)
{
if (relations.Count == 0)
if (relations.Count == 0 || deckId <= 0)
return;

foreach (var relation in relations)
Expand Down
2 changes: 2 additions & 0 deletions Jiten.Core/JitenHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public static async Task InsertDeck(IDbContextFactory<JitenDbContext> contextFac

if (existingDeck != null)
{
deck.DeckId = existingDeck.DeckId;

if (!update || (update && existingDeck.LastUpdate >= deck.LastUpdate))
{
Console.WriteLine($"[{DateTime.UtcNow:O}] Deck {deck.OriginalTitle} already exists, no update flag or deck not changed, skipping.");
Expand Down