Merge pull request #21 from oddstr13/pr-10.6-1

Update for 10.6.0
This commit is contained in:
Anthony Lavado 2020-07-18 17:45:33 -04:00 committed by GitHub
commit bca2760706
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 21 deletions

View File

@ -15,11 +15,11 @@ namespace Jellyfin.Plugin.TMDbBoxSets.Api
public class TMDbCollectionsService : IService
{
private readonly TMDbBoxSetManager _tmDbBoxSetManager;
private readonly ILogger _logger;
private readonly ILogger<TMDbCollectionsService> _logger;
public TMDbCollectionsService(ILibraryManager libraryManager, ICollectionManager collectionManager, ILogger logger)
public TMDbCollectionsService(ILibraryManager libraryManager, ICollectionManager collectionManager, ILogger<TMDbCollectionsService> logger, ILogger<TMDbBoxSetManager> boxset_logger)
{
_tmDbBoxSetManager = new TMDbBoxSetManager(libraryManager, collectionManager, logger);
_tmDbBoxSetManager = new TMDbBoxSetManager(libraryManager, collectionManager, boxset_logger);
_logger = logger;
}

View File

@ -3,12 +3,12 @@
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<IsPackable>true</IsPackable>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<FileVersion>5.0.0.0</FileVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<FileVersion>6.0.0.0</FileVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Jellyfin.Controller" Version="10.*" />
<PackageReference Include="Jellyfin.Controller" Version="10.*-*" />
</ItemGroup>
<ItemGroup>

View File

@ -11,13 +11,13 @@ namespace Jellyfin.Plugin.TMDbBoxSets.ScheduledTasks
{
public class RefreshLibraryTask : IScheduledTask
{
private readonly ILogger _logger;
private readonly ILogger<RefreshLibraryTask> _logger;
private readonly TMDbBoxSetManager _tmDbBoxSetManager;
public RefreshLibraryTask(ILibraryManager libraryManager, ICollectionManager collectionManager, ILogger logger)
public RefreshLibraryTask(ILibraryManager libraryManager, ICollectionManager collectionManager, ILogger<RefreshLibraryTask> logger, ILogger<TMDbBoxSetManager> boxset_logger)
{
_logger = logger;
_tmDbBoxSetManager = new TMDbBoxSetManager(libraryManager, collectionManager, logger);
_tmDbBoxSetManager = new TMDbBoxSetManager(libraryManager, collectionManager, boxset_logger);
}
public Task Execute(CancellationToken cancellationToken, IProgress<double> progress)
{

View File

@ -20,9 +20,9 @@ namespace Jellyfin.Plugin.TMDbBoxSets
private readonly ICollectionManager _collectionManager;
private readonly Timer _timer;
private readonly HashSet<string> _queuedTmdbCollectionIds;
private readonly ILogger _logger; // TODO logging
private readonly ILogger<TMDbBoxSetManager> _logger; // TODO logging
public TMDbBoxSetManager(ILibraryManager libraryManager, ICollectionManager collectionManager, ILogger logger)
public TMDbBoxSetManager(ILibraryManager libraryManager, ICollectionManager collectionManager, ILogger<TMDbBoxSetManager> logger)
{
_libraryManager = libraryManager;
_collectionManager = collectionManager;
@ -54,7 +54,7 @@ namespace Jellyfin.Plugin.TMDbBoxSets
boxSet = _collectionManager.CreateCollection(new CollectionCreationOptions
{
Name = tmdbCollectionName,
ProviderIds = new Dictionary<string, string> {{MetadataProviders.Tmdb.ToString(), tmdbCollectionId}}
ProviderIds = new Dictionary<string, string> {{MetadataProvider.Tmdb.ToString(), tmdbCollectionId}}
});
}
@ -89,8 +89,8 @@ namespace Jellyfin.Plugin.TMDbBoxSets
// We are only interested in movies that belong to a TMDb collection
return movies.Where(m =>
m.HasProviderId(MetadataProviders.TmdbCollection) &&
!string.IsNullOrWhiteSpace(m.GetProviderId(MetadataProviders.TmdbCollection))).ToList();
m.HasProviderId(MetadataProvider.TmdbCollection) &&
!string.IsNullOrWhiteSpace(m.GetProviderId(MetadataProvider.TmdbCollection))).ToList();
}
private IReadOnlyCollection<BoxSet> GetAllBoxSetsFromLibrary()
@ -109,7 +109,7 @@ namespace Jellyfin.Plugin.TMDbBoxSets
var boxSets = GetAllBoxSetsFromLibrary();
var movieCollections = GetMoviesFromLibrary()
.GroupBy(m => m.GetProviderId(MetadataProviders.TmdbCollection))
.GroupBy(m => m.GetProviderId(MetadataProvider.TmdbCollection))
.ToArray();
_logger.LogInformation("Found {Count} TMDb collection(s) across all movies", movieCollections.Length);
@ -120,7 +120,7 @@ namespace Jellyfin.Plugin.TMDbBoxSets
var tmdbCollectionId = movieCollection.Key;
var boxSet = boxSets.FirstOrDefault(b => b.GetProviderId(MetadataProviders.Tmdb) == tmdbCollectionId);
var boxSet = boxSets.FirstOrDefault(b => b.GetProviderId(MetadataProvider.Tmdb) == tmdbCollectionId);
AddMoviesToCollection(movieCollection.ToList(), tmdbCollectionId, boxSet);
index++;
}
@ -137,7 +137,7 @@ namespace Jellyfin.Plugin.TMDbBoxSets
}
// TODO: look it up?
var tmdbCollectionId = movie.GetProviderId(MetadataProviders.TmdbCollection);
var tmdbCollectionId = movie.GetProviderId(MetadataProvider.TmdbCollection);
if (string.IsNullOrEmpty(tmdbCollectionId))
{
return;
@ -163,9 +163,9 @@ namespace Jellyfin.Plugin.TMDbBoxSets
foreach (var tmdbCollectionId in tmdbCollectionIds)
{
var movieMatches = movies
.Where(m => m.GetProviderId(MetadataProviders.TmdbCollection) == tmdbCollectionId)
.Where(m => m.GetProviderId(MetadataProvider.TmdbCollection) == tmdbCollectionId)
.ToList();
var boxSet = boxSets.FirstOrDefault(b => b.GetProviderId(MetadataProviders.Tmdb) == tmdbCollectionId);
var boxSet = boxSets.FirstOrDefault(b => b.GetProviderId(MetadataProvider.Tmdb) == tmdbCollectionId);
AddMoviesToCollection(movieMatches, tmdbCollectionId, boxSet);
}

View File

@ -1,8 +1,8 @@
---
name: "TMDb Box Sets"
guid: "bc4aad2e-d3d0-4725-a5e2-fd07949e5b42"
version: "5.0.0.0"
targetAbi: "10.5.0.0"
version: "6.0.0.0"
targetAbi: "10.6.0.0"
owner: "jellyfin"
overview: "Automatically create movie box sets based on TMDb collections"
description: "Automatically create movie box sets based on TMDb collections"