diff --git a/Emby.Common.Implementations/BaseApplicationHost.cs b/Emby.Common.Implementations/BaseApplicationHost.cs index 147a43fa1..f53433511 100644 --- a/Emby.Common.Implementations/BaseApplicationHost.cs +++ b/Emby.Common.Implementations/BaseApplicationHost.cs @@ -873,7 +873,13 @@ return null; /// Gets or sets a value indicating whether this instance can self update. /// /// true if this instance can self update; otherwise, false. - public abstract bool CanSelfUpdate { get; } + public virtual bool CanSelfUpdate + { + get + { + return false; + } + } /// /// Checks for update. diff --git a/Emby.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs b/Emby.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs index de528a94f..f0518f69e 100644 --- a/Emby.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs +++ b/Emby.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs @@ -379,7 +379,7 @@ namespace Emby.Common.Implementations.ScheduledTasks /// Cannot execute a Task that is already running public async Task Execute(TaskExecutionOptions options) { - var task = ExecuteInternal(options); + var task = Task.Run(async () => await ExecuteInternal(options).ConfigureAwait(false)); _currentTask = task; diff --git a/Emby.Server.Core/ApplicationHost.cs b/Emby.Server.Core/ApplicationHost.cs index 2163c4e47..c3d88eeab 100644 --- a/Emby.Server.Core/ApplicationHost.cs +++ b/Emby.Server.Core/ApplicationHost.cs @@ -312,7 +312,13 @@ namespace Emby.Server.Core } } - public abstract bool SupportsRunningAsService { get; } + public virtual bool SupportsRunningAsService + { + get + { + return false; + } + } /// /// Gets the name. @@ -326,14 +332,26 @@ namespace Emby.Server.Core } } - public abstract bool IsRunningAsService { get; } + public virtual bool IsRunningAsService + { + get + { + return false; + } + } private Assembly GetAssembly(Type type) { return type.GetTypeInfo().Assembly; } - public abstract bool SupportsAutoRunAtStartup { get; } + public virtual bool SupportsAutoRunAtStartup + { + get + { + return EnvironmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Windows; + } + } private void SetBaseExceptionMessage() { @@ -716,7 +734,13 @@ namespace Emby.Server.Core await ((UserManager)UserManager).Initialize().ConfigureAwait(false); } - protected abstract bool SupportsDualModeSockets { get; } + protected virtual bool SupportsDualModeSockets + { + get + { + return true; + } + } private ICertificate GetCertificate(string certificateLocation) { @@ -761,7 +785,75 @@ namespace Emby.Server.Core return new ImageProcessor(LogManager.GetLogger("ImageProcessor"), ServerConfigurationManager.ApplicationPaths, FileSystemManager, JsonSerializer, ImageEncoder, maxConcurrentImageProcesses, () => LibraryManager, TimerFactory); } - protected abstract FFMpegInstallInfo GetFfmpegInstallInfo(); + protected virtual FFMpegInstallInfo GetFfmpegInstallInfo() + { + var info = new FFMpegInstallInfo(); + + // Windows builds: http://ffmpeg.zeranoe.com/builds/ + // Linux builds: http://johnvansickle.com/ffmpeg/ + // OS X builds: http://ffmpegmac.net/ + // OS X x64: http://www.evermeet.cx/ffmpeg/ + + if (EnvironmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Linux) + { + info.FFMpegFilename = "ffmpeg"; + info.FFProbeFilename = "ffprobe"; + info.ArchiveType = "7z"; + info.Version = "20160215"; + info.DownloadUrls = GetLinuxDownloadUrls(); + } + else if (EnvironmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Windows) + { + info.FFMpegFilename = "ffmpeg.exe"; + info.FFProbeFilename = "ffprobe.exe"; + info.Version = "20160410"; + info.ArchiveType = "7z"; + info.DownloadUrls = GetWindowsDownloadUrls(); + } + + // No version available - user requirement + info.DownloadUrls = new string[] { }; + + return info; + } + + private string[] GetWindowsDownloadUrls() + { + switch (EnvironmentInfo.SystemArchitecture) + { + case Architecture.X64: + return new[] + { + "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/windows/ffmpeg-20160410-win64.7z" + }; + case Architecture.X86: + return new[] + { + "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/windows/ffmpeg-20160410-win32.7z" + }; + } + + return new string[] { }; + } + + private string[] GetLinuxDownloadUrls() + { + switch (EnvironmentInfo.SystemArchitecture) + { + case Architecture.X64: + return new[] + { + "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/linux/ffmpeg-git-20160215-64bit-static.7z" + }; + case Architecture.X86: + return new[] + { + "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/linux/ffmpeg-git-20160215-32bit-static.7z" + }; + } + + return new string[] { }; + } /// /// Registers the media encoder. @@ -1489,7 +1581,10 @@ namespace Emby.Server.Core } } - protected abstract void AuthorizeServer(); + protected virtual void AuthorizeServer() + { + throw new NotImplementedException(); + } public event EventHandler HasUpdateAvailableChanged; @@ -1565,7 +1660,10 @@ namespace Emby.Server.Core } } - protected abstract void ConfigureAutoRunInternal(bool autorun); + protected virtual void ConfigureAutoRunInternal(bool autorun) + { + throw new NotImplementedException(); + } /// /// This returns localhost in the case of no external dns, and the hostname if the @@ -1631,7 +1729,10 @@ namespace Emby.Server.Core EnableLoopbackInternal(appName); } - protected abstract void EnableLoopbackInternal(string appName); + protected virtual void EnableLoopbackInternal(string appName) + { + + } private void RegisterModules() { diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index 30fa68d95..1f72ebd54 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -2872,7 +2872,8 @@ namespace Emby.Server.Implementations.Data } if (string.Equals(name, ItemSortBy.IsFavoriteOrLiked, StringComparison.OrdinalIgnoreCase)) { - return new Tuple("IsFavorite", true); + // (Select Case When Abs(COALESCE(ProductionYear, 0) - @ItemProductionYear) < 10 Then 2 Else 0 End ) + return new Tuple("(Select Case When IsFavorite is null Then 0 Else IsFavorite End )", true); } if (string.Equals(name, ItemSortBy.IsFolder, StringComparison.OrdinalIgnoreCase)) { diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index 5b0bd8bbc..824812494 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -492,7 +492,7 @@ namespace Emby.Server.Implementations.Dto } } - //if (!(item is LiveTvProgram)) + if (!(item is LiveTvProgram)) { dto.PlayAccess = item.GetPlayAccess(user); } @@ -1420,7 +1420,7 @@ namespace Emby.Server.Implementations.Dto { dto.AirDays = series.AirDays; dto.AirTime = series.AirTime; - dto.SeriesStatus = series.Status; + dto.Status = series.Status.HasValue ? series.Status.Value.ToString() : null; } // Add SeasonInfo diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index 7aae0d68a..1fc3dcd72 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -986,6 +986,11 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV foreach (var program in programs) { program.ChannelId = channelId; + + if (provider.Item2.EnableNewProgramIds) + { + program.Id += "_" + channelId; + } } if (programs.Count > 0) diff --git a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs index 0d7a26553..f76735030 100644 --- a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs +++ b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs @@ -81,12 +81,6 @@ namespace Emby.Server.Implementations.LiveTv.Listings return programsInfo; } - if (string.IsNullOrWhiteSpace(info.ListingsId)) - { - _logger.Warn("ListingsId is null, returning empty program list"); - return programsInfo; - } - var dates = GetScheduleRequestDates(startDateUtc, endDateUtc); string stationID = channelId; @@ -156,7 +150,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings programDetails.Where(p => p.hasImageArtwork).Select(p => p.programID) .ToList(); - var images = await GetImageForPrograms(info, programIdsWithImages, cancellationToken); + var images = await GetImageForPrograms(info, programIdsWithImages, cancellationToken).ConfigureAwait(false); var schedules = dailySchedules.SelectMany(d => d.programs); foreach (ScheduleDirect.Program schedule in schedules) diff --git a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs index a89acf647..c22bb1171 100644 --- a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs +++ b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs @@ -168,7 +168,6 @@ namespace Emby.Server.Implementations.LiveTv.Listings EpisodeNumber = p.Episode == null ? null : p.Episode.Episode, EpisodeTitle = episodeTitle, Genres = p.Categories, - Id = String.Format("{0}_{1:O}", p.ChannelId, p.StartDate), // Construct an id from the channel and start date, StartDate = GetDate(p.StartDate), Name = p.Title, Overview = p.Description, @@ -208,6 +207,9 @@ namespace Emby.Server.Implementations.LiveTv.Listings programInfo.ShowId = uniqueString.GetMD5().ToString("N"); } + // Construct an id from the channel and start date + programInfo.Id = String.Format("{0}_{1:O}", p.ChannelId, p.StartDate); + if (programInfo.IsMovie) { programInfo.IsSeries = false; diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs index d5ea0d493..887784213 100644 --- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs @@ -598,10 +598,6 @@ namespace Emby.Server.Implementations.LiveTv item.ParentId = channel.Id; //item.ChannelType = channelType; - if (!string.Equals(item.ServiceName, serviceName, StringComparison.Ordinal)) - { - forceUpdate = true; - } item.ServiceName = serviceName; item.Audio = info.Audio; @@ -1311,7 +1307,7 @@ namespace Emby.Server.Implementations.LiveTv var isKids = false; var iSSeries = false; - var channelPrograms = await service.GetProgramsAsync(GetItemExternalId(currentChannel), start, end, cancellationToken).ConfigureAwait(false); + var channelPrograms = (await service.GetProgramsAsync(GetItemExternalId(currentChannel), start, end, cancellationToken).ConfigureAwait(false)).ToList(); var existingPrograms = _libraryManager.GetItemList(new InternalItemsQuery { @@ -1409,7 +1405,7 @@ namespace Emby.Server.Implementations.LiveTv double percent = numComplete; percent /= allChannelsList.Count; - progress.Report(80 * percent + 10); + progress.Report(85 * percent + 15); } progress.Report(100); @@ -1884,7 +1880,7 @@ namespace Emby.Server.Implementations.LiveTv : _tvDtoService.GetInternalTimerId(service.Name, info.TimerId).ToString("N"); dto.StartDate = info.StartDate; - dto.RecordingStatus = info.Status; + dto.Status = info.Status.ToString(); dto.IsRepeat = info.IsRepeat; dto.EpisodeTitle = info.EpisodeTitle; dto.IsMovie = info.IsMovie; @@ -2865,6 +2861,7 @@ namespace Emby.Server.Implementations.LiveTv { info.Id = Guid.NewGuid().ToString("N"); config.ListingProviders.Add(info); + info.EnableNewProgramIds = true; } else { diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs index 1c7c0828c..bc9d01254 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs @@ -9,17 +9,14 @@ using MediaBrowser.Model.MediaInfo; using MediaBrowser.Model.Serialization; using System; using System.Collections.Generic; -using System.Globalization; using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Model.IO; using MediaBrowser.Common.Extensions; -using MediaBrowser.Common.IO; using MediaBrowser.Controller; using MediaBrowser.Controller.Configuration; -using MediaBrowser.Controller.IO; using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Net; @@ -66,7 +63,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun return id; } - private async Task> GetLineup(TunerHostInfo info, CancellationToken cancellationToken) + private async Task> GetLineup(TunerHostInfo info, CancellationToken cancellationToken) { var options = new HttpRequestOptions { @@ -74,7 +71,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun CancellationToken = cancellationToken, BufferContent = false }; - using (var stream = await _httpClient.Get(options)) + using (var stream = await _httpClient.Get(options).ConfigureAwait(false)) { var lineup = JsonSerializer.DeserializeFromStream>(stream) ?? new List(); @@ -127,7 +124,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun CacheMode = CacheMode.Unconditional, TimeoutMs = Convert.ToInt32(TimeSpan.FromSeconds(5).TotalMilliseconds), BufferContent = false - })) + + }).ConfigureAwait(false)) { var response = JsonSerializer.DeserializeFromStream(stream); @@ -169,7 +167,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun CancellationToken = cancellationToken, TimeoutMs = Convert.ToInt32(TimeSpan.FromSeconds(5).TotalMilliseconds), BufferContent = false - })) + + }).ConfigureAwait(false)) { var tuners = new List(); using (var sr = new StreamReader(stream, System.Text.Encoding.UTF8)) @@ -536,7 +535,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun Url = string.Format("{0}/discover.json", GetApiUrl(info, false)), CancellationToken = CancellationToken.None, BufferContent = false - })) + + }).ConfigureAwait(false)) { var response = JsonSerializer.DeserializeFromStream(stream); diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/MulticastStream.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/MulticastStream.cs index a7e1b3cf3..df83d4341 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/MulticastStream.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/MulticastStream.cs @@ -74,10 +74,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts OnFinished = OnFinished }; - var initial = _sharedBuffer.ToList(); var list = new List(); - - foreach (var bytes in initial) + foreach (var bytes in _sharedBuffer) { list.AddRange(bytes); } diff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.cs index a3d43a3f9..dcaf7c676 100644 --- a/MediaBrowser.Api/ItemUpdateService.cs +++ b/MediaBrowser.Api/ItemUpdateService.cs @@ -401,10 +401,21 @@ namespace MediaBrowser.Api var series = item as Series; if (series != null) { - series.Status = request.SeriesStatus; + series.Status = GetSeriesStatus(request); series.AirDays = request.AirDays; series.AirTime = request.AirTime; } } + + private SeriesStatus? GetSeriesStatus(BaseItemDto item) + { + if (string.IsNullOrEmpty(item.Status)) + { + return null; + } + + return (SeriesStatus)Enum.Parse(typeof(SeriesStatus), item.Status, true); + + } } } diff --git a/MediaBrowser.Api/MediaBrowser.Api.csproj b/MediaBrowser.Api/MediaBrowser.Api.csproj index db5914f81..6c8c6b2ab 100644 --- a/MediaBrowser.Api/MediaBrowser.Api.csproj +++ b/MediaBrowser.Api/MediaBrowser.Api.csproj @@ -173,10 +173,6 @@ {17E1F4E6-8ABD-4FE5-9ECF-43D4B6087BA2} MediaBrowser.Controller - - {0bd82fa6-eb8a-4452-8af5-74f9c3849451} - MediaBrowser.MediaEncoding - {7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B} MediaBrowser.Model diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index e561b3f46..e1559cabf 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -22,7 +22,6 @@ using System.Threading.Tasks; using MediaBrowser.Common.Net; using MediaBrowser.Controller; using MediaBrowser.Controller.Net; -using MediaBrowser.MediaEncoding.Encoder; using MediaBrowser.Model.Diagnostics; namespace MediaBrowser.Api.Playback diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.cs index 4fb936340..912d60889 100644 --- a/MediaBrowser.Api/Playback/StreamState.cs +++ b/MediaBrowser.Api/Playback/StreamState.cs @@ -13,7 +13,7 @@ using System.Globalization; using System.IO; using System.Linq; using System.Threading; -using MediaBrowser.MediaEncoding.Encoder; +using MediaBrowser.Controller.MediaEncoding; namespace MediaBrowser.Api.Playback { diff --git a/MediaBrowser.Api/Playback/UniversalAudioService.cs b/MediaBrowser.Api/Playback/UniversalAudioService.cs index a52ae1df4..e50d0f2c5 100644 --- a/MediaBrowser.Api/Playback/UniversalAudioService.cs +++ b/MediaBrowser.Api/Playback/UniversalAudioService.cs @@ -199,9 +199,9 @@ namespace MediaBrowser.Api.Playback if (isHeadRequest) { - return service.Head(newRequest); + return await service.Head(newRequest).ConfigureAwait(false); } - return service.Get(newRequest); + return await service.Get(newRequest).ConfigureAwait(false); } else { @@ -239,9 +239,9 @@ namespace MediaBrowser.Api.Playback if (isHeadRequest) { - return service.Head(newRequest); + return await service.Head(newRequest).ConfigureAwait(false); } - return service.Get(newRequest); + return await service.Get(newRequest).ConfigureAwait(false); } } } diff --git a/MediaBrowser.Api/Sync/SyncHelper.cs b/MediaBrowser.Api/Sync/SyncHelper.cs index 60df2bb1e..116cd8060 100644 --- a/MediaBrowser.Api/Sync/SyncHelper.cs +++ b/MediaBrowser.Api/Sync/SyncHelper.cs @@ -37,7 +37,7 @@ namespace MediaBrowser.Api.Sync options.Add(SyncJobOption.ItemLimit); break; } - if (item.IsFolderItem && !item.IsMusicGenre && !item.IsArtist && !item.IsType("musicalbum") && !item.IsGameGenre) + if ((item.IsFolder ?? false) && !item.IsMusicGenre && !item.IsArtist && !item.IsType("musicalbum") && !item.IsGameGenre) { options.Add(SyncJobOption.Quality); options.Add(SyncJobOption.Profile); @@ -57,7 +57,7 @@ namespace MediaBrowser.Api.Sync { if (item.SupportsSync ?? false) { - if (item.IsFolderItem || item.IsGameGenre || item.IsMusicGenre || item.IsGenre || item.IsArtist || item.IsStudio || item.IsPerson) + if ((item.IsFolder ?? false) || item.IsGameGenre || item.IsMusicGenre || item.IsGenre || item.IsArtist || item.IsStudio || item.IsPerson) { options.Add(SyncJobOption.SyncNewContent); options.Add(SyncJobOption.ItemLimit); diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 28229f8a7..db5a5009c 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -184,6 +184,8 @@ + + diff --git a/MediaBrowser.MediaEncoding/Encoder/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs similarity index 99% rename from MediaBrowser.MediaEncoding/Encoder/EncodingHelper.cs rename to MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index ed9552964..c6cbc8986 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -3,22 +3,16 @@ using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; -using System.Text; using System.Threading; -using System.Threading.Tasks; -using MediaBrowser.Common.Configuration; using MediaBrowser.Controller.Configuration; -using MediaBrowser.Controller.Library; -using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; -using MediaBrowser.Model.Logging; using MediaBrowser.Model.MediaInfo; -namespace MediaBrowser.MediaEncoding.Encoder +namespace MediaBrowser.Controller.MediaEncoding { public class EncodingHelper { diff --git a/MediaBrowser.MediaEncoding/Encoder/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs similarity index 96% rename from MediaBrowser.MediaEncoding/Encoder/EncodingJobInfo.cs rename to MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs index 20a9817a3..a18b86432 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncodingJobInfo.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs @@ -1,11 +1,7 @@ using System; using System.Collections.Generic; using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; @@ -13,7 +9,7 @@ using MediaBrowser.Model.IO; using MediaBrowser.Model.Logging; using MediaBrowser.Model.MediaInfo; -namespace MediaBrowser.MediaEncoding.Encoder +namespace MediaBrowser.Controller.MediaEncoding { // For now, a common base class until the API and MediaEncoding classes are unified public class EncodingJobInfo diff --git a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj index 5eac1a16d..63e789a59 100644 --- a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj +++ b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj @@ -50,10 +50,8 @@ - - diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index ff3f0be59..f8e1ca1b4 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -342,15 +342,6 @@ namespace MediaBrowser.Model.Dto /// true if this instance is folder; otherwise, false. public bool? IsFolder { get; set; } - [IgnoreDataMember] - public bool IsFolderItem - { - get - { - return IsFolder ?? false; - } - } - /// /// Gets or sets the parent id. /// @@ -458,56 +449,6 @@ namespace MediaBrowser.Model.Dto /// The status. public string Status { get; set; } - [IgnoreDataMember] - public SeriesStatus? SeriesStatus - { - get - { - if (string.IsNullOrEmpty(Status)) - { - return null; - } - - return (SeriesStatus)Enum.Parse(typeof(SeriesStatus), Status, true); - } - set - { - if (value == null) - { - Status = null; - } - else - { - Status = value.Value.ToString(); - } - } - } - - [IgnoreDataMember] - public RecordingStatus? RecordingStatus - { - get - { - if (string.IsNullOrEmpty(Status)) - { - return null; - } - - return (RecordingStatus)Enum.Parse(typeof(RecordingStatus), Status, true); - } - set - { - if (value == null) - { - Status = null; - } - else - { - Status = value.Value.ToString(); - } - } - } - /// /// Gets or sets the air time. /// @@ -650,19 +591,6 @@ namespace MediaBrowser.Model.Dto return IsType(type.Name); } - /// - /// Gets or sets a value indicating whether [supports playlists]. - /// - /// true if [supports playlists]; otherwise, false. - [IgnoreDataMember] - public bool SupportsPlaylists - { - get - { - return RunTimeTicks.HasValue || IsFolderItem || IsGenre || IsMusicGenre || IsArtist; - } - } - /// /// Determines whether the specified type is type. /// @@ -876,56 +804,6 @@ namespace MediaBrowser.Model.Dto /// The series timer identifier. public string SeriesTimerId { get; set; } - /// - /// Gets a value indicating whether this instance can resume. - /// - /// true if this instance can resume; otherwise, false. - [IgnoreDataMember] - public bool CanResume - { - get { return UserData != null && UserData.PlaybackPositionTicks > 0; } - } - - /// - /// Gets the resume position ticks. - /// - /// The resume position ticks. - [IgnoreDataMember] - public long ResumePositionTicks - { - get { return UserData == null ? 0 : UserData.PlaybackPositionTicks; } - } - - /// - /// Gets the backdrop count. - /// - /// The backdrop count. - [IgnoreDataMember] - public int BackdropCount - { - get { return BackdropImageTags == null ? 0 : BackdropImageTags.Count; } - } - - /// - /// Gets the screenshot count. - /// - /// The screenshot count. - [IgnoreDataMember] - public int ScreenshotCount - { - get { return ScreenshotImageTags == null ? 0 : ScreenshotImageTags.Count; } - } - - /// - /// Gets a value indicating whether this instance has banner. - /// - /// true if this instance has banner; otherwise, false. - [IgnoreDataMember] - public bool HasBanner - { - get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Banner); } - } - /// /// Gets a value indicating whether this instance has art. /// @@ -976,46 +854,6 @@ namespace MediaBrowser.Model.Dto get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Primary); } } - /// - /// Gets a value indicating whether this instance has disc image. - /// - /// true if this instance has disc image; otherwise, false. - [IgnoreDataMember] - public bool HasDiscImage - { - get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Disc); } - } - - /// - /// Gets a value indicating whether this instance has box image. - /// - /// true if this instance has box image; otherwise, false. - [IgnoreDataMember] - public bool HasBoxImage - { - get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Box); } - } - - /// - /// Gets a value indicating whether this instance has box image. - /// - /// true if this instance has box image; otherwise, false. - [IgnoreDataMember] - public bool HasBoxRearImage - { - get { return ImageTags != null && ImageTags.ContainsKey(ImageType.BoxRear); } - } - - /// - /// Gets a value indicating whether this instance has menu image. - /// - /// true if this instance has menu image; otherwise, false. - [IgnoreDataMember] - public bool HasMenuImage - { - get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Menu); } - } - /// /// Gets a value indicating whether this instance is video. /// @@ -1056,16 +894,6 @@ namespace MediaBrowser.Model.Dto get { return StringHelper.EqualsIgnoreCase(Type, "Person"); } } - /// - /// Gets a value indicating whether this instance is root. - /// - /// true if this instance is root; otherwise, false. - [IgnoreDataMember] - public bool IsRoot - { - get { return StringHelper.EqualsIgnoreCase(Type, "AggregateFolder"); } - } - [IgnoreDataMember] public bool IsMusicGenre { diff --git a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs index 5cf52e0ef..e2c6b0503 100644 --- a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs +++ b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs @@ -48,15 +48,6 @@ namespace MediaBrowser.Model.LiveTv public bool ImportFavoritesOnly { get; set; } public bool AllowHWTranscoding { get; set; } public bool IsEnabled { get; set; } - public string M3UUrl { get; set; } - public string InfoUrl { get; set; } - public string FriendlyName { get; set; } - public int Tuners { get; set; } - public string DiseqC { get; set; } - public string SourceA { get; set; } - public string SourceB { get; set; } - public string SourceC { get; set; } - public string SourceD { get; set; } public bool EnableTvgId { get; set; } public TunerHostInfo() @@ -85,6 +76,7 @@ namespace MediaBrowser.Model.LiveTv public string[] MovieCategories { get; set; } public NameValuePair[] ChannelMappings { get; set; } public string MoviePrefix { get; set; } + public bool EnableNewProgramIds { get; set; } public ListingsProviderInfo() { diff --git a/MediaBrowser.Server.Mono/MonoAppHost.cs b/MediaBrowser.Server.Mono/MonoAppHost.cs index 932e2d6cd..93ced1186 100644 --- a/MediaBrowser.Server.Mono/MonoAppHost.cs +++ b/MediaBrowser.Server.Mono/MonoAppHost.cs @@ -26,63 +26,6 @@ namespace MediaBrowser.Server.Mono } } - public override bool CanSelfUpdate - { - get - { - return false; - } - } - - protected override FFMpegInstallInfo GetFfmpegInstallInfo() - { - var info = new FFMpegInstallInfo(); - - // Windows builds: http://ffmpeg.zeranoe.com/builds/ - // Linux builds: http://johnvansickle.com/ffmpeg/ - // OS X builds: http://ffmpegmac.net/ - // OS X x64: http://www.evermeet.cx/ffmpeg/ - - var environment = (MonoEnvironmentInfo) EnvironmentInfo; - - if (environment.IsBsd) - { - - } - else if (environment.OperatingSystem == Model.System.OperatingSystem.Linux) - { - info.FFMpegFilename = "ffmpeg"; - info.FFProbeFilename = "ffprobe"; - info.ArchiveType = "7z"; - info.Version = "20160215"; - info.DownloadUrls = GetDownloadUrls(); - } - - // No version available - user requirement - info.DownloadUrls = new string[] { }; - - return info; - } - - private string[] GetDownloadUrls() - { - switch (EnvironmentInfo.SystemArchitecture) - { - case Architecture.X64: - return new[] - { - "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/linux/ffmpeg-git-20160215-64bit-static.7z" - }; - case Architecture.X86: - return new[] - { - "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/linux/ffmpeg-git-20160215-32bit-static.7z" - }; - } - - return new string[] { }; - } - protected override void RestartInternal() { MainClass.Restart(StartupOptions); @@ -137,40 +80,5 @@ namespace MediaBrowser.Server.Mono return new Version(1, 0); } - - protected override void AuthorizeServer() - { - throw new NotImplementedException(); - } - - protected override void ConfigureAutoRunInternal(bool autorun) - { - throw new NotImplementedException(); - } - - protected override void EnableLoopbackInternal(string appName) - { - } - - public override bool SupportsRunningAsService - { - get - { - return false; - } - } - - public override bool SupportsAutoRunAtStartup - { - get { return false; } - } - - public override bool IsRunningAsService - { - get - { - return false; - } - } } } diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.cs index 0e3f684b5..c42cd0396 100644 --- a/MediaBrowser.ServerApplication/MainStartup.cs +++ b/MediaBrowser.ServerApplication/MainStartup.cs @@ -324,7 +324,7 @@ namespace MediaBrowser.ServerApplication /// The options. private static void RunApplication(ServerApplicationPaths appPaths, ILogManager logManager, bool runService, StartupOptions options) { - var fileSystem = new ManagedFileSystem(logManager.GetLogger("FileSystem"), true, true, true, appPaths.TempDirectory); + var fileSystem = new ManagedFileSystem(logManager.GetLogger("FileSystem"), true, true, false, appPaths.TempDirectory); fileSystem.AddShortcutHandler(new LnkShortcutHandler()); fileSystem.AddShortcutHandler(new MbLinkShortcutHandler(fileSystem)); diff --git a/MediaBrowser.ServerApplication/WindowsAppHost.cs b/MediaBrowser.ServerApplication/WindowsAppHost.cs index ec66923aa..9d19525b4 100644 --- a/MediaBrowser.ServerApplication/WindowsAppHost.cs +++ b/MediaBrowser.ServerApplication/WindowsAppHost.cs @@ -27,38 +27,6 @@ namespace MediaBrowser.ServerApplication get { return MainStartup.IsRunningAsService; } } - protected override FFMpegInstallInfo GetFfmpegInstallInfo() - { - var info = new FFMpegInstallInfo(); - - info.FFMpegFilename = "ffmpeg.exe"; - info.FFProbeFilename = "ffprobe.exe"; - info.Version = "20160410"; - info.ArchiveType = "7z"; - info.DownloadUrls = GetDownloadUrls(); - - return info; - } - - private string[] GetDownloadUrls() - { - switch (EnvironmentInfo.SystemArchitecture) - { - case Architecture.X64: - return new[] - { - "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/windows/ffmpeg-20160410-win64.7z" - }; - case Architecture.X86: - return new[] - { - "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/windows/ffmpeg-20160410-win32.7z" - }; - } - - return new string[] { }; - } - protected override void RestartInternal() { MainStartup.Restart(); @@ -94,7 +62,7 @@ namespace MediaBrowser.ServerApplication protected override void ConfigureAutoRunInternal(bool autorun) { - var startupPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Startup); + var startupPath = Environment.GetFolderPath(System.Environment.SpecialFolder.Startup); if (autorun && !MainStartup.IsRunningAsService) { @@ -121,14 +89,6 @@ namespace MediaBrowser.ServerApplication } } - protected override bool SupportsDualModeSockets - { - get - { - return true; - } - } - protected override void EnableLoopbackInternal(string appName) { LoopUtil.Run(appName); @@ -150,14 +110,6 @@ namespace MediaBrowser.ServerApplication } } - public override bool SupportsAutoRunAtStartup - { - get - { - return true; - } - } - public override bool CanSelfUpdate { get @@ -165,61 +117,5 @@ namespace MediaBrowser.ServerApplication return MainStartup.CanSelfUpdate; } } - - public bool PortsRequireAuthorization(string applicationPath) - { - var appNameSrch = Path.GetFileName(applicationPath); - - var startInfo = new ProcessStartInfo - { - FileName = "netsh", - - Arguments = "advfirewall firewall show rule \"" + appNameSrch + "\"", - - CreateNoWindow = true, - UseShellExecute = false, - WindowStyle = ProcessWindowStyle.Hidden, - ErrorDialog = false, - RedirectStandardOutput = true - }; - - using (var process = Process.Start(startInfo)) - { - process.Start(); - - try - { - var data = process.StandardOutput.ReadToEnd() ?? string.Empty; - - if (data.IndexOf("Block", StringComparison.OrdinalIgnoreCase) != -1) - { - Logger.Info("Found potential windows firewall rule blocking Emby Server: " + data); - } - - //var parts = data.Split('\n'); - - //return parts.Length > 4; - //return Confirm(); - return false; - } - catch (Exception ex) - { - Logger.ErrorException("Error querying windows firewall", ex); - - // Hate having to do this - try - { - process.Kill(); - } - catch (Exception ex1) - { - Logger.ErrorException("Error killing process", ex1); - } - - throw; - } - } - } - } } diff --git a/src/Emby.Server/Program.cs b/src/Emby.Server/Program.cs index fde2ab7b2..5e55cfa29 100644 --- a/src/Emby.Server/Program.cs +++ b/src/Emby.Server/Program.cs @@ -193,7 +193,7 @@ namespace Emby.Server /// The options. private static void RunApplication(ServerApplicationPaths appPaths, ILogManager logManager, StartupOptions options, EnvironmentInfo environmentInfo) { - var fileSystem = new ManagedFileSystem(logManager.GetLogger("FileSystem"), true, true, true, appPaths.TempDirectory); + var fileSystem = new ManagedFileSystem(logManager.GetLogger("FileSystem"), true, true, false, appPaths.TempDirectory); fileSystem.AddShortcutHandler(new MbLinkShortcutHandler(fileSystem));