Merge pull request #2001 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-07-30 17:22:41 -04:00 committed by GitHub
commit e7f0dda38f
91 changed files with 87 additions and 252 deletions

View File

@ -997,10 +997,7 @@ namespace MediaBrowser.Api.LiveTv
public async Task<object> Get(GetRecordingGroup request)
{
var result = await _liveTvManager.GetRecordingGroups(new RecordingGroupQuery
{
}, CancellationToken.None).ConfigureAwait(false);
var result = await _liveTvManager.GetRecordingGroups(new RecordingGroupQuery(), CancellationToken.None).ConfigureAwait(false);
var group = result.Items.FirstOrDefault(i => string.Equals(i.Id, request.Id, StringComparison.OrdinalIgnoreCase));

View File

@ -1788,6 +1788,19 @@ namespace MediaBrowser.Api.Playback
{
state.OutputAudioCodec = "copy";
}
else
{
// If the user doesn't have access to transcoding, then force stream copy, regardless of whether it will be compatible or not
var auth = AuthorizationContext.GetAuthorizationInfo(Request);
if (!string.IsNullOrWhiteSpace(auth.UserId))
{
var user = UserManager.GetUserById(auth.UserId);
if (!user.Policy.EnableAudioPlaybackTranscoding)
{
state.OutputAudioCodec = "copy";
}
}
}
}
private void AttachMediaSourceInfo(StreamState state,

View File

@ -3,7 +3,6 @@ using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Net;

View File

@ -1,7 +1,5 @@
using MediaBrowser.Model.Logging;
using ServiceStack.Web;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;

View File

@ -8,8 +8,6 @@ using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Dto;
using ServiceStack;
using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying;
namespace MediaBrowser.Api.UserLibrary

View File

@ -4,11 +4,9 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using ServiceStack;
using System;
using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Model.Querying;
namespace MediaBrowser.Api.UserLibrary

View File

@ -8,7 +8,6 @@ using MediaBrowser.Model.Entities;
using ServiceStack;
using System;
using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Model.Querying;
namespace MediaBrowser.Api.UserLibrary

View File

@ -1,5 +1,4 @@
using MediaBrowser.Controller.Collections;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Localization;

View File

@ -8,8 +8,6 @@ using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Dto;
using ServiceStack;
using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying;
namespace MediaBrowser.Api.UserLibrary

View File

@ -57,10 +57,7 @@ namespace MediaBrowser.Controller.Channels
catch
{
// Already logged at lower levels
return new QueryResult<BaseItem>
{
};
return new QueryResult<BaseItem>();
}
}

View File

@ -83,8 +83,7 @@ namespace MediaBrowser.Controller.Channels
{
var list = new List<MediaStream>();
if (!string.IsNullOrWhiteSpace(info.VideoCodec) &&
!string.IsNullOrWhiteSpace(info.AudioCodec))
if (!string.IsNullOrWhiteSpace(info.VideoCodec))
{
list.Add(new MediaStream
{
@ -99,7 +98,10 @@ namespace MediaBrowser.Controller.Channels
BitRate = info.VideoBitrate,
AverageFrameRate = info.Framerate
});
}
if (!string.IsNullOrWhiteSpace(info.AudioCodec))
{
list.Add(new MediaStream
{
Type = MediaStreamType.Audio,

View File

@ -1,5 +1,4 @@
using MediaBrowser.Common.Progress;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Dto;
@ -919,10 +918,7 @@ namespace MediaBrowser.Controller.Entities
catch
{
// Already logged at lower levels
return new QueryResult<BaseItem>
{
};
return new QueryResult<BaseItem>();
}
}

View File

@ -1,5 +1,4 @@
using System;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using System.Collections.Generic;
using System.Threading;

View File

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
namespace MediaBrowser.Controller.Entities
{

View File

@ -1,7 +1,6 @@
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
using System.Collections.Generic;
using System.Runtime.Serialization;

View File

@ -1,6 +1,5 @@
using System;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Users;
using MoreLinq;

View File

@ -2,9 +2,7 @@
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
using System.Collections.Generic;
using System.Globalization;
using System.Runtime.Serialization;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Model.Providers;
namespace MediaBrowser.Controller.Entities

View File

@ -1,6 +1,5 @@
using System.Runtime.Serialization;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Library;
using MediaBrowser.Model.Querying;
using System;
@ -8,7 +7,6 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Library;
namespace MediaBrowser.Controller.Entities
{

View File

@ -1,5 +1,4 @@
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Collections;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Entities.TV;
@ -14,12 +13,10 @@ using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Querying;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Model.Configuration;
using MoreLinq;
namespace MediaBrowser.Controller.Entities

View File

@ -1,5 +1,4 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.LiveTv;

View File

@ -1,5 +1,4 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;

View File

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.LiveTv
namespace MediaBrowser.Controller.LiveTv
{
public class TimerEventInfo
{

View File

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.LiveTv
namespace MediaBrowser.Controller.LiveTv
{
public class TunerChannelMapping
{

View File

@ -1,5 +1,4 @@
using System.Linq;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Dlna;
namespace MediaBrowser.Controller.MediaEncoding
{

View File

@ -1,7 +1,6 @@
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.MediaInfo;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.Dlna;

View File

@ -1,20 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Dlna.ContentDirectory;
using MediaBrowser.Dlna.PlayTo;
using MediaBrowser.Model.Channels;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
namespace MediaBrowser.Dlna.Channels
namespace MediaBrowser.Dlna.Channels
{
//public class DlnaChannel : IChannel, IDisposable
//{

View File

@ -14,10 +14,8 @@ using MediaBrowser.Dlna.Ssdp;
using MediaBrowser.Model.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Dlna.Channels;
namespace MediaBrowser.Dlna.Main
{

View File

@ -6,7 +6,6 @@ using MediaBrowser.Controller.Dlna;
using MediaBrowser.Dlna.Server;
using MediaBrowser.Model.Logging;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;

View File

@ -1,6 +1,5 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;

View File

@ -65,7 +65,7 @@ namespace MediaBrowser.LocalMetadata.Savers
var xmlFilePath = GetSavePath(item);
XmlSaverHelpers.Save(builder, xmlFilePath, new List<string> { }, _config, _fileSystem);
XmlSaverHelpers.Save(builder, xmlFilePath, new List<string>(), _config, _fileSystem);
}
/// <summary>

View File

@ -79,7 +79,7 @@ namespace MediaBrowser.LocalMetadata.Savers
var xmlFilePath = GetSavePath(item);
XmlSaverHelpers.Save(builder, xmlFilePath, new List<string> { }, _config, _fileSystem);
XmlSaverHelpers.Save(builder, xmlFilePath, new List<string>(), _config, _fileSystem);
}
/// <summary>

View File

@ -72,7 +72,7 @@ namespace MediaBrowser.LocalMetadata.Savers
var xmlFilePath = GetSavePath(item);
XmlSaverHelpers.Save(builder, xmlFilePath, new List<string> { }, _config, _fileSystem);
XmlSaverHelpers.Save(builder, xmlFilePath, new List<string>(), _config, _fileSystem);
}
/// <summary>

View File

@ -40,7 +40,7 @@ namespace MediaBrowser.MediaEncoding.BdInfo
outputStream.RunTimeTicks = TimeSpan.FromSeconds(playlist.TotalLength).Ticks;
var mediaStreams = new List<MediaStream> { };
var mediaStreams = new List<MediaStream>();
foreach (var stream in playlist.SortedStreams)
{

View File

@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using MediaBrowser.Model.Logging;
namespace MediaBrowser.MediaEncoding.Encoder

View File

@ -600,18 +600,22 @@ namespace MediaBrowser.Model.Dlna
{
defaultBitrate = 192000;
}
if (!string.IsNullOrEmpty(targetAudioCodec) && audioStream != null && StringHelper.EqualsIgnoreCase(audioStream.Codec, targetAudioCodec))
{
defaultBitrate = audioStream.BitRate ?? defaultBitrate;
}
if (targetAudioChannels.HasValue)
{
if (targetAudioChannels.Value >= 5 && (maxTotalBitrate ?? 0) >= 2000000)
if (targetAudioChannels.Value >= 5 && (maxTotalBitrate ?? 0) >= 1500000)
{
if (StringHelper.EqualsIgnoreCase(targetAudioCodec, "ac3"))
{
defaultBitrate = 448000;
defaultBitrate = Math.Max(448000, defaultBitrate);
}
else
{
defaultBitrate = 320000;
defaultBitrate = Math.Max(320000, defaultBitrate);
}
}
}

View File

@ -7,7 +7,6 @@ using MediaBrowser.Model.Providers;
using MediaBrowser.Model.Sync;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.Serialization;

View File

@ -1,5 +1,4 @@
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics;
using System.Runtime.Serialization;
namespace MediaBrowser.Model.Dto

View File

@ -2,7 +2,6 @@
using MediaBrowser.Model.Connect;
using MediaBrowser.Model.Users;
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.Serialization;

View File

@ -1,5 +1,4 @@
using System;
using System.ComponentModel;
namespace MediaBrowser.Model.Dto
{

View File

@ -2,7 +2,6 @@
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Library;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.Serialization;

View File

@ -1,7 +1,6 @@
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
namespace MediaBrowser.Model.Session

View File

@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
using CommonIO;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;

View File

@ -10,7 +10,6 @@ using MediaBrowser.Model.Logging;
using MediaBrowser.Model.MediaInfo;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

View File

@ -6,7 +6,6 @@ using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Localization;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Providers;

View File

@ -2,7 +2,6 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Providers;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

View File

@ -6,7 +6,6 @@ using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Providers;
using MediaBrowser.Providers.TV;
using System;
using System.Collections.Generic;
using System.Globalization;

View File

@ -10,8 +10,6 @@ using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Providers;
using MediaBrowser.Model.Serialization;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

View File

@ -1,5 +1,4 @@
using CommonIO;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;

View File

@ -135,9 +135,7 @@ namespace MediaBrowser.Providers.TV
{
var directoryService = new DirectoryService(_fileSystem);
await series.RefreshMetadata(new MetadataRefreshOptions(directoryService)
{
}, cancellationToken).ConfigureAwait(false);
await series.RefreshMetadata(new MetadataRefreshOptions(directoryService), cancellationToken).ConfigureAwait(false);
await series.ValidateChildren(new Progress<double>(), cancellationToken, new MetadataRefreshOptions(directoryService), true)
.ConfigureAwait(false);
@ -438,9 +436,7 @@ namespace MediaBrowser.Providers.TV
await season.AddChild(episode, cancellationToken).ConfigureAwait(false);
await episode.RefreshMetadata(new MetadataRefreshOptions(_fileSystem)
{
}, cancellationToken).ConfigureAwait(false);
await episode.RefreshMetadata(new MetadataRefreshOptions(_fileSystem), cancellationToken).ConfigureAwait(false);
}
/// <summary>

View File

@ -10,7 +10,6 @@ using MediaBrowser.Model.Providers;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Providers.Omdb;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

View File

@ -14,7 +14,6 @@ using CommonIO;
using MediaBrowser.Common.ScheduledTasks;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Model.Tasks;
namespace MediaBrowser.Providers.TV
{

View File

@ -6,7 +6,6 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Providers;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;

View File

@ -5,7 +5,6 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging;

View File

@ -657,7 +657,7 @@ namespace MediaBrowser.Server.Implementations.Channels
_logger.ErrorException("Error getting all media from {0}", ex, i.Name);
}
}
return new Tuple<IChannel, ChannelItemResult>(i, new ChannelItemResult { });
return new Tuple<IChannel, ChannelItemResult>(i, new ChannelItemResult());
});
var results = await Task.WhenAll(tasks).ConfigureAwait(false);
@ -811,7 +811,7 @@ namespace MediaBrowser.Server.Implementations.Channels
_logger.ErrorException("Error getting all media from {0}", ex, i.Name);
}
}
return new Tuple<IChannel, ChannelItemResult>(i, new ChannelItemResult { });
return new Tuple<IChannel, ChannelItemResult>(i, new ChannelItemResult());
});
var results = await Task.WhenAll(tasks).ConfigureAwait(false);

View File

@ -11,7 +11,6 @@ using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Playlists;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Controller.Sync;
using MediaBrowser.Model.Drawing;
@ -102,8 +101,8 @@ namespace MediaBrowser.Server.Implementations.Dto
var syncDictionary = GetSyncedItemProgressDictionary(syncJobItems);
var list = new List<BaseItemDto>();
var programTuples = new List<Tuple<BaseItem, BaseItemDto>> { };
var channelTuples = new List<Tuple<BaseItemDto, LiveTvChannel>> { };
var programTuples = new List<Tuple<BaseItem, BaseItemDto>>();
var channelTuples = new List<Tuple<BaseItemDto, LiveTvChannel>>();
foreach (var item in items)
{

View File

@ -7,9 +7,7 @@ using Mono.Nat;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using MediaBrowser.Common.Threading;
namespace MediaBrowser.Server.Implementations.EntryPoints

View File

@ -1,9 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Controller.Plugins;

View File

@ -67,6 +67,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
public override void Configure(Container container)
{
HostConfig.Instance.DefaultRedirectPath = DefaultRedirectPath;
HostConfig.Instance.LogUnobservedTaskExceptions = false;
HostConfig.Instance.MapExceptionToStatusCode = new Dictionary<Type, int>
{
@ -80,7 +81,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
{typeof (ApplicationException), 500}
};
HostConfig.Instance.DebugMode = true;
HostConfig.Instance.DebugMode = false;
HostConfig.Instance.LogFactory = LogManager.LogFactory;

View File

@ -5,14 +5,12 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Logging;
using MediaBrowser.Server.Implementations.ScheduledTasks;
using Microsoft.Win32;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using CommonIO;
using MediaBrowser.Controller;

View File

@ -278,8 +278,7 @@ namespace MediaBrowser.Server.Implementations.Library
}
var preferredSubs = string.IsNullOrEmpty(user.Configuration.SubtitleLanguagePreference)
? new List<string> { }
: new List<string> { user.Configuration.SubtitleLanguagePreference };
? new List<string>() : new List<string> { user.Configuration.SubtitleLanguagePreference };
var defaultAudioIndex = source.DefaultAudioStreamIndex;
var audioLangage = defaultAudioIndex == null

View File

@ -1,5 +1,4 @@
using System;
using System.IO;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using System.Linq;

View File

@ -10,7 +10,6 @@ using MediaBrowser.Model.Logging;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

View File

@ -1,5 +1,4 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Logging;
using System;
using System.Collections.Generic;

View File

@ -1,7 +1,6 @@
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Logging;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

View File

@ -12,7 +12,6 @@ using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.FileOrganization;
using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Serialization;
@ -26,8 +25,6 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using CommonIO;
using MediaBrowser.Common.Events;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Power;

View File

@ -11,7 +11,6 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Emby.XmlTv.Classes;
using Emby.XmlTv.Entities;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;

View File

@ -141,7 +141,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts
return new List<MediaSourceInfo> { mediaSource };
}
return new List<MediaSourceInfo> { };
return new List<MediaSourceInfo>();
}
protected override Task<bool> IsAvailableInternal(TunerHostInfo tuner, string channelId, CancellationToken cancellationToken)

View File

@ -1,6 +1,4 @@
using System;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

View File

@ -110,7 +110,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp
return new List<MediaSourceInfo> { mediaSource };
}
return new List<MediaSourceInfo> { };
return new List<MediaSourceInfo>();
}
protected override async Task<MediaSourceInfo> GetChannelStream(TunerHostInfo tuner, string channelId, string streamId, CancellationToken cancellationToken)

View File

@ -4,7 +4,6 @@ using MediaBrowser.Model.Serialization;
using System;
using System.Data;
using System.IO;
using System.Threading.Tasks;
namespace MediaBrowser.Server.Implementations.Persistence
{

View File

@ -1,12 +1,7 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SQLite;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
namespace MediaBrowser.Server.Implementations.Persistence

View File

@ -3,7 +3,6 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Sorting;
using MediaBrowser.Model.Querying;
using System;
using System.Linq;
namespace MediaBrowser.Server.Implementations.Sorting
{

View File

@ -951,8 +951,7 @@ namespace MediaBrowser.Server.Implementations.Sync
: new[] { user.Configuration.AudioLanguagePreference };
var preferredSubs = string.IsNullOrEmpty(user.Configuration.SubtitleLanguagePreference)
? new List<string> { }
: new List<string> { user.Configuration.SubtitleLanguagePreference };
? new List<string>() : new List<string> { user.Configuration.SubtitleLanguagePreference };
foreach (var source in mediaSources)
{

View File

@ -152,7 +152,7 @@ namespace MediaBrowser.Server.Implementations.Sync
UserId = request.UserId,
UnwatchedOnly = request.UnwatchedOnly,
ItemLimit = request.ItemLimit,
RequestedItemIds = request.ItemIds ?? new List<string> { },
RequestedItemIds = request.ItemIds ?? new List<string>(),
DateCreated = DateTime.UtcNow,
DateLastModified = DateTime.UtcNow,
SyncNewContent = request.SyncNewContent,

View File

@ -1,6 +1,4 @@
using System;
using System.Data;
using System.Data.SQLite;
using System.Data;
using System.Threading.Tasks;
using MediaBrowser.Model.Logging;
using MediaBrowser.Server.Implementations.Persistence;

View File

@ -362,9 +362,7 @@ namespace MediaBrowser.Server.Startup.Common
private void PerformPreInitMigrations()
{
var migrations = new List<IVersionMigration>
{
};
var migrations = new List<IVersionMigration>();
foreach (var task in migrations)
{

View File

@ -1,7 +1,5 @@
using MediaBrowser.Controller;
using MediaBrowser.Model.Logging;
using System;
using System.Diagnostics;
namespace MediaBrowser.Server.Startup.Common.Browser
{

View File

@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Linq;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Library;

View File

@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Linq;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Library;

View File

@ -19,7 +19,6 @@ using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using CommonIO.Windows;
using Emby.Drawing.ImageMagick;
using ImageMagickSharp;
using MediaBrowser.Common.Net;
using MediaBrowser.Server.Implementations.Logging;
@ -619,6 +618,12 @@ namespace MediaBrowser.ServerApplication
private static void ShutdownWindowsApplication()
{
if (_serverNotifyIcon != null)
{
_serverNotifyIcon.Dispose();
_serverNotifyIcon = null;
}
//_logger.Info("Calling Application.Exit");
//Application.Exit();

View File

@ -1,6 +1,4 @@
using System;
using System.Data;
using System.Data.SQLite;
using System.Data;
using System.Threading.Tasks;
using MediaBrowser.Model.Logging;
using MediaBrowser.Server.Implementations.Persistence;

View File

@ -1,11 +1,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
using System.Threading.Tasks;
using CommonIO;
namespace MediaBrowser.ServerApplication.Native

View File

@ -7,7 +7,6 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using CommonIO;
using MediaBrowser.Controller.Power;
using MediaBrowser.Model.System;

View File

@ -4,14 +4,13 @@ using MediaBrowser.Controller.Localization;
using MediaBrowser.Model.Logging;
using MediaBrowser.Server.Startup.Common.Browser;
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace MediaBrowser.ServerApplication
{
public class ServerNotifyIcon : IDisposable
{
bool IsDisposing = false;
private NotifyIcon notifyIcon1;
private ContextMenuStrip contextMenuStrip1;
private ToolStripMenuItem cmdExit;
@ -21,25 +20,13 @@ namespace MediaBrowser.ServerApplication
private ToolStripMenuItem cmdRestart;
private ToolStripSeparator toolStripSeparator1;
private ToolStripMenuItem cmdCommunity;
private Container components;
private readonly ILogger _logger;
private readonly IServerApplicationHost _appHost;
private readonly IServerConfigurationManager _configurationManager;
private readonly ILocalizationManager _localization;
public bool Visible
{
get
{
return notifyIcon1.Visible;
}
set
{
Action act = () => notifyIcon1.Visible = false;
Invoke(act);
}
}
public void Invoke(Action action)
{
contextMenuStrip1.Invoke(action);
@ -55,7 +42,7 @@ namespace MediaBrowser.ServerApplication
_appHost = appHost;
_configurationManager = configurationManager;
var components = new System.ComponentModel.Container();
components = new System.ComponentModel.Container();
var resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
contextMenuStrip1 = new ContextMenuStrip(components);
@ -138,32 +125,6 @@ namespace MediaBrowser.ServerApplication
LocalizeText();
notifyIcon1.DoubleClick += notifyIcon1_DoubleClick;
Application.ThreadExit += Application_ThreadExit;
Application.ApplicationExit += Application_ApplicationExit;
}
void Application_ThreadExit(object sender, EventArgs e)
{
try
{
notifyIcon1.Visible = false;
}
catch
{
}
}
void Application_ApplicationExit(object sender, EventArgs e)
{
try
{
notifyIcon1.Visible = false;
}
catch
{
}
}
void notifyIcon1_DoubleClick(object sender, EventArgs e)
@ -222,16 +183,26 @@ namespace MediaBrowser.ServerApplication
_appHost.Shutdown();
}
~ServerNotifyIcon()
{
Dispose();
}
public void Dispose()
{
if (!IsDisposing)
Dispose(true);
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
IsDisposing = true;
if (notifyIcon1 != null)
{
notifyIcon1.Visible = false;
notifyIcon1.Dispose();
notifyIcon1 = null;
}
if (components != null)
{
components.Dispose();
}
}
}
}

View File

@ -5,7 +5,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
namespace MediaBrowser.Tests.ConsistencyTests

View File

@ -2,8 +2,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MediaBrowser.Tests.ConsistencyTests.TextIndexing
{

View File

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MediaBrowser.Tests.ConsistencyTests.TextIndexing
{

View File

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MediaBrowser.Tests.ConsistencyTests.TextIndexing
namespace MediaBrowser.Tests.ConsistencyTests.TextIndexing
{
public struct WordOccurrence
{

View File

@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace MediaBrowser.Tests.ConsistencyTests.TextIndexing
{

View File

@ -671,9 +671,6 @@
<Content Include="dashboard-ui\css\nowplaying.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\css\card.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\dashboardgeneral.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

View File

@ -1,7 +1,6 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.XbmcMetadata.Savers;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;