fix music album image inheritance

This commit is contained in:
Luke Pulverenti 2016-12-17 03:27:41 -05:00
parent ef490818d7
commit cc73830cd6
6 changed files with 46 additions and 4 deletions

View File

@ -548,6 +548,8 @@ namespace Emby.Server.Core
RegisterSingleInstance(UserDataManager); RegisterSingleInstance(UserDataManager);
UserRepository = GetUserRepository(); UserRepository = GetUserRepository();
// This is only needed for disposal purposes. If removing this, make sure to have the manager handle disposing it
RegisterSingleInstance(UserRepository);
var displayPreferencesRepo = new SqliteDisplayPreferencesRepository(LogManager.GetLogger("SqliteDisplayPreferencesRepository"), JsonSerializer, ApplicationPaths, MemoryStreamFactory); var displayPreferencesRepo = new SqliteDisplayPreferencesRepository(LogManager.GetLogger("SqliteDisplayPreferencesRepository"), JsonSerializer, ApplicationPaths, MemoryStreamFactory);
DisplayPreferencesRepository = displayPreferencesRepo; DisplayPreferencesRepository = displayPreferencesRepo;
@ -678,6 +680,8 @@ namespace Emby.Server.Core
var sharingRepo = new SharingRepository(LogManager.GetLogger("SharingRepository"), ApplicationPaths); var sharingRepo = new SharingRepository(LogManager.GetLogger("SharingRepository"), ApplicationPaths);
sharingRepo.Initialize(); sharingRepo.Initialize();
// This is only needed for disposal purposes. If removing this, make sure to have the manager handle disposing it
RegisterSingleInstance<ISharingRepository>(sharingRepo);
RegisterSingleInstance<ISharingManager>(new SharingManager(sharingRepo, ServerConfigurationManager, LibraryManager, this)); RegisterSingleInstance<ISharingManager>(new SharingManager(sharingRepo, ServerConfigurationManager, LibraryManager, this));
var activityLogRepo = GetActivityLogRepository(); var activityLogRepo = GetActivityLogRepository();

View File

@ -286,7 +286,10 @@ namespace Emby.Server.Implementations.Data
{ {
if (_connection != null) if (_connection != null)
{ {
_connection.Close(); using (_connection)
{
}
_connection = null; _connection = null;
} }

View File

@ -1504,6 +1504,20 @@ namespace Emby.Server.Implementations.Dto
} }
} }
private BaseItem GetImageDisplayParent(BaseItem item)
{
var musicAlbum = item as MusicAlbum;
if (musicAlbum != null)
{
var artist = musicAlbum.MusicArtist;
if (artist != null)
{
return artist;
}
}
return item.GetParent();
}
private void AddInheritedImages(BaseItemDto dto, BaseItem item, DtoOptions options, BaseItem owner) private void AddInheritedImages(BaseItemDto dto, BaseItem item, DtoOptions options, BaseItem owner)
{ {
if (!item.SupportsInheritedParentImages) if (!item.SupportsInheritedParentImages)
@ -1528,7 +1542,7 @@ namespace Emby.Server.Implementations.Dto
var isFirst = true; var isFirst = true;
while (((!dto.HasLogo && logoLimit > 0) || (!dto.HasArtImage && artLimit > 0) || (!dto.HasThumb && thumbLimit > 0) || parent is Series) && while (((!dto.HasLogo && logoLimit > 0) || (!dto.HasArtImage && artLimit > 0) || (!dto.HasThumb && thumbLimit > 0) || parent is Series) &&
(parent = parent ?? (isFirst ? item.GetParent() ?? owner : parent)) != null) (parent = parent ?? (isFirst ? GetImageDisplayParent(item) ?? owner : parent)) != null)
{ {
if (parent == null) if (parent == null)
{ {
@ -1585,7 +1599,7 @@ namespace Emby.Server.Implementations.Dto
break; break;
} }
parent = parent.GetParent(); parent = GetImageDisplayParent(parent);
} }
} }

View File

@ -32,6 +32,12 @@ namespace MediaBrowser.Controller.Entities.Audio
get { return true; } get { return true; }
} }
[IgnoreDataMember]
public override bool SupportsInheritedParentImages
{
get { return true; }
}
[IgnoreDataMember] [IgnoreDataMember]
public MusicArtist MusicArtist public MusicArtist MusicArtist
{ {

View File

@ -202,5 +202,10 @@ namespace MediaBrowser.Controller.Entities.Movies
return false; return false;
} }
public override bool IsVisibleStandalone(User user)
{
return IsVisible(user);
}
} }
} }

View File

@ -47,7 +47,17 @@ namespace MediaBrowser.ServerApplication.Updates
product, archive, Process.GetCurrentProcess().Id, version, restartServiceName ?? string.Empty, appPaths.ProgramDataPath, MainStartup.ApplicationPath, systemPath); product, archive, Process.GetCurrentProcess().Id, version, restartServiceName ?? string.Empty, appPaths.ProgramDataPath, MainStartup.ApplicationPath, systemPath);
logger.Info("Args: {0}", args); logger.Info("Args: {0}", args);
Process.Start(tempUpdater, args);
Process.Start(new ProcessStartInfo
{
FileName = tempUpdater,
Arguments = args,
UseShellExecute = false,
CreateNoWindow = true,
ErrorDialog = false,
WindowStyle = ProcessWindowStyle.Hidden,
WorkingDirectory = Path.GetDirectoryName(tempUpdater)
});
// That's it. The installer will do the work once we exit // That's it. The installer will do the work once we exit
} }