Skip to content

Commit

Permalink
Merge pull request #3240 from MediaBrowser/dev
Browse files Browse the repository at this point in the history
update title on video osd
  • Loading branch information
LukePulverenti authored Apr 19, 2018
2 parents b959cf1 + 6e47761 commit 364370f
Show file tree
Hide file tree
Showing 79 changed files with 551 additions and 279 deletions.
34 changes: 2 additions & 32 deletions Emby.Server.Implementations/ApplicationHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -823,8 +823,6 @@ public void Init()
RegisterResources();

FindParts();

InstallIsoMounters();
}

protected virtual void OnLoggerLoaded(bool isFirstLoad)
Expand Down Expand Up @@ -1140,36 +1138,6 @@ private void SetHttpLimit()
}
}

/// <summary>
/// Installs the iso mounters.
/// </summary>
private void InstallIsoMounters()
{
var list = new List<IIsoMounter>();

foreach (var isoMounter in GetExports<IIsoMounter>())
{
try
{
if (isoMounter.RequiresInstallation && !isoMounter.IsInstalled)
{
Logger.Info("Installing {0}", isoMounter.Name);

var task = isoMounter.Install(CancellationToken.None);
Task.WaitAll(task);
}

list.Add(isoMounter);
}
catch (Exception ex)
{
Logger.ErrorException("{0} failed to load.", ex, isoMounter.Name);
}
}

IsoManager.AddParts(list);
}

protected string GetDefaultUserAgent()
{
var name = FormatAttribute(Name);
Expand Down Expand Up @@ -1444,6 +1412,8 @@ protected void FindParts()

NotificationManager.AddParts(GetExports<INotificationService>(), GetExports<INotificationTypeFactory>());
UserManager.AddParts(GetExports<IAuthenticationProvider>());

IsoManager.AddParts(GetExports<IIsoMounter>());
}

private IPlugin LoadPlugin(Tuple<IPlugin, string> info)
Expand Down
2 changes: 1 addition & 1 deletion Emby.Server.Implementations/Localization/Core/kk.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"HeaderCameraUploads": "Camera Uploads",
"HeaderCameraUploads": "\u041a\u0430\u043c\u0435\u0440\u0430\u0434\u0430\u043d \u0436\u04af\u043a\u0442\u0435\u043b\u0433\u0435\u043d\u0434\u0435\u0440",
"Latest": "\u0415\u04a3 \u043a\u0435\u0439\u0456\u043d\u0433\u0456",
"ValueSpecialEpisodeName": "\u0410\u0440\u043d\u0430\u0439\u044b - {0}",
"Inherit": "\u041c\u04b1\u0440\u0430\u0493\u0430 \u0438\u0435\u043b\u0435\u043d\u0443",
Expand Down
8 changes: 4 additions & 4 deletions Emby.Server.Implementations/Localization/Core/nl.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"HeaderCameraUploads": "Camera Uploads",
"HeaderCameraUploads": "Camera uploads",
"Latest": "Nieuwste",
"ValueSpecialEpisodeName": "Speciaal - {0}",
"Inherit": "Overerven",
Expand All @@ -25,11 +25,11 @@
"Channels": "Kanalen",
"Movies": "Films",
"Albums": "Albums",
"NameSeasonUnknown": "Season Unknown",
"NameSeasonUnknown": "Seizoen onbekend",
"Artists": "Artiesten",
"Folders": "Mappen",
"Songs": "Titels",
"TvShows": "TV Shows",
"TvShows": "TV-series",
"Shows": "Series",
"Genres": "Genres",
"NameSeasonNumber": "Seizoen {0}",
Expand All @@ -55,7 +55,7 @@
"UserCreatedWithName": "Gebruiker {0} is aangemaakt",
"UserPasswordChangedWithName": "Wachtwoord voor {0} is gewijzigd",
"UserDeletedWithName": "Gebruiker {0} is verwijderd",
"UserPolicyUpdatedWithName": "User policy has been updated for {0}",
"UserPolicyUpdatedWithName": "Gebruikersbeleid gewijzigd voor {0}",
"MessageServerConfigurationUpdated": "Server configuratie is bijgewerkt",
"MessageNamedServerConfigurationUpdatedWithValue": "Sectie {0} van de server configuratie is bijgewerkt",
"MessageApplicationUpdated": "Emby Server is bijgewerkt",
Expand Down
8 changes: 4 additions & 4 deletions Emby.Server.Implementations/Localization/Core/pl.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"HeaderCameraUploads": "Camera Uploads",
"Latest": "Ostatnio dodane do",
"HeaderCameraUploads": "Przes\u0142ane z aparatu",
"Latest": "Ostatnio dodane",
"ValueSpecialEpisodeName": "Specjalne - {0}",
"Inherit": "Dziedzicz",
"Books": "Ksi\u0105\u017cki",
Expand All @@ -12,7 +12,7 @@
"HomeVideos": "Nagrania prywatne",
"Playlists": "Listy odtwarzania",
"HeaderRecordingGroups": "Grupy nagra\u0144",
"HeaderContinueWatching": "Kontynuuj ogl\u0105danie",
"HeaderContinueWatching": "Kontynuuj odtwarzanie",
"HeaderFavoriteArtists": "Wykonawcy ulubieni",
"HeaderFavoriteSongs": "Utwory ulubione",
"HeaderAlbumArtists": "Wykonawcy album\u00f3w",
Expand All @@ -25,7 +25,7 @@
"Channels": "Kana\u0142y",
"Movies": "Filmy",
"Albums": "Albumy",
"NameSeasonUnknown": "Season Unknown",
"NameSeasonUnknown": "Sezon nieznany",
"Artists": "Wykonawcy",
"Folders": "Foldery",
"Songs": "Utwory",
Expand Down
2 changes: 1 addition & 1 deletion Emby.Server.Implementations/Localization/Core/ru.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"HeaderCameraUploads": "Camera Uploads",
"HeaderCameraUploads": "\u0412\u044b\u043a\u043b\u0430\u0434\u043a\u0430 \u0441 \u043a\u0430\u043c\u0435\u0440",
"Latest": "\u041d\u043e\u0432\u0435\u0439\u0448\u0435\u0435",
"ValueSpecialEpisodeName": "\u0421\u043f\u0435\u0446\u044d\u043f\u0438\u0437\u043e\u0434 - {0}",
"Inherit": "\u041d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u043e\u0435",
Expand Down
29 changes: 4 additions & 25 deletions MediaBrowser.Controller/Sync/IServerSyncProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.IO;
using MediaBrowser.Controller.Entities;

namespace MediaBrowser.Controller.Sync
{
Expand All @@ -13,38 +14,16 @@ public interface IServerSyncProvider : ISyncProvider
/// <summary>
/// Transfers the file.
/// </summary>
/// <param name="stream">The stream.</param>
/// <param name="pathParts">The path parts.</param>
/// <param name="target">The target.</param>
/// <param name="progress">The progress.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task<SyncedFileInfo> SendFile(Stream stream, string[] pathParts, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
Task<SyncedFileInfo> SendFile(SyncJob syncJob, string originalMediaPath, Stream inputStream, string[] outputPathParts, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);

/// <summary>
/// Gets the file.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="target">The target.</param>
/// <param name="progress">The progress.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;Stream&gt;.</returns>
Task<Stream> GetFile(string id, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);

Task<QueryResult<FileSystemMetadata>> GetFiles(string[] pathParts, SyncTarget target, CancellationToken cancellationToken);
Task<QueryResult<FileSystemMetadata>> GetFiles(string[] directoryPathParts, SyncTarget target, CancellationToken cancellationToken);
}

public interface ISupportsDirectCopy
{
/// <summary>
/// Sends the file.
/// </summary>
/// <param name="path">The path.</param>
/// <param name="pathParts">The path parts.</param>
/// <param name="target">The target.</param>
/// <param name="progress">The progress.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;SyncedFileInfo&gt;.</returns>
Task<SyncedFileInfo> SendFile(string path, string[] pathParts, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
Task<SyncedFileInfo> SendFile(SyncJob syncJob, string originalMediaPath, string inputPath, string[] outputPathParts, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
}
}
30 changes: 17 additions & 13 deletions MediaBrowser.Model/Dlna/StreamBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -855,10 +855,16 @@ private StreamInfo BuildVideoItem(MediaSourceInfo item, VideoOptions options)
}
}

var audioTranscodingConditions = new List<CodecProfile>();
// Honor requested max channels
playlistItem.GlobalMaxAudioChannels = options.MaxAudioChannels;

int audioBitrate = GetAudioBitrate(playlistItem.SubProtocol, options.GetMaxBitrate(false), playlistItem.TargetAudioCodec, audioStream, playlistItem);
playlistItem.AudioBitrate = Math.Min(playlistItem.AudioBitrate ?? audioBitrate, audioBitrate);

isFirstAppliedCodecProfile = true;
foreach (CodecProfile i in options.Profile.CodecProfiles)
{
if (i.Type == CodecType.VideoAudio && i.ContainsAnyCodec(playlistItem.TargetAudioCodec, transcodingProfile.Container))
if (i.Type == CodecType.VideoAudio && i.ContainsAnyCodec(transcodingProfile.AudioCodec, transcodingProfile.Container))
{
bool applyConditions = true;
foreach (ProfileCondition applyCondition in i.ApplyConditions)
Expand All @@ -880,18 +886,19 @@ private StreamInfo BuildVideoItem(MediaSourceInfo item, VideoOptions options)

if (applyConditions)
{
audioTranscodingConditions.Add(i);
break;
var transcodingAudioCodecs = ContainerProfile.SplitValue(transcodingProfile.AudioCodec);
foreach (var transcodingAudioCodec in transcodingAudioCodecs)
{
if (i.ContainsAnyCodec(transcodingAudioCodec, transcodingProfile.Container))
{
ApplyTranscodingConditions(playlistItem, i.Conditions, transcodingAudioCodec, true, isFirstAppliedCodecProfile);
isFirstAppliedCodecProfile = false;
}
}
}
}
}

// Honor requested max channels
playlistItem.GlobalMaxAudioChannels = options.MaxAudioChannels;

int audioBitrate = GetAudioBitrate(playlistItem.SubProtocol, options.GetMaxBitrate(false), playlistItem.TargetAudioCodec, audioStream, playlistItem);
playlistItem.AudioBitrate = Math.Min(playlistItem.AudioBitrate ?? audioBitrate, audioBitrate);

var maxBitrateSetting = options.GetMaxBitrate(false);
// Honor max rate
if (maxBitrateSetting.HasValue)
Expand All @@ -908,9 +915,6 @@ private StreamInfo BuildVideoItem(MediaSourceInfo item, VideoOptions options)
var longBitrate = Math.Max(Math.Min(availableBitrateForVideo, currentValue), 64000);
playlistItem.VideoBitrate = longBitrate >= int.MaxValue ? int.MaxValue : Convert.ToInt32(longBitrate);
}

// Do this after initial values are set to account for greater than/less than conditions
ApplyTranscodingConditions(playlistItem, audioTranscodingConditions);
}

playlistItem.TranscodeReasons = transcodeReasons;
Expand Down
19 changes: 0 additions & 19 deletions MediaBrowser.Model/IO/IIsoMounter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;

Expand All @@ -24,24 +23,6 @@ public interface IIsoMounter : IDisposable
/// <returns><c>true</c> if this instance can mount the specified path; otherwise, <c>false</c>.</returns>
bool CanMount(string path);

/// <summary>
/// Gets a value indicating whether [requires installation].
/// </summary>
/// <value><c>true</c> if [requires installation]; otherwise, <c>false</c>.</value>
bool RequiresInstallation { get; }

/// <summary>
/// Gets a value indicating whether this instance is installed.
/// </summary>
/// <value><c>true</c> if this instance is installed; otherwise, <c>false</c>.</value>
bool IsInstalled { get; }

/// <summary>
/// Installs this instance.
/// </summary>
/// <returns>Task.</returns>
Task Install(CancellationToken cancellationToken);

/// <summary>
/// Gets the name.
/// </summary>
Expand Down
3 changes: 3 additions & 0 deletions MediaBrowser.Model/MediaBrowser.Model.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@
<Compile Include="Net\SocketReceiveResult.cs" />
<Compile Include="Services\HttpUtility.cs" />
<Compile Include="Services\IHttpResult.cs" />
<Compile Include="Sync\SyncCategory.cs" />
<Compile Include="Sync\SyncJob.cs" />
<Compile Include="Sync\SyncJobStatus.cs" />
<Compile Include="System\IEnvironmentInfo.cs" />
<Compile Include="System\IPowerManagement.cs" />
<Compile Include="System\WakeOnLanInfo.cs" />
Expand Down
19 changes: 19 additions & 0 deletions MediaBrowser.Model/Sync/SyncCategory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

namespace MediaBrowser.Model.Sync
{
public enum SyncCategory
{
/// <summary>
/// The latest
/// </summary>
Latest = 0,
/// <summary>
/// The next up
/// </summary>
NextUp = 1,
/// <summary>
/// The resume
/// </summary>
Resume = 2
}
}
Loading

0 comments on commit 364370f

Please sign in to comment.