mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Fixing a bug with libraries link
This commit is contained in:
parent
b2471c99ae
commit
f5f0a8bb61
@ -2,6 +2,7 @@
|
|||||||
using Kyoo.Models.Watch;
|
using Kyoo.Models.Watch;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace Kyoo.Controllers
|
namespace Kyoo.Controllers
|
||||||
{
|
{
|
||||||
@ -194,8 +195,14 @@ namespace Kyoo.Controllers
|
|||||||
|
|
||||||
public IEnumerable<Show> GetShowsInLibrary(long libraryID)
|
public IEnumerable<Show> GetShowsInLibrary(long libraryID)
|
||||||
{
|
{
|
||||||
return (from link in _database.LibraryLinks where link.LibraryID == libraryID select link).AsEnumerable()
|
return (from link in _database.LibraryLinks where link.LibraryID == libraryID select link)
|
||||||
.Select(link => link.Show ?? link.Collection.AsShow())
|
.AsEnumerable()
|
||||||
|
.Select(link =>
|
||||||
|
{
|
||||||
|
_database.Entry(link).Reference(l => l.Show).Load();
|
||||||
|
_database.Entry(link).Reference(l => l.Collection).Load();
|
||||||
|
return link.Show ?? link.Collection.AsShow();
|
||||||
|
})
|
||||||
.OrderBy(x => x.Title);
|
.OrderBy(x => x.Title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,13 +33,13 @@ namespace Kyoo
|
|||||||
services.AddControllers().AddNewtonsoftJson();
|
services.AddControllers().AddNewtonsoftJson();
|
||||||
services.AddHttpClient();
|
services.AddHttpClient();
|
||||||
|
|
||||||
services.AddDbContext<DatabaseContext>(options => options.UseSqlite(Configuration.GetConnectionString("Database")), ServiceLifetime.Singleton);
|
services.AddDbContext<DatabaseContext>(options => options.UseSqlite(Configuration.GetConnectionString("Database")));
|
||||||
|
|
||||||
// services.AddIdentity<ApplicationUser, IdentityRole>()
|
// services.AddIdentity<ApplicationUser, IdentityRole>()
|
||||||
// .AddEntityFrameworkStores()
|
// .AddEntityFrameworkStores()
|
||||||
// services.AddIdentityServer();
|
// services.AddIdentityServer();
|
||||||
|
|
||||||
services.AddSingleton<ILibraryManager, LibraryManager>();
|
services.AddScoped<ILibraryManager, LibraryManager>();
|
||||||
services.AddSingleton<ITranscoder, Transcoder>();
|
services.AddSingleton<ITranscoder, Transcoder>();
|
||||||
services.AddSingleton<IThumbnailsManager, ThumbnailsManager>();
|
services.AddSingleton<IThumbnailsManager, ThumbnailsManager>();
|
||||||
services.AddSingleton<IProviderManager, ProviderManager>();
|
services.AddSingleton<IProviderManager, ProviderManager>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user