Skip to content

Commit

Permalink
Merge pull request #1091 from MediaBrowser/dev
Browse files Browse the repository at this point in the history
3.0.5597.1
  • Loading branch information
LukePulverenti committed Apr 29, 2015
2 parents 7b64deb + 27fc89e commit 1efa098
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 36 deletions.
15 changes: 8 additions & 7 deletions Emby.Drawing/ImageProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ public class ImageProcessor : IImageProcessor, IDisposable
private readonly IImageEncoder _imageEncoder;
private readonly SemaphoreSlim _imageProcessingSemaphore;

public ImageProcessor(ILogger logger,
IServerApplicationPaths appPaths,
IFileSystem fileSystem,
IJsonSerializer jsonSerializer,
IImageEncoder imageEncoder)
public ImageProcessor(ILogger logger,
IServerApplicationPaths appPaths,
IFileSystem fileSystem,
IJsonSerializer jsonSerializer,
IImageEncoder imageEncoder,
int maxConcurrentImageProcesses)
{
_logger = logger;
_fileSystem = fileSystem;
Expand Down Expand Up @@ -93,8 +94,8 @@ public ImageProcessor(ILogger logger,
}

_cachedImagedSizes = new ConcurrentDictionary<Guid, ImageSize>(sizeDictionary);
var count = Environment.ProcessorCount;
_imageProcessingSemaphore = new SemaphoreSlim(count, count);
_logger.Info("ImageProcessor started with {0} max concurrent image processes", maxConcurrentImageProcesses);
_imageProcessingSemaphore = new SemaphoreSlim(maxConcurrentImageProcesses, maxConcurrentImageProcesses);
}

public string[] SupportedInputFormats
Expand Down
14 changes: 13 additions & 1 deletion MediaBrowser.Controller/Entities/Movies/Movie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,19 @@ public List<Guid> GetTrailerIds()
/// <returns>System.String.</returns>
protected override string CreateUserDataKey()
{
return this.GetProviderId(MetadataProviders.Tmdb) ?? this.GetProviderId(MetadataProviders.Imdb) ?? base.CreateUserDataKey();
var key = this.GetProviderId(MetadataProviders.Tmdb);

if (string.IsNullOrWhiteSpace(key))
{
key = this.GetProviderId(MetadataProviders.Imdb);
}

if (string.IsNullOrWhiteSpace(key))
{
key = base.CreateUserDataKey();
}

return key;
}

protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemInfo> fileSystemChildren, CancellationToken cancellationToken)
Expand Down
18 changes: 15 additions & 3 deletions MediaBrowser.Controller/Entities/TV/Series.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public override bool IsPreSorted
/// airdate, dvd or absolute
/// </summary>
public string DisplayOrder { get; set; }

/// <summary>
/// Gets or sets the status.
/// </summary>
Expand Down Expand Up @@ -113,7 +113,19 @@ public override bool IncludeInIndex
/// <returns>System.String.</returns>
protected override string CreateUserDataKey()
{
return this.GetProviderId(MetadataProviders.Tvdb) ?? this.GetProviderId(MetadataProviders.Tvcom) ?? base.CreateUserDataKey();
var key = this.GetProviderId(MetadataProviders.Tvdb);

if (string.IsNullOrWhiteSpace(key))
{
key = this.GetProviderId(MetadataProviders.Imdb);
}

if (string.IsNullOrWhiteSpace(key))
{
key = base.CreateUserDataKey();
}

return key;
}

/// <summary>
Expand Down Expand Up @@ -188,7 +200,7 @@ public IEnumerable<Season> GetSeasons(User user, bool includeMissingSeasons, boo
public IEnumerable<Episode> GetEpisodes(User user)
{
var config = user.Configuration;

return GetEpisodes(user, config.DisplayMissingEpisodes, config.DisplayUnairedEpisodes);
}

Expand Down
14 changes: 13 additions & 1 deletion MediaBrowser.Server.Startup.Common/ApplicationHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ protected override async Task RegisterResources(IProgress<double> progress)
var innerProgress = new ActionableProgress<double>();
innerProgress.RegisterAction(p => progress.Report((.75 * p) + 15));

ImageProcessor = new ImageProcessor(LogManager.GetLogger("ImageProcessor"), ServerConfigurationManager.ApplicationPaths, FileSystemManager, JsonSerializer, GetImageEncoder());
ImageProcessor = GetImageProcessor();
RegisterSingleInstance(ImageProcessor);

TVSeriesManager = new TVSeriesManager(UserManager, UserDataManager, LibraryManager);
Expand Down Expand Up @@ -543,6 +543,18 @@ protected override async Task RegisterResources(IProgress<double> progress)
await ((UserManager)UserManager).Initialize().ConfigureAwait(false);
}

private IImageProcessor GetImageProcessor()
{
var maxConcurrentImageProcesses = Math.Max(Environment.ProcessorCount, 4);

if (_startupOptions.ContainsOption("-imagethreads"))
{
int.TryParse(_startupOptions.GetOption("-imagethreads"), NumberStyles.Any, CultureInfo.InvariantCulture, out maxConcurrentImageProcesses);
}

return new ImageProcessor(LogManager.GetLogger("ImageProcessor"), ServerConfigurationManager.ApplicationPaths, FileSystemManager, JsonSerializer, GetImageEncoder(), maxConcurrentImageProcesses);
}

private IImageEncoder GetImageEncoder()
{
if (!_startupOptions.ContainsOption("-enablegdi"))
Expand Down
12 changes: 8 additions & 4 deletions MediaBrowser.WebDashboard/dashboard-ui/css/card.css
Original file line number Diff line number Diff line change
Expand Up @@ -275,15 +275,19 @@

@media all and (min-width: 540px) {

.portraitCard {
width: 25%;
}

.smallBackdropCard {
width: 33.3%;
}
}


@media all and (min-width: 640px) {

.portraitCard {
width: 25%;
}
}

@media all and (min-width: 700px) {
.backdropCard {
width: 33.3%;
Expand Down
16 changes: 11 additions & 5 deletions MediaBrowser.WebDashboard/dashboard-ui/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@

/* latin */
@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 400;
src: local('Montserrat-Regular'), url(fonts/Montserrat.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
font-family: 'Montserrat';
font-style: normal;
font-weight: 400;
src: local('Montserrat-Regular'), url(fonts/Montserrat.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}

/* For some reason jquery mobile 1.4.5 wants to horitontally pad mini form fields. */
Expand Down Expand Up @@ -156,6 +156,12 @@ h1 a:hover {
display: none;
}

.ui-slider-track.ui-mini .ui-slider-handle {
height: 18px;
width: 18px;
margin: -10px 0 0 -10px;
}

.largePanel {
width: 270px;
}
Expand Down
39 changes: 26 additions & 13 deletions MediaBrowser.WebDashboard/dashboard-ui/scripts/librarymenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,27 +253,40 @@

html += '<div class="sidebarLinks librarySidebarLinks">';

html += '<a style="margin-top:0;padding-left:.6em;display:block;color:#fff;text-decoration:none;font-size:16px;font-weight:400!important;background: #000;" href="mypreferencesdisplay.html?userId=' + Dashboard.getCurrentUserId() + '">';
//var userHref = user.localUser && user.localUser.Policy.EnableUserPreferenceAccess ?
// 'mypreferencesdisplay.html?userId=' + user.localUser.Id :
// (user.localUser ? 'index.html' : '#');

var imgWidth = 48;
//var paddingLeft = user.imageUrl ? 'padding-left:.7em;' : '';
//html += '<a style="margin-top:0;' + paddingLeft + 'display:block;color:#fff;text-decoration:none;font-size:16px;font-weight:400!important;background: #000;" href="' + userHref + '">';

if (user.imageUrl) {
var url = user.imageUrl;
//var imgWidth = 44;

if (user.supportsImageParams) {
url += "&width=" + (imgWidth * Math.max(devicePixelRatio || 1, 2));
}
//if (user.imageUrl) {
// var url = user.imageUrl;

html += '<img style="max-width:' + imgWidth + 'px;vertical-align:middle;margin-right:.8em;border-radius: 50px;" src="' + url + '" />';
}
html += user.name;
html += '</a>';
// if (user.supportsImageParams) {
// url += "&width=" + (imgWidth * Math.max(devicePixelRatio || 1, 2));
// }

html += '<div class="libraryMenuDivider" style="margin-top:0;"></div>';
// html += '<img style="max-width:' + imgWidth + 'px;vertical-align:middle;margin-right:.8em;border-radius: 50px;" src="' + url + '" />';
//} else {
// html += '<span class="fa fa-user sidebarLinkIcon"></span>';
//}

//html += user.name;
//html += '</a>';

var homeHref = ConnectionManager.currentApiClient() ? 'index.html' : 'selectserver.html';

html += '<a class="lnkMediaFolder sidebarLink homeViewMenu" href="' + homeHref + '"><span class="fa fa-home sidebarLinkIcon"></span>' + Globalize.translate('ButtonHome') + '</a>';
html += '<a class="lnkMediaFolder sidebarLink" style="margin-top:.5em;padding-left:1em;display:block;color:#fff;text-decoration:none;" href="' + homeHref + '">';

html += '<img style="max-width:36px;vertical-align:middle;margin-right:1em;" src="css/images/mblogoicon.png" />';

html += Globalize.translate('ButtonHome');
html += '</a>';

html += '<div class="libraryMenuDivider" style="margin-top:0;"></div>';

html += getViewsHtml();
html += '</div>';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

var screenWidth = $(window).width();

return screenWidth >= 1920 ? 9 : 8;
return screenWidth >= 1920 ? 9 : (screenWidth >= 1200 ? 12 : (screenWidth >= 1000 ? 10 : 8));
}

function loadLatest(page, parentId) {
Expand Down
2 changes: 1 addition & 1 deletion SharedVersion.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Reflection;

//[assembly: AssemblyVersion("3.0.*")]
[assembly: AssemblyVersion("3.0.5597.0")]
[assembly: AssemblyVersion("3.0.5597.1")]

0 comments on commit 1efa098

Please sign in to comment.