aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs23
-rw-r--r--MediaBrowser.Server.Implementations/Dto/DtoService.cs1
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs17
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs14
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs2
-rw-r--r--MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs16
6 files changed, 21 insertions, 52 deletions
diff --git a/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs b/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs
index 1a5c35df8..7db457c6e 100644
--- a/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs
+++ b/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs
@@ -145,7 +145,6 @@ namespace MediaBrowser.Server.Implementations.Configuration
{
var newConfig = (ServerConfiguration)newConfiguration;
- ValidateItemByNamePath(newConfig);
ValidatePathSubstitutions(newConfig);
ValidateMetadataPath(newConfig);
ValidateSslCertificate(newConfig);
@@ -190,28 +189,6 @@ namespace MediaBrowser.Server.Implementations.Configuration
}
/// <summary>
- /// Replaces the item by name path.
- /// </summary>
- /// <param name="newConfig">The new configuration.</param>
- /// <exception cref="System.IO.DirectoryNotFoundException"></exception>
- private void ValidateItemByNamePath(ServerConfiguration newConfig)
- {
- var newPath = newConfig.ItemsByNamePath;
-
- if (!string.IsNullOrWhiteSpace(newPath)
- && !string.Equals(Configuration.ItemsByNamePath ?? string.Empty, newPath))
- {
- // Validate
- if (!FileSystem.DirectoryExists(newPath))
- {
- throw new DirectoryNotFoundException(string.Format("{0} does not exist.", newPath));
- }
-
- EnsureWriteAccess(newPath);
- }
- }
-
- /// <summary>
/// Validates the metadata path.
/// </summary>
/// <param name="newConfig">The new configuration.</param>
diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs
index 3b63eccfc..3ead1a835 100644
--- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs
+++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs
@@ -457,6 +457,7 @@ namespace MediaBrowser.Server.Implementations.Dto
dto.EpisodeCount = taggedItems.Count(i => i is Episode);
dto.GameCount = taggedItems.Count(i => i is Game);
dto.MovieCount = taggedItems.Count(i => i is Movie);
+ dto.TrailerCount = taggedItems.Count(i => i is Trailer);
dto.MusicVideoCount = taggedItems.Count(i => i is MusicVideo);
dto.SeriesCount = taggedItems.Count(i => i is Series);
dto.SongCount = taggedItems.Count(i => i is Audio);
diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
index e54adc0c5..47379fcb0 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -300,7 +300,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
return _libraryManager.GetItemById(id) as LiveTvProgram;
}
- public async Task<ILiveTvRecording> GetInternalRecording(string id, CancellationToken cancellationToken)
+ public async Task<BaseItem> GetInternalRecording(string id, CancellationToken cancellationToken)
{
if (string.IsNullOrWhiteSpace(id))
{
@@ -313,7 +313,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
}, cancellationToken).ConfigureAwait(false);
- return result.Items.FirstOrDefault() as ILiveTvRecording;
+ return result.Items.FirstOrDefault();
}
private readonly SemaphoreSlim _liveStreamSemaphore = new SemaphoreSlim(1, 1);
@@ -358,7 +358,12 @@ namespace MediaBrowser.Server.Implementations.LiveTv
return list;
}
- private ILiveTvService GetService(ILiveTvItem item)
+ private ILiveTvService GetService(ILiveTvRecording item)
+ {
+ return GetService(item.ServiceName);
+ }
+
+ private ILiveTvService GetService(BaseItem item)
{
return GetService(item.ServiceName);
}
@@ -1693,7 +1698,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
};
}
- public Task OnRecordingFileDeleted(ILiveTvRecording recording)
+ public Task OnRecordingFileDeleted(BaseItem recording)
{
var service = GetService(recording);
@@ -1715,10 +1720,10 @@ namespace MediaBrowser.Server.Implementations.LiveTv
throw new ResourceNotFoundException(string.Format("Recording with Id {0} not found", recordingId));
}
- await DeleteRecording(recording).ConfigureAwait(false);
+ await DeleteRecording((BaseItem)recording).ConfigureAwait(false);
}
- public async Task DeleteRecording(ILiveTvRecording recording)
+ public async Task DeleteRecording(BaseItem recording)
{
var service = GetService(recording.ServiceName);
diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs
index ff102b0f7..d3bb87bc7 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs
@@ -36,15 +36,13 @@ namespace MediaBrowser.Server.Implementations.LiveTv
public Task<IEnumerable<MediaSourceInfo>> GetMediaSources(IHasMediaSources item, CancellationToken cancellationToken)
{
- var channelItem = item as ILiveTvItem;
+ var baseItem = (BaseItem)item;
- if (channelItem != null)
+ if (baseItem.SourceType == SourceType.LiveTV)
{
- var hasMetadata = (IHasMetadata)channelItem;
-
- if (string.IsNullOrWhiteSpace(hasMetadata.Path))
+ if (string.IsNullOrWhiteSpace(baseItem.Path))
{
- return GetMediaSourcesInternal(channelItem, cancellationToken);
+ return GetMediaSourcesInternal(item, cancellationToken);
}
}
@@ -54,8 +52,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
// Do not use a pipe here because Roku http requests to the server will fail, without any explicit error message.
private const char StreamIdDelimeter = '_';
private const string StreamIdDelimeterString = "_";
-
- private async Task<IEnumerable<MediaSourceInfo>> GetMediaSourcesInternal(ILiveTvItem item, CancellationToken cancellationToken)
+
+ private async Task<IEnumerable<MediaSourceInfo>> GetMediaSourcesInternal(IHasMediaSources item, CancellationToken cancellationToken)
{
IEnumerable<MediaSourceInfo> sources;
diff --git a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs
index cdeb6dfa8..c417cc09c 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs
@@ -100,7 +100,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp
{
if (string.IsNullOrWhiteSpace(info.M3UUrl))
{
- return;
+ //return;
}
await _liveTvManager.SaveTunerHost(new TunerHostInfo
diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
index 3f50278f6..50662c90f 100644
--- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
+++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
@@ -719,15 +719,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
_saveItemCommand.GetParameter(index++).Value = null;
}
- var tvItem = item as ILiveTvItem;
- if (tvItem != null)
- {
- _saveItemCommand.GetParameter(index++).Value = tvItem.ServiceName;
- }
- else
- {
- _saveItemCommand.GetParameter(index++).Value = null;
- }
+ _saveItemCommand.GetParameter(index++).Value = item.ServiceName;
_saveItemCommand.GetParameter(index++).Value = string.Join("|", item.Tags.ToArray());
_saveItemCommand.GetParameter(index++).Value = item.IsFolder;
@@ -1095,11 +1087,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
if (!reader.IsDBNull(43))
{
- var tvItem = item as ILiveTvItem;
- if (tvItem != null)
- {
- tvItem.ServiceName = reader.GetString(43);
- }
+ item.ServiceName = reader.GetString(43);
}
if (!reader.IsDBNull(44))