From e8510a55c00eb13cddde370ceb29963acca47161 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 27 Jan 2020 23:38:35 +0100 Subject: [PATCH] Solving a bug with collections --- Kyoo/Controllers/Crawler.cs | 1 - Kyoo/Controllers/ProviderManager.cs | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Kyoo/Controllers/Crawler.cs b/Kyoo/Controllers/Crawler.cs index 693b36a9..b7ac00b4 100644 --- a/Kyoo/Controllers/Crawler.cs +++ b/Kyoo/Controllers/Crawler.cs @@ -149,7 +149,6 @@ namespace Kyoo.Controllers if (!libraryManager.IsCollectionRegistered(Utility.ToSlug(collectionName), out long collectionID)) { Collection collection = await metadataProvider.GetCollectionFromName(collectionName, library); - collection.Name = collection.Name ?? collectionName; collectionID = libraryManager.RegisterCollection(collection); } libraryManager.AddShowToCollection(showID, collectionID); diff --git a/Kyoo/Controllers/ProviderManager.cs b/Kyoo/Controllers/ProviderManager.cs index b55ca4fb..14f7496e 100644 --- a/Kyoo/Controllers/ProviderManager.cs +++ b/Kyoo/Controllers/ProviderManager.cs @@ -53,7 +53,10 @@ namespace Kyoo.Controllers public async Task GetCollectionFromName(string name, Library library) { - return await GetMetadata(provider => provider.GetCollectionFromName(name), library, $"the collection {name}"); + Collection collection = await GetMetadata(provider => provider.GetCollectionFromName(name), library, $"the collection {name}"); + collection.Name ??= name; + collection.Slug ??= Utility.ToSlug(name); + return collection; } public async Task GetShowFromName(string showName, string showPath, Library library)