Skip to content

The Free Software Media System - Server Backend & API

Merge branch 'master' into embytv

Bond_009e714b9930ef2
diff --cc Emby.Server.Implementations/Library/MediaSourceManager.cs
index 059b27e877,ba1564d1f8..70d5bd9f4e
--- a/Emby.Server.Implementations/Library/MediaSourceManager.cs
+++ b/Emby.Server.Implementations/Library/MediaSourceManager.cs
@@@ -128,7 -130,22 +130,22 @@@ namespace Emby.Server.Implementations.L
return streams;
}
+ /// <inheritdoc />
+ public List<MediaAttachment> GetMediaAttachments(MediaAttachmentQuery query)
+ {
+ return _itemRepo.GetMediaAttachments(query);
+ }
+
+ /// <inheritdoc />
+ public List<MediaAttachment> GetMediaAttachments(Guid itemId)
+ {
+ return GetMediaAttachments(new MediaAttachmentQuery
+ {
+ ItemId = itemId
+ });
+ }
+
- public async Task<List<MediaSourceInfo>> GetPlayackMediaSources(BaseItem item, User user, bool allowMediaProbe, bool enablePathSubstitution, CancellationToken cancellationToken)
+ public async Task<List<MediaSourceInfo>> GetPlaybackMediaSources(BaseItem item, User user, bool allowMediaProbe, bool enablePathSubstitution, CancellationToken cancellationToken)
{
var mediaSources = GetStaticMediaSources(item, enablePathSubstitution, user);
diff --cc Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index 420209edaf,3b6bfce6a7..f4d6cd4d3a
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@@ -1549,17 -1582,18 +1549,19 @@@ namespace Emby.Server.Implementations.L
return;
}
- var episodesToDelete = librarySeries.GetItemList(new InternalItemsQuery
- {
- OrderBy = new[] { (ItemSortBy.DateCreated, SortOrder.Descending) },
- IsVirtualItem = false,
- IsFolder = false,
- Recursive = true,
- DtoOptions = new DtoOptions(true)
+ var episodesToDelete = librarySeries.GetItemList(
+ new InternalItemsQuery
+ {
- OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.DateCreated, SortOrder.Descending) },
++ OrderBy = new[] { (ItemSortBy.DateCreated, SortOrder.Descending) },
+ IsVirtualItem = false,
+ IsFolder = false,
+ Recursive = true,
+ DtoOptions = new DtoOptions(true)
- }).Where(i => i.IsFileProtocol && File.Exists(i.Path))
- .Skip(seriesTimer.KeepUpTo - 1)
- .ToList();
+
- })
++ })
+ .Where(i => i.IsFileProtocol && File.Exists(i.Path))
+ .Skip(seriesTimer.KeepUpTo - 1)
+ .ToList();
foreach (var item in episodesToDelete)
{
@@@ -1611,20 -1644,22 +1613,17 @@@
if (libraryItem != null)
{
- _libraryManager.DeleteItem(libraryItem, new DeleteOptions
- {
- DeleteFileLocation = true
-
- }, true);
+ _libraryManager.DeleteItem(
+ libraryItem,
+ new DeleteOptions
+ {
+ DeleteFileLocation = true
+ },
+ true);
}
-- else
++ else if (File.Exists(timer.RecordingPath))
{
- if (File.Exists(timer.RecordingPath))
- try
-- {
-- _fileSystem.DeleteFile(timer.RecordingPath);
- }
- catch (IOException)
- {
-
-- }
++ _fileSystem.DeleteFile(timer.RecordingPath);
}
_timerProvider.Delete(timer);
diff --cc MediaBrowser.Api/Playback/BaseStreamingService.cs
index d6f5bb0c02,5881e22a7c..1f7dc0d71f
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@@ -768,7 -759,7 +759,7 @@@ namespace MediaBrowser.Api.Playbac
if (mediaSource == null)
{
- var mediaSources = (await MediaSourceManager.GetPlaybackMediaSources(LibraryManager.GetItemById(request.Id), null, false, false, cancellationToken).ConfigureAwait(false)).ToList();
- var mediaSources = await MediaSourceManager.GetPlayackMediaSources(LibraryManager.GetItemById(request.Id), null, false, false, cancellationToken).ConfigureAwait(false);
++ var mediaSources = await MediaSourceManager.GetPlaybackMediaSources(LibraryManager.GetItemById(request.Id), null, false, false, cancellationToken).ConfigureAwait(false);
mediaSource = string.IsNullOrEmpty(request.MediaSourceId)
? mediaSources[0]
diff --cc MediaBrowser.Controller/Library/IMediaSourceManager.cs
index 1bf981d79c,09e6fda885..0ceabd0e68
--- a/MediaBrowser.Controller/Library/IMediaSourceManager.cs
+++ b/MediaBrowser.Controller/Library/IMediaSourceManager.cs
@@@ -39,9 -39,23 +39,23 @@@ namespace MediaBrowser.Controller.Libra
List<MediaStream> GetMediaStreams(MediaStreamQuery query);
/// <summary>
- /// Gets the playback media sources.
+ /// Gets the media attachments.
+ /// </summary>
+ /// <param name="itemId">The item identifier.</param>
+ /// <returns>IEnumerable&lt;MediaAttachment&gt;.</returns>
+ List<MediaAttachment> GetMediaAttachments(Guid itemId);
+
+ /// <summary>
+ /// Gets the media attachments.
+ /// </summary>
+ /// <param name="query">The query.</param>
+ /// <returns>IEnumerable&lt;MediaAttachment&gt;.</returns>
+ List<MediaAttachment> GetMediaAttachments(MediaAttachmentQuery query);
+
+ /// <summary>
+ /// Gets the playack media sources.
/// </summary>
- Task<List<MediaSourceInfo>> GetPlayackMediaSources(BaseItem item, User user, bool allowMediaProbe, bool enablePathSubstitution, CancellationToken cancellationToken);
+ Task<List<MediaSourceInfo>> GetPlaybackMediaSources(BaseItem item, User user, bool allowMediaProbe, bool enablePathSubstitution, CancellationToken cancellationToken);
/// <summary>
/// Gets the static media sources.
diff --cc jellyfin.ruleset
index d3d3001ed4,27d8a7cd92..9846367d83
--- a/jellyfin.ruleset
+++ b/jellyfin.ruleset
@@@ -31,9 -31,9 +31,11 @@@
<Rules AnalyzerId="Microsoft.CodeAnalysis.FxCopAnalyzers" RuleNamespace="Microsoft.Design">
<!-- disable warning CA1031: Do not catch general exception types -->
<Rule Id="CA1031" Action="Info" />
+ <!-- disable warning CA1032: Implement standard exception constructors -->
+ <Rule Id="CA1032" Action="Info" />
+ <!-- disable warning CA1056: URI properties should not be strings -->
+ <Rule Id="CA1056" Action="Info" />
- <!-- disable warning CA1720: Identifiers should not contain type names -->
+ <!-- disable warning CA1062: Validate arguments of public methods -->
<Rule Id="CA1062" Action="Info" />
<!-- disable warning CA1720: Identifiers should not contain type names -->
<Rule Id="CA1720" Action="Info" />