diff --git a/Emby.Naming/Common/NamingOptions.cs b/Emby.Naming/Common/NamingOptions.cs
index 29cc6558c1..a72e0ffc7a 100644
--- a/Emby.Naming/Common/NamingOptions.cs
+++ b/Emby.Naming/Common/NamingOptions.cs
@@ -181,6 +181,24 @@ namespace Emby.Naming.Common
"volume"
};
+ ArtistSubfolders = new[]
+ {
+ "albums",
+ "broadcasts",
+ "bootlegs",
+ "compilations",
+ "dj-mixes",
+ "eps",
+ "live",
+ "mixtapes",
+ "others",
+ "remixes",
+ "singles",
+ "soundtracks",
+ "spokenwords",
+ "streets"
+ };
+
AudioFileExtensions = new[]
{
".669",
@@ -744,6 +762,11 @@ namespace Emby.Naming.Common
///
public string[] AlbumStackingPrefixes { get; set; }
+ ///
+ /// Gets or sets list of artist subfolders.
+ ///
+ public string[] ArtistSubfolders { get; set; }
+
///
/// Gets or sets list of subtitle file extensions.
///
diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs
index da00b9cfa8..a922e36855 100644
--- a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs
+++ b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs
@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
@@ -18,7 +19,7 @@ using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Resolvers.Audio
{
///
- /// Class MusicAlbumResolver.
+ /// The music album resolver.
///
public class MusicAlbumResolver : ItemResolver
{
@@ -82,7 +83,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
///
/// The path to check.
/// The directory service.
- /// true if the provided path points to a music album, false otherwise.
+ /// true if the provided path points to a music album; otherwise, false.
public bool IsMusicAlbum(string path, IDirectoryService directoryService)
{
return ContainsMusic(directoryService.GetFileSystemEntries(path), true, directoryService);
@@ -95,10 +96,19 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
/// true if [is music album] [the specified args]; otherwise, false.
private bool IsMusicAlbum(ItemResolveArgs args)
{
- // Args points to an album if parent is an Artist folder or it directly contains music
if (args.IsDirectory)
{
- // if (args.Parent is MusicArtist) return true; // saves us from testing children twice
+ // If args is a artist subfolder it's not a music album
+ foreach (var subfolder in _namingOptions.ArtistSubfolders)
+ {
+ if (Path.GetDirectoryName(args.Path.AsSpan()).Equals(subfolder, StringComparison.OrdinalIgnoreCase))
+ {
+ _logger.LogDebug("Found release folder: {Path}", args.Path);
+ return false;
+ }
+ }
+
+ // If args contains music it's a music album
if (ContainsMusic(args.FileSystemChildren, true, args.DirectoryService))
{
return true;
@@ -111,22 +121,23 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
///
/// Determine if the supplied list contains what we should consider music.
///
+ /// true if the provided path list contains music; otherwise, false.
private bool ContainsMusic(
ICollection list,
bool allowSubfolders,
IDirectoryService directoryService)
{
- // check for audio files before digging down into directories
+ // Check for audio files before digging down into directories
var foundAudioFile = list.Any(fileSystemInfo => !fileSystemInfo.IsDirectory && AudioFileParser.IsAudioFile(fileSystemInfo.FullName, _namingOptions));
if (foundAudioFile)
{
- // at least one audio file exists
+ // At least one audio file exists
return true;
}
if (!allowSubfolders)
{
- // not music since no audio file exists and we're not looking into subfolders
+ // Not music since no audio file exists and we're not looking into subfolders
return false;
}
diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs
index 210ed0953a..2538c2b5b4 100644
--- a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs
+++ b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs
@@ -13,7 +13,7 @@ using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Resolvers.Audio
{
///
- /// Class MusicArtistResolver.
+ /// The music artist resolver.
///
public class MusicArtistResolver : ItemResolver
{
@@ -23,8 +23,8 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
///
/// Initializes a new instance of the class.
///
- /// The logger for the created instances.
- /// The naming options.
+ /// Instance of the interface.
+ /// The .
public MusicArtistResolver(
ILogger logger,
NamingOptions namingOptions)
@@ -40,10 +40,10 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
public override ResolverPriority Priority => ResolverPriority.Second;
///
- /// Resolves the specified args.
+ /// Resolves the specified resolver arguments.
///
- /// The args.
- /// MusicArtist.
+ /// The resolver arguments.
+ /// A .
protected override MusicArtist Resolve(ItemResolveArgs args)
{
if (!args.IsDirectory)
@@ -61,7 +61,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
var isMusicMediaFolder = string.Equals(collectionType, CollectionType.Music, StringComparison.OrdinalIgnoreCase);
- // If there's a collection type and it's not music, it can't be a series
+ // If there's a collection type and it's not music, it can't be a music artist
if (!isMusicMediaFolder)
{
return null;
@@ -82,14 +82,24 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
var albumResolver = new MusicAlbumResolver(_logger, _namingOptions);
- // If we contain an album assume we are an artist folder
var directories = args.FileSystemChildren.Where(i => i.IsDirectory);
var result = Parallel.ForEach(directories, (fileSystemInfo, state) =>
{
+ // If we contain a artist subfolder assume we are an artist folder
+ foreach (var subfolder in _namingOptions.ArtistSubfolders)
+ {
+ if (fileSystemInfo.Name.Equals(subfolder, StringComparison.OrdinalIgnoreCase))
+ {
+ // Stop once we see an artist subfolder
+ state.Stop();
+ }
+ }
+
+ // If we contain a music album assume we are an artist folder
if (albumResolver.IsMusicAlbum(fileSystemInfo.FullName, directoryService))
{
- // stop once we see a music album
+ // Stop once we see a music album
state.Stop();
}
});
diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
index bd397bdd13..6555de8554 100644
--- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
+++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
@@ -54,7 +54,7 @@ namespace MediaBrowser.Controller.Entities.Audio
public string AlbumArtist => AlbumArtists.FirstOrDefault();
[JsonIgnore]
- public override bool SupportsPeople => false;
+ public override bool SupportsPeople => true;
///
/// Gets the tracks.
diff --git a/MediaBrowser.Controller/Providers/ICustomMetadataProvider.cs b/MediaBrowser.Controller/Providers/ICustomMetadataProvider.cs
index 32a9cbef2e..14428df5b3 100644
--- a/MediaBrowser.Controller/Providers/ICustomMetadataProvider.cs
+++ b/MediaBrowser.Controller/Providers/ICustomMetadataProvider.cs
@@ -18,9 +18,9 @@ namespace MediaBrowser.Controller.Providers
/// Fetches the metadata asynchronously.
///
/// The item.
- /// The options.
- /// The cancellation token.
- /// Task{ItemUpdateType}.
+ /// The .
+ /// The .
+ /// A fetching the .
Task FetchAsync(TItemType item, MetadataRefreshOptions options, CancellationToken cancellationToken);
}
}
diff --git a/MediaBrowser.Providers/MediaBrowser.Providers.csproj b/MediaBrowser.Providers/MediaBrowser.Providers.csproj
index 9864db9ac2..dd43ba9cb0 100644
--- a/MediaBrowser.Providers/MediaBrowser.Providers.csproj
+++ b/MediaBrowser.Providers/MediaBrowser.Providers.csproj
@@ -22,6 +22,7 @@
+
diff --git a/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs b/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs
new file mode 100644
index 0000000000..3699e8f497
--- /dev/null
+++ b/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs
@@ -0,0 +1,215 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Entities.Audio;
+using MediaBrowser.Controller.Library;
+using MediaBrowser.Controller.MediaEncoding;
+using MediaBrowser.Controller.Persistence;
+using MediaBrowser.Controller.Providers;
+using MediaBrowser.Model.Dlna;
+using MediaBrowser.Model.Dto;
+using MediaBrowser.Model.Entities;
+using MediaBrowser.Model.MediaInfo;
+using TagLib;
+
+namespace MediaBrowser.Providers.MediaInfo
+{
+ ///
+ /// Probes audio files for metadata.
+ ///
+ public class AudioFileProber
+ {
+ private readonly IMediaEncoder _mediaEncoder;
+ private readonly IItemRepository _itemRepo;
+ private readonly ILibraryManager _libraryManager;
+ private readonly IMediaSourceManager _mediaSourceManager;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ public AudioFileProber(
+ IMediaSourceManager mediaSourceManager,
+ IMediaEncoder mediaEncoder,
+ IItemRepository itemRepo,
+ ILibraryManager libraryManager)
+ {
+ _mediaEncoder = mediaEncoder;
+ _itemRepo = itemRepo;
+ _libraryManager = libraryManager;
+ _mediaSourceManager = mediaSourceManager;
+ }
+
+ ///
+ /// Probes the specified item for metadata.
+ ///
+ /// The item to probe.
+ /// The .
+ /// The .
+ /// The type of item to resolve.
+ /// A probing the item for metadata.
+ public async Task Probe(
+ T item,
+ MetadataRefreshOptions options,
+ CancellationToken cancellationToken)
+ where T : Audio
+ {
+ var path = item.Path;
+ var protocol = item.PathProtocol ?? MediaProtocol.File;
+
+ if (!item.IsShortcut || options.EnableRemoteContentProbe)
+ {
+ if (item.IsShortcut)
+ {
+ path = item.ShortcutPath;
+ protocol = _mediaSourceManager.GetPathProtocol(path);
+ }
+
+ var result = await _mediaEncoder.GetMediaInfo(
+ new MediaInfoRequest
+ {
+ MediaType = DlnaProfileType.Audio,
+ MediaSource = new MediaSourceInfo
+ {
+ Path = path,
+ Protocol = protocol
+ }
+ },
+ cancellationToken).ConfigureAwait(false);
+
+ cancellationToken.ThrowIfCancellationRequested();
+
+ Fetch(item, result, cancellationToken);
+ }
+
+ return ItemUpdateType.MetadataImport;
+ }
+
+ ///
+ /// Fetches the specified audio.
+ ///
+ /// The .
+ /// The .
+ /// The .
+ protected void Fetch(Audio audio, Model.MediaInfo.MediaInfo mediaInfo, CancellationToken cancellationToken)
+ {
+ audio.Container = mediaInfo.Container;
+ audio.TotalBitrate = mediaInfo.Bitrate;
+
+ audio.RunTimeTicks = mediaInfo.RunTimeTicks;
+ audio.Size = mediaInfo.Size;
+
+ FetchDataFromTags(audio);
+
+ _itemRepo.SaveMediaStreams(audio.Id, mediaInfo.MediaStreams, cancellationToken);
+ }
+
+ ///
+ /// Fetches data from the tags.
+ ///
+ /// The .
+ private void FetchDataFromTags(Audio audio)
+ {
+ var file = TagLib.File.Create(audio.Path);
+ var tagTypes = file.TagTypesOnDisk;
+ Tag? tags = null;
+
+ if (tagTypes.HasFlag(TagTypes.Id3v2))
+ {
+ tags = file.GetTag(TagTypes.Id3v2);
+ }
+ else if (tagTypes.HasFlag(TagTypes.Ape))
+ {
+ tags = file.GetTag(TagTypes.Ape);
+ }
+ else if (tagTypes.HasFlag(TagTypes.FlacMetadata))
+ {
+ tags = file.GetTag(TagTypes.FlacMetadata);
+ }
+ else if (tagTypes.HasFlag(TagTypes.Apple))
+ {
+ tags = file.GetTag(TagTypes.Apple);
+ }
+ else if (tagTypes.HasFlag(TagTypes.Xiph))
+ {
+ tags = file.GetTag(TagTypes.Xiph);
+ }
+ else if (tagTypes.HasFlag(TagTypes.AudibleMetadata))
+ {
+ tags = file.GetTag(TagTypes.AudibleMetadata);
+ }
+ else if (tagTypes.HasFlag(TagTypes.Id3v1))
+ {
+ tags = file.GetTag(TagTypes.Id3v1);
+ }
+
+ if (tags != null)
+ {
+ if (audio.SupportsPeople && !audio.LockedFields.Contains(MetadataField.Cast))
+ {
+ var people = new List();
+ var albumArtists = tags.AlbumArtists;
+ foreach (var albumArtist in albumArtists)
+ {
+ PeopleHelper.AddPerson(people, new PersonInfo
+ {
+ Name = albumArtist,
+ Type = "AlbumArtist"
+ });
+ }
+
+ var performers = tags.Performers;
+ foreach (var performer in performers)
+ {
+ PeopleHelper.AddPerson(people, new PersonInfo
+ {
+ Name = performer,
+ Type = "Artist"
+ });
+ }
+
+ foreach (var composer in tags.Composers)
+ {
+ PeopleHelper.AddPerson(people, new PersonInfo
+ {
+ Name = composer,
+ Type = "Composer"
+ });
+ }
+
+ _libraryManager.UpdatePeople(audio, people);
+ audio.Artists = performers;
+ audio.AlbumArtists = albumArtists;
+ }
+
+ audio.Name = tags.Title;
+ audio.Album = tags.Album;
+ audio.IndexNumber = Convert.ToInt32(tags.Track);
+ audio.ParentIndexNumber = Convert.ToInt32(tags.Disc);
+ if (tags.Year != 0)
+ {
+ var year = Convert.ToInt32(tags.Year);
+ audio.ProductionYear = year;
+ audio.PremiereDate = new DateTime(year, 01, 01);
+ }
+
+ if (!audio.LockedFields.Contains(MetadataField.Genres))
+ {
+ audio.Genres = tags.Genres.Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
+ }
+
+ audio.SetProviderId(MetadataProvider.MusicBrainzArtist, tags.MusicBrainzArtistId);
+ audio.SetProviderId(MetadataProvider.MusicBrainzAlbumArtist, tags.MusicBrainzReleaseArtistId);
+ audio.SetProviderId(MetadataProvider.MusicBrainzAlbum, tags.MusicBrainzReleaseId);
+ audio.SetProviderId(MetadataProvider.MusicBrainzReleaseGroup, tags.MusicBrainzReleaseGroupId);
+ audio.SetProviderId(MetadataProvider.MusicBrainzTrack, tags.MusicBrainzTrackId);
+ }
+ }
+ }
+}
diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfo.cs b/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfo.cs
deleted file mode 100644
index f22965436f..0000000000
--- a/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfo.cs
+++ /dev/null
@@ -1,172 +0,0 @@
-#nullable disable
-
-#pragma warning disable CS1591
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-using MediaBrowser.Controller.Entities;
-using MediaBrowser.Controller.Entities.Audio;
-using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.MediaEncoding;
-using MediaBrowser.Controller.Persistence;
-using MediaBrowser.Controller.Providers;
-using MediaBrowser.Model.Dlna;
-using MediaBrowser.Model.Dto;
-using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.MediaInfo;
-
-namespace MediaBrowser.Providers.MediaInfo
-{
- public class FFProbeAudioInfo
- {
- private readonly IMediaEncoder _mediaEncoder;
- private readonly IItemRepository _itemRepo;
- private readonly ILibraryManager _libraryManager;
- private readonly IMediaSourceManager _mediaSourceManager;
-
- public FFProbeAudioInfo(
- IMediaSourceManager mediaSourceManager,
- IMediaEncoder mediaEncoder,
- IItemRepository itemRepo,
- ILibraryManager libraryManager)
- {
- _mediaEncoder = mediaEncoder;
- _itemRepo = itemRepo;
- _libraryManager = libraryManager;
- _mediaSourceManager = mediaSourceManager;
- }
-
- public async Task Probe(
- T item,
- MetadataRefreshOptions options,
- CancellationToken cancellationToken)
- where T : Audio
- {
- var path = item.Path;
- var protocol = item.PathProtocol ?? MediaProtocol.File;
-
- if (!item.IsShortcut || options.EnableRemoteContentProbe)
- {
- if (item.IsShortcut)
- {
- path = item.ShortcutPath;
- protocol = _mediaSourceManager.GetPathProtocol(path);
- }
-
- var result = await _mediaEncoder.GetMediaInfo(
- new MediaInfoRequest
- {
- MediaType = DlnaProfileType.Audio,
- MediaSource = new MediaSourceInfo
- {
- Path = path,
- Protocol = protocol
- }
- },
- cancellationToken).ConfigureAwait(false);
-
- cancellationToken.ThrowIfCancellationRequested();
-
- Fetch(item, result, cancellationToken);
- }
-
- return ItemUpdateType.MetadataImport;
- }
-
- ///
- /// Fetches the specified audio.
- ///
- /// The audio.
- /// The media information.
- /// The cancellation token.
- protected void Fetch(Audio audio, Model.MediaInfo.MediaInfo mediaInfo, CancellationToken cancellationToken)
- {
- audio.Container = mediaInfo.Container;
- audio.TotalBitrate = mediaInfo.Bitrate;
-
- audio.RunTimeTicks = mediaInfo.RunTimeTicks;
- audio.Size = mediaInfo.Size;
-
- // var extension = (Path.GetExtension(audio.Path) ?? string.Empty).TrimStart('.');
- // audio.Container = extension;
-
- FetchDataFromTags(audio, mediaInfo);
-
- _itemRepo.SaveMediaStreams(audio.Id, mediaInfo.MediaStreams, cancellationToken);
- }
-
- ///
- /// Fetches data from the tags dictionary.
- ///
- /// The audio.
- /// The data.
- private void FetchDataFromTags(Audio audio, Model.MediaInfo.MediaInfo data)
- {
- // Only set Name if title was found in the dictionary
- if (!string.IsNullOrEmpty(data.Name))
- {
- audio.Name = data.Name;
- }
-
- if (!string.IsNullOrEmpty(data.ForcedSortName))
- {
- audio.ForcedSortName = data.ForcedSortName;
- }
-
- if (audio.SupportsPeople && !audio.LockedFields.Contains(MetadataField.Cast))
- {
- var people = new List();
-
- foreach (var person in data.People)
- {
- PeopleHelper.AddPerson(people, new PersonInfo
- {
- Name = person.Name,
- Type = person.Type,
- Role = person.Role
- });
- }
-
- _libraryManager.UpdatePeople(audio, people);
- }
-
- audio.Album = data.Album;
- audio.Artists = data.Artists;
- audio.AlbumArtists = data.AlbumArtists;
- audio.IndexNumber = data.IndexNumber;
- audio.ParentIndexNumber = data.ParentIndexNumber;
- audio.ProductionYear = data.ProductionYear;
- audio.PremiereDate = data.PremiereDate;
-
- // If we don't have a ProductionYear try and get it from PremiereDate
- if (audio.PremiereDate.HasValue && !audio.ProductionYear.HasValue)
- {
- audio.ProductionYear = audio.PremiereDate.Value.ToLocalTime().Year;
- }
-
- if (!audio.LockedFields.Contains(MetadataField.Genres))
- {
- audio.Genres = Array.Empty();
-
- foreach (var genre in data.Genres)
- {
- audio.AddGenre(genre);
- }
- }
-
- if (!audio.LockedFields.Contains(MetadataField.Studios))
- {
- audio.SetStudios(data.Studios);
- }
-
- audio.SetProviderId(MetadataProvider.MusicBrainzAlbumArtist, data.GetProviderId(MetadataProvider.MusicBrainzAlbumArtist));
- audio.SetProviderId(MetadataProvider.MusicBrainzArtist, data.GetProviderId(MetadataProvider.MusicBrainzArtist));
- audio.SetProviderId(MetadataProvider.MusicBrainzAlbum, data.GetProviderId(MetadataProvider.MusicBrainzAlbum));
- audio.SetProviderId(MetadataProvider.MusicBrainzReleaseGroup, data.GetProviderId(MetadataProvider.MusicBrainzReleaseGroup));
- audio.SetProviderId(MetadataProvider.MusicBrainzTrack, data.GetProviderId(MetadataProvider.MusicBrainzTrack));
- }
- }
-}
diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeProvider.cs b/MediaBrowser.Providers/MediaInfo/ProbeProvider.cs
similarity index 71%
rename from MediaBrowser.Providers/MediaInfo/FFProbeProvider.cs
rename to MediaBrowser.Providers/MediaInfo/ProbeProvider.cs
index e58c0e281b..6591366076 100644
--- a/MediaBrowser.Providers/MediaInfo/FFProbeProvider.cs
+++ b/MediaBrowser.Providers/MediaInfo/ProbeProvider.cs
@@ -1,7 +1,5 @@
#nullable disable
-#pragma warning disable CS1591
-
using System;
using System.IO;
using System.Linq;
@@ -27,7 +25,10 @@ using Microsoft.Extensions.Logging;
namespace MediaBrowser.Providers.MediaInfo
{
- public class FFProbeProvider : ICustomMetadataProvider,
+ ///
+ /// The probe provider.
+ ///
+ public class ProbeProvider : ICustomMetadataProvider,
ICustomMetadataProvider,
ICustomMetadataProvider,
ICustomMetadataProvider,
@@ -39,14 +40,30 @@ namespace MediaBrowser.Providers.MediaInfo
IPreRefreshProvider,
IHasItemChangeMonitor
{
- private readonly ILogger _logger;
+ private readonly ILogger _logger;
private readonly AudioResolver _audioResolver;
private readonly SubtitleResolver _subtitleResolver;
private readonly FFProbeVideoInfo _videoProber;
- private readonly FFProbeAudioInfo _audioProber;
+ private readonly AudioFileProber _audioProber;
private readonly Task _cachedTask = Task.FromResult(ItemUpdateType.None);
- public FFProbeProvider(
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the .
+ /// Instance of the interface.
+ /// The .
+ public ProbeProvider(
IMediaSourceManager mediaSourceManager,
IMediaEncoder mediaEncoder,
IItemRepository itemRepo,
@@ -61,7 +78,8 @@ namespace MediaBrowser.Providers.MediaInfo
ILoggerFactory loggerFactory,
NamingOptions namingOptions)
{
- _logger = loggerFactory.CreateLogger();
+ _logger = loggerFactory.CreateLogger();
+ _audioProber = new AudioFileProber(mediaSourceManager, mediaEncoder, itemRepo, libraryManager);
_audioResolver = new AudioResolver(loggerFactory.CreateLogger(), localization, mediaEncoder, fileSystem, namingOptions);
_subtitleResolver = new SubtitleResolver(loggerFactory.CreateLogger(), localization, mediaEncoder, fileSystem, namingOptions);
_videoProber = new FFProbeVideoInfo(
@@ -78,14 +96,15 @@ namespace MediaBrowser.Providers.MediaInfo
libraryManager,
_audioResolver,
_subtitleResolver);
- _audioProber = new FFProbeAudioInfo(mediaSourceManager, mediaEncoder, itemRepo, libraryManager);
}
- public string Name => "ffprobe";
+ ///
+ public string Name => "Probe Provider";
- // Run last
+ ///
public int Order => 100;
+ ///
public bool HasChanged(BaseItem item, IDirectoryService directoryService)
{
var video = item as Video;
@@ -127,41 +146,56 @@ namespace MediaBrowser.Providers.MediaInfo
return false;
}
+ ///
public Task FetchAsync(Episode item, MetadataRefreshOptions options, CancellationToken cancellationToken)
{
return FetchVideoInfo(item, options, cancellationToken);
}
+ ///
public Task FetchAsync(MusicVideo item, MetadataRefreshOptions options, CancellationToken cancellationToken)
{
return FetchVideoInfo(item, options, cancellationToken);
}
+ ///
public Task FetchAsync(Movie item, MetadataRefreshOptions options, CancellationToken cancellationToken)
{
return FetchVideoInfo(item, options, cancellationToken);
}
+ ///
public Task FetchAsync(Trailer item, MetadataRefreshOptions options, CancellationToken cancellationToken)
{
return FetchVideoInfo(item, options, cancellationToken);
}
+ ///
public Task FetchAsync(Video item, MetadataRefreshOptions options, CancellationToken cancellationToken)
{
return FetchVideoInfo(item, options, cancellationToken);
}
+ ///
public Task FetchAsync(Audio item, MetadataRefreshOptions options, CancellationToken cancellationToken)
{
return FetchAudioInfo(item, options, cancellationToken);
}
+ ///
public Task FetchAsync(AudioBook item, MetadataRefreshOptions options, CancellationToken cancellationToken)
{
return FetchAudioInfo(item, options, cancellationToken);
}
+ ///
+ /// Fetches video information for an item.
+ ///
+ /// The item.
+ /// The .
+ /// The .
+ /// The type of item to resolve.
+ /// A fetching the for an item.
public Task FetchVideoInfo(T item, MetadataRefreshOptions options, CancellationToken cancellationToken)
where T : Video
{
@@ -208,6 +242,14 @@ namespace MediaBrowser.Providers.MediaInfo
.FirstOrDefault(i => !string.IsNullOrWhiteSpace(i) && !i.StartsWith('#'));
}
+ ///
+ /// Fetches audio information for an item.
+ ///
+ /// The item.
+ /// The .
+ /// The .
+ /// The type of item to resolve.
+ /// A fetching the for an item.
public Task FetchAudioInfo(T item, MetadataRefreshOptions options, CancellationToken cancellationToken)
where T : Audio
{
diff --git a/MediaBrowser.Providers/Music/AlbumMetadataService.cs b/MediaBrowser.Providers/Music/AlbumMetadataService.cs
index 7743d3b27b..ac40f0b3a4 100644
--- a/MediaBrowser.Providers/Music/AlbumMetadataService.cs
+++ b/MediaBrowser.Providers/Music/AlbumMetadataService.cs
@@ -1,5 +1,3 @@
-#pragma warning disable CS1591
-
using System;
using System.Collections.Generic;
using System.Linq;
@@ -15,8 +13,19 @@ using Microsoft.Extensions.Logging;
namespace MediaBrowser.Providers.Music
{
+ ///
+ /// The album metadata service.
+ ///
public class AlbumMetadataService : MetadataService
{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Instance of the .
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
+ /// Instance of the interface.
public AlbumMetadataService(
IServerConfigurationManager serverConfigurationManager,
ILogger logger,
@@ -61,40 +70,46 @@ namespace MediaBrowser.Providers.Music
var songs = children.Cast